Merge
authorlana
Fri, 26 Jul 2013 14:07:32 -0700
changeset 19057 516e33e98aa6
parent 19055 c9200137a4a8 (current diff)
parent 18978 edb01c460d4c (diff)
child 19058 1c6217d6f528
Merge
hotspot/src/share/vm/memory/klassInfoClosure.hpp
hotspot/src/share/vm/runtime/aprofiler.cpp
hotspot/src/share/vm/runtime/aprofiler.hpp
langtools/test/tools/javac/generics/6723444/T6723444.out
langtools/test/tools/javac/generics/7015430/T7015430.out
nashorn/src/jdk/nashorn/internal/ir/ExecuteNode.java
nashorn/test/script/currently-failing/JDK-8006529.js
--- a/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -219,3 +219,6 @@
 49fe9c8049132647ad38837a877dd473e6c9b0e5 jdk8-b95
 ea73f01b9053e7165e7ba80f242bafecbc6af712 jdk8-b96
 0a85476a0b9cb876d5666d45097dac68bef3fce1 jdk8-b97
+711eb4aa87de68de78250e0549980936bab53d54 jdk8-b98
+2d3875b0d18b3ad1c2bebf385a697e309e4005a4 jdk8-b99
+3d34036aae4ea90b2ca59712d5a69db3221f0875 jdk8-b100
--- a/.hgtags-top-repo	Fri Jul 26 10:12:14 2013 +0200
+++ b/.hgtags-top-repo	Fri Jul 26 14:07:32 2013 -0700
@@ -219,3 +219,6 @@
 785d07fe38901ecc1b7e0145e53e1c3da9361fee jdk8-b95
 c156084add486f941c12d886a0b1b2854795d557 jdk8-b96
 a1c1e8bf71f354f3aec0214cf13d6668811e021d jdk8-b97
+0d0c983a817bbe8518a5ff201306334a8de267f2 jdk8-b98
+59dc9da813794c924a0383c2a6241af94defdfed jdk8-b99
+d2dcb110e9dbaf9903c05b211df800e78e4b394e jdk8-b100
--- a/corba/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/corba/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -219,3 +219,6 @@
 2cf36f43df36137980d9828cec27003ec10daeee jdk8-b95
 3357c2776431d51a8de326a85e0f41420e40774f jdk8-b96
 469995a8e97424f450c880606d689bf345277b19 jdk8-b97
+3370fb6146e47a6cc05a213fc213e12fc0a38d07 jdk8-b98
+3f67804ab61303782df57e54989ef5e0e4629beb jdk8-b99
+8d492f1dfd1b131a4c7886ee6b59528609f7e4fe jdk8-b100
--- a/hotspot/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -357,3 +357,9 @@
 2b9380b0bf0b649f40704735773e8956c2d88ba0 hs25-b39
 d197d377ab2e016d024e8c86cb06a57bd7eae590 jdk8-b97
 c9dd82da51ed34a28f7c6b3245163ee962e94572 hs25-b40
+30b5b75c42ac5174b640fbef8aa87527668e8400 jdk8-b98
+2b9946e10587f74ef75ae8145bea484df4a2738b hs25-b41
+81b6cb70717c66375846b78bb174594ec3aa998e jdk8-b99
+9f71e36a471ae4a668e08827d33035963ed10c08 hs25-b42
+5787fac72e760c6a5fd9efa113b0c75caf554136 jdk8-b100
+46487ba40ff225654d0c51787ed3839bafcbd9f3 hs25-b43
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java	Fri Jul 26 14:07:32 2013 -0700
@@ -49,7 +49,6 @@
     higherDimension    = new MetadataField(type.getAddressField("_higher_dimension"), 0);
     lowerDimension     = new MetadataField(type.getAddressField("_lower_dimension"), 0);
     vtableLen          = new CIntField(type.getCIntegerField("_vtable_len"), 0);
-    allocSize          = new CIntField(type.getCIntegerField("_alloc_size"), 0);
     componentMirror    = new OopField(type.getOopField("_component_mirror"), 0);
     javaLangCloneableName = null;
     javaLangObjectName = null;
@@ -64,7 +63,6 @@
   private static MetadataField  higherDimension;
   private static MetadataField  lowerDimension;
   private static CIntField vtableLen;
-  private static CIntField allocSize;
   private static OopField  componentMirror;
 
   public Klass getJavaSuper() {
@@ -76,7 +74,6 @@
   public Klass getHigherDimension() { return (Klass) higherDimension.getValue(this); }
   public Klass getLowerDimension()  { return (Klass) lowerDimension.getValue(this); }
   public long  getVtableLen()       { return         vtableLen.getValue(this); }
-  public long  getAllocSize()       { return         allocSize.getValue(this); }
   public Oop   getComponentMirror() { return         componentMirror.getValue(this); }
 
   // constant class names - javaLangCloneable, javaIoSerializable, javaLangObject
@@ -147,7 +144,6 @@
     visitor.doMetadata(higherDimension, true);
     visitor.doMetadata(lowerDimension, true);
       visitor.doCInt(vtableLen, true);
-      visitor.doCInt(allocSize, true);
       visitor.doOop(componentMirror, true);
     }
   }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java	Fri Jul 26 14:07:32 2013 -0700
@@ -57,7 +57,6 @@
     accessFlags  = new CIntField(type.getCIntegerField("_access_flags"), 0);
     subklass     = new MetadataField(type.getAddressField("_subklass"), 0);
     nextSibling  = new MetadataField(type.getAddressField("_next_sibling"), 0);
-    allocCount   = new CIntField(type.getCIntegerField("_alloc_count"), 0);
 
     LH_INSTANCE_SLOW_PATH_BIT  = db.lookupIntConstant("Klass::_lh_instance_slow_path_bit").intValue();
     LH_LOG2_ELEMENT_SIZE_SHIFT = db.lookupIntConstant("Klass::_lh_log2_element_size_shift").intValue();
@@ -87,7 +86,6 @@
   private static CIntField accessFlags;
   private static MetadataField  subklass;
   private static MetadataField  nextSibling;
-  private static CIntField allocCount;
 
   private Address getValue(AddressField field) {
     return addr.getAddressAt(field.getOffset());
@@ -108,7 +106,6 @@
   public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags());      }
   public Klass    getSubklassKlass()    { return (Klass)    subklass.getValue(this);     }
   public Klass    getNextSiblingKlass() { return (Klass)    nextSibling.getValue(this);  }
-  public long     getAllocCount()       { return            allocCount.getValue(this);   }
 
   // computed access flags - takes care of inner classes etc.
   // This is closer to actual source level than getAccessFlags() etc.
@@ -172,7 +169,6 @@
       visitor.doCInt(accessFlags, true);
     visitor.doMetadata(subklass, true);
     visitor.doMetadata(nextSibling, true);
-      visitor.doCInt(allocCount, true);
     }
 
   public long getObjectSize() {
--- a/hotspot/make/bsd/makefiles/mapfile-vers-debug	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug	Fri Jul 26 14:07:32 2013 -0700
@@ -221,7 +221,6 @@
                 _JVM_SetLength
                 _JVM_SetNativeThreadName
                 _JVM_SetPrimitiveArrayElement
-                _JVM_SetProtectionDomain
                 _JVM_SetSockOpt
                 _JVM_SetThreadPriority
                 _JVM_Sleep
--- a/hotspot/make/bsd/makefiles/mapfile-vers-product	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/bsd/makefiles/mapfile-vers-product	Fri Jul 26 14:07:32 2013 -0700
@@ -221,7 +221,6 @@
                 _JVM_SetLength
                 _JVM_SetNativeThreadName
                 _JVM_SetPrimitiveArrayElement
-                _JVM_SetProtectionDomain
                 _JVM_SetSockOpt
                 _JVM_SetThreadPriority
                 _JVM_Sleep
--- a/hotspot/make/hotspot_version	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/hotspot_version	Fri Jul 26 14:07:32 2013 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=40
+HS_BUILD_NUMBER=43
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
--- a/hotspot/make/linux/makefiles/mapfile-vers-debug	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/linux/makefiles/mapfile-vers-debug	Fri Jul 26 14:07:32 2013 -0700
@@ -223,7 +223,6 @@
                 JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetProtectionDomain;
                 JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
--- a/hotspot/make/linux/makefiles/mapfile-vers-product	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/linux/makefiles/mapfile-vers-product	Fri Jul 26 14:07:32 2013 -0700
@@ -223,7 +223,6 @@
                 JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetProtectionDomain;
                 JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
--- a/hotspot/make/linux/makefiles/vm.make	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/linux/makefiles/vm.make	Fri Jul 26 14:07:32 2013 -0700
@@ -46,6 +46,7 @@
   include $(MAKEFILES_DIR)/zeroshark.make
 else
   include $(MAKEFILES_DIR)/$(BUILDARCH).make
+  -include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
 endif
 
 # set VPATH so make knows where to look for source files
@@ -211,6 +212,12 @@
 Src_Files_EXCLUDE += \*x86_32\*
 endif
 
+# Alternate vm.make
+# This has to be included here to allow changes to the source
+# directories and excluded files before they are expanded
+# by the definition of Src_Files.
+-include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make
+
 # Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
 define findsrc
 	$(notdir $(shell find $(1)/. ! -name . -prune \
@@ -380,4 +387,4 @@
 
 install: install_jvm install_jsig install_saproc
 
-.PHONY: default build install install_jvm
+.PHONY: default build install install_jvm $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make
--- a/hotspot/make/solaris/makefiles/mapfile-vers	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/solaris/makefiles/mapfile-vers	Fri Jul 26 14:07:32 2013 -0700
@@ -223,7 +223,6 @@
                 JVM_SetLength;
                 JVM_SetNativeThreadName;
                 JVM_SetPrimitiveArrayElement;
-                JVM_SetProtectionDomain;
                 JVM_SetSockOpt;
                 JVM_SetThreadPriority;
                 JVM_Sleep;
--- a/hotspot/make/windows/makefiles/compile.make	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/windows/makefiles/compile.make	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -110,6 +110,7 @@
 #      1400 is for VS2005
 #      1500 is for VS2008
 #      1600 is for VS2010
+#      1700 is for VS2012
 #    Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
 #    compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
 #    Normally they are the same, but a pre-release of the VS2005 compilers
@@ -142,6 +143,9 @@
 !if "$(MSC_VER)" == "1600"
 COMPILER_NAME=VS2010
 !endif
+!if "$(MSC_VER)" == "1700"
+COMPILER_NAME=VS2012
+!endif
 !endif
 
 # By default, we do not want to use the debug version of the msvcrt.dll file
@@ -151,9 +155,13 @@
 MS_RUNTIME_OPTION = /MTd /D "_DEBUG"
 !endif
 
+# VS2012 and later won't work with:
+#     /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
+!if "$(MSC_VER)" < "1700"
 # Always add the _STATIC_CPPLIB flag
 STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
 MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)
+!endif
 CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
 
 # How /GX option is spelled
@@ -221,6 +229,22 @@
 !endif
 !endif
 
+!if "$(COMPILER_NAME)" == "VS2012"
+PRODUCT_OPT_OPTION   = /O2 /Oy-
+FASTDEBUG_OPT_OPTION = /O2 /Oy-
+DEBUG_OPT_OPTION     = /Od
+GX_OPTION = /EHsc
+LD_FLAGS = /manifest $(LD_FLAGS)
+# Manifest Tool - used in VS2005 and later to adjust manifests stored
+# as resources inside build artifacts.
+!if "x$(MT)" == "x"
+MT=mt.exe
+!endif
+!if "$(BUILDARCH)" == "i486"
+LD_FLAGS = /SAFESEH $(LD_FLAGS)
+!endif
+!endif
+
 # If NO_OPTIMIZATIONS is defined in the environment, turn everything off
 !ifdef NO_OPTIMIZATIONS
 PRODUCT_OPT_OPTION   = $(DEBUG_OPT_OPTION)
--- a/hotspot/make/windows/makefiles/sanity.make	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/windows/makefiles/sanity.make	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,9 +27,9 @@
 all: checkCL checkLink
 
 checkCL:
-	@ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" \
+	@ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" if "$(MSC_VER)" NEQ "1700" \
 	echo *** WARNING *** unrecognized cl.exe version $(MSC_VER) ($(RAW_MSC_VER)).  Use FORCE_MSC_VER to override automatic detection.
 
 checkLink:
-	@ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" \
+	@ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" if "$(LD_VER)" NEQ "1100" \
 	echo *** WARNING *** unrecognized link.exe version $(LD_VER) ($(RAW_LD_VER)).  Use FORCE_LD_VER to override automatic detection.
--- a/hotspot/make/windows/makefiles/vm.make	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/make/windows/makefiles/vm.make	Fri Jul 26 14:07:32 2013 -0700
@@ -132,6 +132,10 @@
 
 !if "$(USE_PRECOMPILED_HEADER)" != "0"
 CXX_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp"
+!if "$(COMPILER_NAME)" == "VS2012"
+# VS2012 requires this object file to be listed:
+LD_FLAGS=$(LD_FLAGS) _build_pch_file.obj
+!endif
 !else
 CXX_USE_PCH=$(CXX_DONT_USE_PCH)
 !endif
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -240,10 +240,10 @@
 #endif // CC_INTERP
 
 
-inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
+inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
   // note: adjust this code if the link argument in StubGenerator::call_stub() changes!
   const Argument link = Argument(0, false);
-  return (JavaCallWrapper*)sp()[link.as_in().as_register()->sp_offset_in_saved_window()];
+  return (JavaCallWrapper**)&sp()[link.as_in().as_register()->sp_offset_in_saved_window()];
 }
 
 
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -410,6 +410,51 @@
     return start;
   }
 
+  // Safefetch stubs.
+  void generate_safefetch(const char* name, int size, address* entry,
+                          address* fault_pc, address* continuation_pc) {
+    // safefetch signatures:
+    //   int      SafeFetch32(int*      adr, int      errValue);
+    //   intptr_t SafeFetchN (intptr_t* adr, intptr_t errValue);
+    //
+    // arguments:
+    //   o0 = adr
+    //   o1 = errValue
+    //
+    // result:
+    //   o0  = *adr or errValue
+
+    StubCodeMark mark(this, "StubRoutines", name);
+
+    // Entry point, pc or function descriptor.
+    __ align(CodeEntryAlignment);
+    *entry = __ pc();
+
+    __ mov(O0, G1);  // g1 = o0
+    __ mov(O1, O0);  // o0 = o1
+    // Load *adr into c_rarg1, may fault.
+    *fault_pc = __ pc();
+    switch (size) {
+      case 4:
+        // int32_t
+        __ ldsw(G1, 0, O0);  // o0 = [g1]
+        break;
+      case 8:
+        // int64_t
+        __ ldx(G1, 0, O0);   // o0 = [g1]
+        break;
+      default:
+        ShouldNotReachHere();
+    }
+
+    // return errValue or *adr
+    *continuation_pc = __ pc();
+    // By convention with the trap handler we ensure there is a non-CTI
+    // instruction in the trap shadow.
+    __ nop();
+    __ retl();
+    __ delayed()->nop();
+  }
 
   //------------------------------------------------------------------------------------------------------------------------
   // Continuation point for throwing of implicit exceptions that are not handled in
@@ -3315,6 +3360,14 @@
 
     // Don't initialize the platform math functions since sparc
     // doesn't have intrinsics for these operations.
+
+    // Safefetch stubs.
+    generate_safefetch("SafeFetch32", sizeof(int),     &StubRoutines::_safefetch32_entry,
+                                                       &StubRoutines::_safefetch32_fault_pc,
+                                                       &StubRoutines::_safefetch32_continuation_pc);
+    generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry,
+                                                       &StubRoutines::_safefetchN_fault_pc,
+                                                       &StubRoutines::_safefetchN_continuation_pc);
   }
 
 
--- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -272,11 +272,10 @@
 
 // Entry frames
 
-inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
- return (JavaCallWrapper*)at(entry_frame_call_wrapper_offset);
+inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
+ return (JavaCallWrapper**)addr_at(entry_frame_call_wrapper_offset);
 }
 
-
 // Compiled frames
 
 inline int frame::local_offset_for_compiler(int local_index, int nof_args, int max_nof_locals, int max_nof_monitors) {
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -2766,6 +2766,39 @@
     return start;
   }
 
+  // Safefetch stubs.
+  void generate_safefetch(const char* name, int size, address* entry,
+                          address* fault_pc, address* continuation_pc) {
+    // safefetch signatures:
+    //   int      SafeFetch32(int*      adr, int      errValue);
+    //   intptr_t SafeFetchN (intptr_t* adr, intptr_t errValue);
+
+    StubCodeMark mark(this, "StubRoutines", name);
+
+    // Entry point, pc or function descriptor.
+    *entry = __ pc();
+
+    __ movl(rax, Address(rsp, 0x8));
+    __ movl(rcx, Address(rsp, 0x4));
+    // Load *adr into eax, may fault.
+    *fault_pc = __ pc();
+    switch (size) {
+      case 4:
+        // int32_t
+        __ movl(rax, Address(rcx, 0));
+        break;
+      case 8:
+        // int64_t
+        Unimplemented();
+        break;
+      default:
+        ShouldNotReachHere();
+    }
+
+    // Return errValue or *adr.
+    *continuation_pc = __ pc();
+    __ ret(0);
+  }
 
  public:
   // Information about frame layout at time of blocking runtime call.
@@ -2978,6 +3011,14 @@
       StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt();
       StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt();
     }
+
+    // Safefetch stubs.
+    generate_safefetch("SafeFetch32", sizeof(int), &StubRoutines::_safefetch32_entry,
+                                                   &StubRoutines::_safefetch32_fault_pc,
+                                                   &StubRoutines::_safefetch32_continuation_pc);
+    StubRoutines::_safefetchN_entry           = StubRoutines::_safefetch32_entry;
+    StubRoutines::_safefetchN_fault_pc        = StubRoutines::_safefetch32_fault_pc;
+    StubRoutines::_safefetchN_continuation_pc = StubRoutines::_safefetch32_continuation_pc;
   }
 
 
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -279,7 +279,7 @@
       __ stmxcsr(mxcsr_save);
       __ movl(rax, mxcsr_save);
       __ andl(rax, MXCSR_MASK);    // Only check control and mask bits
-      ExternalAddress mxcsr_std(StubRoutines::x86::mxcsr_std());
+      ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std());
       __ cmp32(rax, mxcsr_std);
       __ jcc(Assembler::equal, skip_ldmx);
       __ ldmxcsr(mxcsr_std);
@@ -729,17 +729,18 @@
 
     if (CheckJNICalls) {
       Label ok_ret;
+      ExternalAddress mxcsr_std(StubRoutines::addr_mxcsr_std());
       __ push(rax);
       __ subptr(rsp, wordSize);      // allocate a temp location
       __ stmxcsr(mxcsr_save);
       __ movl(rax, mxcsr_save);
       __ andl(rax, MXCSR_MASK);    // Only check control and mask bits
-      __ cmpl(rax, *(int *)(StubRoutines::x86::mxcsr_std()));
+      __ cmp32(rax, mxcsr_std);
       __ jcc(Assembler::equal, ok_ret);
 
       __ warn("MXCSR changed by native JNI code, use -XX:+RestoreMXCSROnJNICall");
 
-      __ ldmxcsr(ExternalAddress(StubRoutines::x86::mxcsr_std()));
+      __ ldmxcsr(mxcsr_std);
 
       __ bind(ok_ret);
       __ addptr(rsp, wordSize);
@@ -3357,7 +3358,45 @@
     return start;
   }
 
-
+  // Safefetch stubs.
+  void generate_safefetch(const char* name, int size, address* entry,
+                          address* fault_pc, address* continuation_pc) {
+    // safefetch signatures:
+    //   int      SafeFetch32(int*      adr, int      errValue);
+    //   intptr_t SafeFetchN (intptr_t* adr, intptr_t errValue);
+    //
+    // arguments:
+    //   c_rarg0 = adr
+    //   c_rarg1 = errValue
+    //
+    // result:
+    //   PPC_RET  = *adr or errValue
+
+    StubCodeMark mark(this, "StubRoutines", name);
+
+    // Entry point, pc or function descriptor.
+    *entry = __ pc();
+
+    // Load *adr into c_rarg1, may fault.
+    *fault_pc = __ pc();
+    switch (size) {
+      case 4:
+        // int32_t
+        __ movl(c_rarg1, Address(c_rarg0, 0));
+        break;
+      case 8:
+        // int64_t
+        __ movq(c_rarg1, Address(c_rarg0, 0));
+        break;
+      default:
+        ShouldNotReachHere();
+    }
+
+    // return errValue or *adr
+    *continuation_pc = __ pc();
+    __ movq(rax, c_rarg1);
+    __ ret(0);
+  }
 
   // This is a version of CBC/AES Decrypt which does 4 blocks in a loop at a time
   // to hide instruction latency
@@ -3729,12 +3768,35 @@
     return stub->entry_point();
   }
 
+  void create_control_words() {
+    // Round to nearest, 53-bit mode, exceptions masked
+    StubRoutines::_fpu_cntrl_wrd_std   = 0x027F;
+    // Round to zero, 53-bit mode, exception mased
+    StubRoutines::_fpu_cntrl_wrd_trunc = 0x0D7F;
+    // Round to nearest, 24-bit mode, exceptions masked
+    StubRoutines::_fpu_cntrl_wrd_24    = 0x007F;
+    // Round to nearest, 64-bit mode, exceptions masked
+    StubRoutines::_fpu_cntrl_wrd_64    = 0x037F;
+    // Round to nearest, 64-bit mode, exceptions masked
+    StubRoutines::_mxcsr_std           = 0x1F80;
+    // Note: the following two constants are 80-bit values
+    //       layout is critical for correct loading by FPU.
+    // Bias for strict fp multiply/divide
+    StubRoutines::_fpu_subnormal_bias1[0]= 0x00000000; // 2^(-15360) == 0x03ff 8000 0000 0000 0000
+    StubRoutines::_fpu_subnormal_bias1[1]= 0x80000000;
+    StubRoutines::_fpu_subnormal_bias1[2]= 0x03ff;
+    // Un-Bias for strict fp multiply/divide
+    StubRoutines::_fpu_subnormal_bias2[0]= 0x00000000; // 2^(+15360) == 0x7bff 8000 0000 0000 0000
+    StubRoutines::_fpu_subnormal_bias2[1]= 0x80000000;
+    StubRoutines::_fpu_subnormal_bias2[2]= 0x7bff;
+  }
+
   // Initialization
   void generate_initial() {
     // Generates all stubs and initializes the entry points
 
-    // This platform-specific stub is needed by generate_call_stub()
-    StubRoutines::x86::_mxcsr_std        = generate_fp_mask("mxcsr_std",        0x0000000000001F80);
+    // This platform-specific settings are needed by generate_call_stub()
+    create_control_words();
 
     // entry points that exist in all platforms Note: This is code
     // that could be shared among different platforms - however the
@@ -3833,6 +3895,14 @@
       StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt();
       StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel();
     }
+
+    // Safefetch stubs.
+    generate_safefetch("SafeFetch32", sizeof(int),     &StubRoutines::_safefetch32_entry,
+                                                       &StubRoutines::_safefetch32_fault_pc,
+                                                       &StubRoutines::_safefetch32_continuation_pc);
+    generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry,
+                                                       &StubRoutines::_safefetchN_fault_pc,
+                                                       &StubRoutines::_safefetchN_continuation_pc);
   }
 
  public:
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -42,4 +42,3 @@
 address StubRoutines::x86::_float_sign_flip = NULL;
 address StubRoutines::x86::_double_sign_mask = NULL;
 address StubRoutines::x86::_double_sign_flip = NULL;
-address StubRoutines::x86::_mxcsr_std = NULL;
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -52,7 +52,6 @@
   static address _float_sign_flip;
   static address _double_sign_mask;
   static address _double_sign_flip;
-  static address _mxcsr_std;
 
  public:
 
@@ -106,11 +105,6 @@
     return _double_sign_flip;
   }
 
-  static address mxcsr_std()
-  {
-    return _mxcsr_std;
-  }
-
 # include "stubRoutines_x86.hpp"
 
 };
--- a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -437,6 +437,30 @@
   return op;
 }
 
+
+// Performs initialization at vm startup
+// For BSD we remove any stale .java_pid file which could cause
+// an attaching process to think we are ready to receive on the
+// domain socket before we are properly initialized
+
+void AttachListener::vm_start() {
+  char fn[UNIX_PATH_MAX];
+  struct stat64 st;
+  int ret;
+
+  int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
+           os::get_temp_directory(), os::current_process_id());
+  assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
+
+  RESTARTABLE(::stat64(fn, &st), ret);
+  if (ret == 0) {
+    ret = ::unlink(fn);
+    if (ret == -1) {
+      debug_only(warning("failed to remove stale attach pid file at %s", fn));
+    }
+  }
+}
+
 int AttachListener::pd_init() {
   JavaThread* thread = JavaThread::current();
   ThreadBlockInVM tbivm(thread);
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1234,12 +1234,13 @@
   Dl_info dlinfo;
 
   if (libjvm_base_addr == NULL) {
-    dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo);
-    libjvm_base_addr = (address)dlinfo.dli_fbase;
+    if (dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo) != 0) {
+      libjvm_base_addr = (address)dlinfo.dli_fbase;
+    }
     assert(libjvm_base_addr !=NULL, "Cannot obtain base address for libjvm");
   }
 
-  if (dladdr((void *)addr, &dlinfo)) {
+  if (dladdr((void *)addr, &dlinfo) != 0) {
     if (libjvm_base_addr == (address)dlinfo.dli_fbase) return true;
   }
 
@@ -1251,35 +1252,40 @@
 
 bool os::dll_address_to_function_name(address addr, char *buf,
                                       int buflen, int *offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
   Dl_info dlinfo;
   char localbuf[MACH_MAXSYMLEN];
 
-  // dladdr will find names of dynamic functions only, but does
-  // it set dli_fbase with mach_header address when it "fails" ?
-  if (dladdr((void*)addr, &dlinfo) && dlinfo.dli_sname != NULL) {
-    if (buf != NULL) {
-      if(!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
+  if (dladdr((void*)addr, &dlinfo) != 0) {
+    // see if we have a matching symbol
+    if (dlinfo.dli_saddr != NULL && dlinfo.dli_sname != NULL) {
+      if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
         jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
       }
+      if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
+      return true;
+    }
+    // no matching symbol so try for just file info
+    if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != NULL) {
+      if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+                          buf, buflen, offset, dlinfo.dli_fname)) {
+         return true;
+      }
     }
-    if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
-    return true;
-  } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
-    if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
-       buf, buflen, offset, dlinfo.dli_fname)) {
-       return true;
+
+    // Handle non-dynamic manually:
+    if (dlinfo.dli_fbase != NULL &&
+        Decoder::decode(addr, localbuf, MACH_MAXSYMLEN, offset,
+                        dlinfo.dli_fbase)) {
+      if (!Decoder::demangle(localbuf, buf, buflen)) {
+        jio_snprintf(buf, buflen, "%s", localbuf);
+      }
+      return true;
     }
   }
-
-  // Handle non-dymanic manually:
-  if (dlinfo.dli_fbase != NULL &&
-      Decoder::decode(addr, localbuf, MACH_MAXSYMLEN, offset, dlinfo.dli_fbase)) {
-    if(!Decoder::demangle(localbuf, buf, buflen)) {
-      jio_snprintf(buf, buflen, "%s", localbuf);
-    }
-    return true;
-  }
-  if (buf != NULL) buf[0] = '\0';
+  buf[0] = '\0';
   if (offset != NULL) *offset = -1;
   return false;
 }
@@ -1287,17 +1293,24 @@
 // ported from solaris version
 bool os::dll_address_to_library_name(address addr, char* buf,
                                      int buflen, int* offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
   Dl_info dlinfo;
 
-  if (dladdr((void*)addr, &dlinfo)){
-     if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname);
-     if (offset) *offset = addr - (address)dlinfo.dli_fbase;
-     return true;
-  } else {
-     if (buf) buf[0] = '\0';
-     if (offset) *offset = -1;
-     return false;
+  if (dladdr((void*)addr, &dlinfo) != 0) {
+    if (dlinfo.dli_fname != NULL) {
+      jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname);
+    }
+    if (dlinfo.dli_fbase != NULL && offset != NULL) {
+      *offset = addr - (address)dlinfo.dli_fbase;
+    }
+    return true;
   }
+
+  buf[0] = '\0';
+  if (offset) *offset = -1;
+  return false;
 }
 
 // Loads .dll/.so and
@@ -1520,49 +1533,50 @@
 }
 
 void os::print_dll_info(outputStream *st) {
-   st->print_cr("Dynamic libraries:");
+  st->print_cr("Dynamic libraries:");
 #ifdef RTLD_DI_LINKMAP
-    Dl_info dli;
-    void *handle;
-    Link_map *map;
-    Link_map *p;
-
-    if (!dladdr(CAST_FROM_FN_PTR(void *, os::print_dll_info), &dli)) {
-        st->print_cr("Error: Cannot print dynamic libraries.");
-        return;
-    }
-    handle = dlopen(dli.dli_fname, RTLD_LAZY);
-    if (handle == NULL) {
-        st->print_cr("Error: Cannot print dynamic libraries.");
-        return;
-    }
-    dlinfo(handle, RTLD_DI_LINKMAP, &map);
-    if (map == NULL) {
-        st->print_cr("Error: Cannot print dynamic libraries.");
-        return;
-    }
-
-    while (map->l_prev != NULL)
-        map = map->l_prev;
-
-    while (map != NULL) {
-        st->print_cr(PTR_FORMAT " \t%s", map->l_addr, map->l_name);
-        map = map->l_next;
-    }
-
-    dlclose(handle);
+  Dl_info dli;
+  void *handle;
+  Link_map *map;
+  Link_map *p;
+
+  if (dladdr(CAST_FROM_FN_PTR(void *, os::print_dll_info), &dli) == 0 ||
+      dli.dli_fname == NULL) {
+    st->print_cr("Error: Cannot print dynamic libraries.");
+    return;
+  }
+  handle = dlopen(dli.dli_fname, RTLD_LAZY);
+  if (handle == NULL) {
+    st->print_cr("Error: Cannot print dynamic libraries.");
+    return;
+  }
+  dlinfo(handle, RTLD_DI_LINKMAP, &map);
+  if (map == NULL) {
+    st->print_cr("Error: Cannot print dynamic libraries.");
+    return;
+  }
+
+  while (map->l_prev != NULL)
+    map = map->l_prev;
+
+  while (map != NULL) {
+    st->print_cr(PTR_FORMAT " \t%s", map->l_addr, map->l_name);
+    map = map->l_next;
+  }
+
+  dlclose(handle);
 #elif defined(__APPLE__)
-    uint32_t count;
-    uint32_t i;
-
-    count = _dyld_image_count();
-    for (i = 1; i < count; i++) {
-        const char *name = _dyld_get_image_name(i);
-        intptr_t slide = _dyld_get_image_vmaddr_slide(i);
-        st->print_cr(PTR_FORMAT " \t%s", slide, name);
-    }
+  uint32_t count;
+  uint32_t i;
+
+  count = _dyld_image_count();
+  for (i = 1; i < count; i++) {
+    const char *name = _dyld_get_image_name(i);
+    intptr_t slide = _dyld_get_image_vmaddr_slide(i);
+    st->print_cr(PTR_FORMAT " \t%s", slide, name);
+  }
 #else
-   st->print_cr("Error: Cannot print dynamic libraries.");
+  st->print_cr("Error: Cannot print dynamic libraries.");
 #endif
 }
 
@@ -1707,8 +1721,11 @@
   bool ret = dll_address_to_library_name(
                 CAST_FROM_FN_PTR(address, os::jvm_path),
                 dli_fname, sizeof(dli_fname), NULL);
-  assert(ret != 0, "cannot locate libjvm");
-  char *rp = realpath(dli_fname, buf);
+  assert(ret, "cannot locate libjvm");
+  char *rp = NULL;
+  if (ret && dli_fname[0] != '\0') {
+    rp = realpath(dli_fname, buf);
+  }
   if (rp == NULL)
     return;
 
@@ -3747,20 +3764,20 @@
 bool os::find(address addr, outputStream* st) {
   Dl_info dlinfo;
   memset(&dlinfo, 0, sizeof(dlinfo));
-  if (dladdr(addr, &dlinfo)) {
+  if (dladdr(addr, &dlinfo) != 0) {
     st->print(PTR_FORMAT ": ", addr);
-    if (dlinfo.dli_sname != NULL) {
+    if (dlinfo.dli_sname != NULL && dlinfo.dli_saddr != NULL) {
       st->print("%s+%#x", dlinfo.dli_sname,
                  addr - (intptr_t)dlinfo.dli_saddr);
-    } else if (dlinfo.dli_fname) {
+    } else if (dlinfo.dli_fbase != NULL) {
       st->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
     } else {
       st->print("<absolute address>");
     }
-    if (dlinfo.dli_fname) {
+    if (dlinfo.dli_fname != NULL) {
       st->print(" in %s", dlinfo.dli_fname);
     }
-    if (dlinfo.dli_fbase) {
+    if (dlinfo.dli_fbase != NULL) {
       st->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
     }
     st->cr();
@@ -3773,7 +3790,7 @@
       if (!lowest)  lowest = (address) dlinfo.dli_fbase;
       if (begin < lowest)  begin = lowest;
       Dl_info dlinfo2;
-      if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr
+      if (dladdr(end, &dlinfo2) != 0 && dlinfo2.dli_saddr != dlinfo.dli_saddr
           && end > dlinfo2.dli_saddr && dlinfo2.dli_saddr > begin)
         end = (address) dlinfo2.dli_saddr;
       Disassembler::decode(begin, end, st);
--- a/hotspot/src/os/linux/vm/attachListener_linux.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -432,6 +432,30 @@
   return op;
 }
 
+
+// Performs initialization at vm startup
+// For Linux we remove any stale .java_pid file which could cause
+// an attaching process to think we are ready to receive on the
+// domain socket before we are properly initialized
+
+void AttachListener::vm_start() {
+  char fn[UNIX_PATH_MAX];
+  struct stat64 st;
+  int ret;
+
+  int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
+           os::get_temp_directory(), os::current_process_id());
+  assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
+
+  RESTARTABLE(::stat64(fn, &st), ret);
+  if (ret == 0) {
+    ret = ::unlink(fn);
+    if (ret == -1) {
+      debug_only(warning("failed to remove stale attach pid file at %s", fn));
+    }
+  }
+}
+
 int AttachListener::pd_init() {
   JavaThread* thread = JavaThread::current();
   ThreadBlockInVM tbivm(thread);
--- a/hotspot/src/os/linux/vm/jsig.c	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/linux/vm/jsig.c	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@
 
   signal_lock();
 
-  sigused = (MASK(sig) & jvmsigs) != 0;
+  sigused = (sig < MAXSIGNUM) && ((MASK(sig) & jvmsigs) != 0);
   if (jvm_signal_installed && sigused) {
     /* jvm has installed its signal handler for this signal. */
     /* Save the handler. Don't really install it. */
@@ -116,7 +116,7 @@
 
     signal_unlock();
     return oldhandler;
-  } else if (jvm_signal_installing) {
+  } else if (sig < MAXSIGNUM && jvm_signal_installing) {
     /* jvm is installing its signal handlers. Install the new
      * handlers and save the old ones. jvm uses sigaction().
      * Leave the piece here just in case. */
@@ -165,7 +165,7 @@
 
   signal_lock();
 
-  sigused = (MASK(sig) & jvmsigs) != 0;
+  sigused = (sig < MAXSIGNUM) && ((MASK(sig) & jvmsigs) != 0);
   if (jvm_signal_installed && sigused) {
     /* jvm has installed its signal handler for this signal. */
     /* Save the handler. Don't really install it. */
@@ -178,7 +178,7 @@
 
     signal_unlock();
     return 0;
-  } else if (jvm_signal_installing) {
+  } else if (sig < MAXSIGNUM && jvm_signal_installing) {
     /* jvm is installing its signal handlers. Install the new
      * handlers and save the old ones. */
     res = call_os_sigaction(sig, act, &oldAct);
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1682,12 +1682,13 @@
   Dl_info dlinfo;
 
   if (libjvm_base_addr == NULL) {
-    dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo);
-    libjvm_base_addr = (address)dlinfo.dli_fbase;
+    if (dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo) != 0) {
+      libjvm_base_addr = (address)dlinfo.dli_fbase;
+    }
     assert(libjvm_base_addr !=NULL, "Cannot obtain base address for libjvm");
   }
 
-  if (dladdr((void *)addr, &dlinfo)) {
+  if (dladdr((void *)addr, &dlinfo) != 0) {
     if (libjvm_base_addr == (address)dlinfo.dli_fbase) return true;
   }
 
@@ -1696,24 +1697,30 @@
 
 bool os::dll_address_to_function_name(address addr, char *buf,
                                       int buflen, int *offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
   Dl_info dlinfo;
 
-  if (dladdr((void*)addr, &dlinfo) && dlinfo.dli_sname != NULL) {
-    if (buf != NULL) {
-      if(!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
+  if (dladdr((void*)addr, &dlinfo) != 0) {
+    // see if we have a matching symbol
+    if (dlinfo.dli_saddr != NULL && dlinfo.dli_sname != NULL) {
+      if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
         jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
       }
+      if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
+      return true;
+    }
+    // no matching symbol so try for just file info
+    if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != NULL) {
+      if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+                          buf, buflen, offset, dlinfo.dli_fname)) {
+        return true;
+      }
     }
-    if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
-    return true;
-  } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
-    if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
-        buf, buflen, offset, dlinfo.dli_fname)) {
-       return true;
-    }
-  }
-
-  if (buf != NULL) buf[0] = '\0';
+  }
+
+  buf[0] = '\0';
   if (offset != NULL) *offset = -1;
   return false;
 }
@@ -1764,6 +1771,9 @@
 
 bool os::dll_address_to_library_name(address addr, char* buf,
                                      int buflen, int* offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
   Dl_info dlinfo;
   struct _address_to_library_name data;
 
@@ -1782,15 +1792,20 @@
      // buf already contains library name
      if (offset) *offset = addr - data.base;
      return true;
-  } else if (dladdr((void*)addr, &dlinfo)){
-     if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname);
-     if (offset) *offset = addr - (address)dlinfo.dli_fbase;
-     return true;
-  } else {
-     if (buf) buf[0] = '\0';
-     if (offset) *offset = -1;
-     return false;
-  }
+  }
+  if (dladdr((void*)addr, &dlinfo) != 0) {
+    if (dlinfo.dli_fname != NULL) {
+      jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname);
+    }
+    if (dlinfo.dli_fbase != NULL && offset != NULL) {
+      *offset = addr - (address)dlinfo.dli_fbase;
+    }
+    return true;
+  }
+
+  buf[0] = '\0';
+  if (offset) *offset = -1;
+  return false;
 }
 
   // Loads .dll/.so and
@@ -2317,8 +2332,11 @@
   bool ret = dll_address_to_library_name(
                 CAST_FROM_FN_PTR(address, os::jvm_path),
                 dli_fname, sizeof(dli_fname), NULL);
-  assert(ret != 0, "cannot locate libjvm");
-  char *rp = realpath(dli_fname, buf);
+  assert(ret, "cannot locate libjvm");
+  char *rp = NULL;
+  if (ret && dli_fname[0] != '\0') {
+    rp = realpath(dli_fname, buf);
+  }
   if (rp == NULL)
     return;
 
@@ -4730,20 +4748,20 @@
 bool os::find(address addr, outputStream* st) {
   Dl_info dlinfo;
   memset(&dlinfo, 0, sizeof(dlinfo));
-  if (dladdr(addr, &dlinfo)) {
+  if (dladdr(addr, &dlinfo) != 0) {
     st->print(PTR_FORMAT ": ", addr);
-    if (dlinfo.dli_sname != NULL) {
+    if (dlinfo.dli_sname != NULL && dlinfo.dli_saddr != NULL) {
       st->print("%s+%#x", dlinfo.dli_sname,
                  addr - (intptr_t)dlinfo.dli_saddr);
-    } else if (dlinfo.dli_fname) {
+    } else if (dlinfo.dli_fbase != NULL) {
       st->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
     } else {
       st->print("<absolute address>");
     }
-    if (dlinfo.dli_fname) {
+    if (dlinfo.dli_fname != NULL) {
       st->print(" in %s", dlinfo.dli_fname);
     }
-    if (dlinfo.dli_fbase) {
+    if (dlinfo.dli_fbase != NULL) {
       st->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
     }
     st->cr();
@@ -4756,7 +4774,7 @@
       if (!lowest)  lowest = (address) dlinfo.dli_fbase;
       if (begin < lowest)  begin = lowest;
       Dl_info dlinfo2;
-      if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr
+      if (dladdr(end, &dlinfo2) != 0 && dlinfo2.dli_saddr != dlinfo.dli_saddr
           && end > dlinfo2.dli_saddr && dlinfo2.dli_saddr > begin)
         end = (address) dlinfo2.dli_saddr;
       Disassembler::decode(begin, end, st);
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -259,3 +259,52 @@
 FILE* os::open(int fd, const char* mode) {
   return ::fdopen(fd, mode);
 }
+
+os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
+  assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
+}
+
+/*
+ * See the caveats for this class in os_posix.hpp
+ * Protects the callback call so that SIGSEGV / SIGBUS jumps back into this
+ * method and returns false. If none of the signals are raised, returns true.
+ * The callback is supposed to provide the method that should be protected.
+ */
+bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
+  assert(Thread::current()->is_Watcher_thread(), "Only for WatcherThread");
+  assert(!WatcherThread::watcher_thread()->has_crash_protection(),
+      "crash_protection already set?");
+
+  if (sigsetjmp(_jmpbuf, 1) == 0) {
+    // make sure we can see in the signal handler that we have crash protection
+    // installed
+    WatcherThread::watcher_thread()->set_crash_protection(this);
+    cb.call();
+    // and clear the crash protection
+    WatcherThread::watcher_thread()->set_crash_protection(NULL);
+    return true;
+  }
+  // this happens when we siglongjmp() back
+  WatcherThread::watcher_thread()->set_crash_protection(NULL);
+  return false;
+}
+
+void os::WatcherThreadCrashProtection::restore() {
+  assert(WatcherThread::watcher_thread()->has_crash_protection(),
+      "must have crash protection");
+
+  siglongjmp(_jmpbuf, 1);
+}
+
+void os::WatcherThreadCrashProtection::check_crash_protection(int sig,
+    Thread* thread) {
+
+  if (thread != NULL &&
+      thread->is_Watcher_thread() &&
+      WatcherThread::watcher_thread()->has_crash_protection()) {
+
+    if (sig == SIGSEGV || sig == SIGBUS) {
+      WatcherThread::watcher_thread()->crash_protection()->restore();
+    }
+  }
+}
--- a/hotspot/src/os/posix/vm/os_posix.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/posix/vm/os_posix.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -37,5 +37,24 @@
 
 };
 
+/*
+ * Crash protection for the watcher thread. Wrap the callback
+ * with a sigsetjmp and in case of a SIGSEGV/SIGBUS we siglongjmp
+ * back.
+ * To be able to use this - don't take locks, don't rely on destructors,
+ * don't make OS library calls, don't allocate memory, don't print,
+ * don't call code that could leave the heap / memory in an inconsistent state,
+ * or anything else where we are not in control if we suddenly jump out.
+ */
+class WatcherThreadCrashProtection : public StackObj {
+public:
+  WatcherThreadCrashProtection();
+  bool call(os::CrashProtectionCallback& cb);
+
+  static void check_crash_protection(int signal, Thread* thread);
+private:
+  void restore();
+  sigjmp_buf _jmpbuf;
+};
 
 #endif
--- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -576,6 +576,30 @@
   return op;
 }
 
+
+// Performs initialization at vm startup
+// For Solaris we remove any stale .java_pid file which could cause
+// an attaching process to think we are ready to receive a door_call
+// before we are properly initialized
+
+void AttachListener::vm_start() {
+  char fn[PATH_MAX+1];
+  struct stat64 st;
+  int ret;
+
+  int n = snprintf(fn, sizeof(fn), "%s/.java_pid%d",
+           os::get_temp_directory(), os::current_process_id());
+  assert(n < sizeof(fn), "java_pid file name buffer overflow");
+
+  RESTARTABLE(::stat64(fn, &st), ret);
+  if (ret == 0) {
+    ret = ::unlink(fn);
+    if (ret == -1) {
+      debug_only(warning("failed to remove stale attach pid file at %s", fn));
+    }
+  }
+}
+
 int AttachListener::pd_init() {
   JavaThread* thread = JavaThread::current();
   ThreadBlockInVM tbivm(thread);
--- a/hotspot/src/os/solaris/vm/globals_solaris.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/solaris/vm/globals_solaris.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -30,15 +30,6 @@
 //
 #define RUNTIME_OS_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
                                                                                \
-  product(bool, UseISM, false,                                                 \
-          "Use Intimate Shared Memory (Solaris Only)")                         \
-                                                                               \
-  product(bool, UsePermISM, false,                                             \
-          "Obsolete flag for compatibility (same as UseISM)")                  \
-                                                                               \
-  product(bool, UseMPSS, true,                                                 \
-          "Use Multiple Page Size Support (Solaris 9 Only)")                   \
-                                                                               \
   product(bool, UseExtendedFileIO, true,                                       \
           "Enable workaround for limitations of stdio FILE structure")
 
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -115,45 +115,6 @@
 // for timer info max values which include all bits
 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
 
-#ifdef _GNU_SOURCE
-// See bug #6514594
-extern "C" int madvise(caddr_t, size_t, int);
-extern "C" int memcntl(caddr_t addr, size_t len, int cmd, caddr_t arg,
-                       int attr, int mask);
-#endif //_GNU_SOURCE
-
-/*
-  MPSS Changes Start.
-  The JVM binary needs to be built and run on pre-Solaris 9
-  systems, but the constants needed by MPSS are only in Solaris 9
-  header files.  They are textually replicated here to allow
-  building on earlier systems.  Once building on Solaris 8 is
-  no longer a requirement, these #defines can be replaced by ordinary
-  system .h inclusion.
-
-  In earlier versions of the  JDK and Solaris, we used ISM for large pages.
-  But ISM requires shared memory to achieve this and thus has many caveats.
-  MPSS is a fully transparent and is a cleaner way to get large pages.
-  Although we still require keeping ISM for backward compatiblitiy as well as
-  giving the opportunity to use large pages on older systems it is
-  recommended that MPSS be used for Solaris 9 and above.
-
-*/
-
-#ifndef MC_HAT_ADVISE
-
-struct memcntl_mha {
-  uint_t          mha_cmd;        /* command(s) */
-  uint_t          mha_flags;
-  size_t          mha_pagesize;
-};
-#define MC_HAT_ADVISE   7       /* advise hat map size */
-#define MHA_MAPSIZE_VA  0x1     /* set preferred page size */
-#define MAP_ALIGN       0x200   /* addr specifies alignment */
-
-#endif
-// MPSS Changes End.
-
 
 // Here are some liblgrp types from sys/lgrp_user.h to be able to
 // compile on older systems without this header file.
@@ -172,32 +133,6 @@
 # define LGRP_RSRC_MEM           1       /* memory resources */
 #endif
 
-// Some more macros from sys/mman.h that are not present in Solaris 8.
-
-#ifndef MAX_MEMINFO_CNT
-/*
- * info_req request type definitions for meminfo
- * request types starting with MEMINFO_V are used for Virtual addresses
- * and should not be mixed with MEMINFO_PLGRP which is targeted for Physical
- * addresses
- */
-# define MEMINFO_SHIFT           16
-# define MEMINFO_MASK            (0xFF << MEMINFO_SHIFT)
-# define MEMINFO_VPHYSICAL       (0x01 << MEMINFO_SHIFT) /* get physical addr */
-# define MEMINFO_VLGRP           (0x02 << MEMINFO_SHIFT) /* get lgroup */
-# define MEMINFO_VPAGESIZE       (0x03 << MEMINFO_SHIFT) /* size of phys page */
-# define MEMINFO_VREPLCNT        (0x04 << MEMINFO_SHIFT) /* no. of replica */
-# define MEMINFO_VREPL           (0x05 << MEMINFO_SHIFT) /* physical replica */
-# define MEMINFO_VREPL_LGRP      (0x06 << MEMINFO_SHIFT) /* lgrp of replica */
-# define MEMINFO_PLGRP           (0x07 << MEMINFO_SHIFT) /* lgroup for paddr */
-
-/* maximum number of addresses meminfo() can process at a time */
-# define MAX_MEMINFO_CNT 256
-
-/* maximum number of request types */
-# define MAX_MEMINFO_REQ 31
-#endif
-
 // see thr_setprio(3T) for the basis of these numbers
 #define MinimumPriority 0
 #define NormalPriority  64
@@ -1924,12 +1859,13 @@
   Dl_info dlinfo;
 
   if (libjvm_base_addr == NULL) {
-    dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo);
-    libjvm_base_addr = (address)dlinfo.dli_fbase;
+    if (dladdr(CAST_FROM_FN_PTR(void *, os::address_is_in_vm), &dlinfo) != 0) {
+      libjvm_base_addr = (address)dlinfo.dli_fbase;
+    }
     assert(libjvm_base_addr !=NULL, "Cannot obtain base address for libjvm");
   }
 
-  if (dladdr((void *)addr, &dlinfo)) {
+  if (dladdr((void *)addr, &dlinfo) != 0) {
     if (libjvm_base_addr == (address)dlinfo.dli_fbase) return true;
   }
 
@@ -1941,114 +1877,133 @@
 
 bool os::dll_address_to_function_name(address addr, char *buf,
                                       int buflen, int * offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
   Dl_info dlinfo;
 
   // dladdr1_func was initialized in os::init()
-  if (dladdr1_func){
-      // yes, we have dladdr1
-
-      // Support for dladdr1 is checked at runtime; it may be
-      // available even if the vm is built on a machine that does
-      // not have dladdr1 support.  Make sure there is a value for
-      // RTLD_DL_SYMENT.
-      #ifndef RTLD_DL_SYMENT
-      #define RTLD_DL_SYMENT 1
-      #endif
+  if (dladdr1_func != NULL) {
+    // yes, we have dladdr1
+
+    // Support for dladdr1 is checked at runtime; it may be
+    // available even if the vm is built on a machine that does
+    // not have dladdr1 support.  Make sure there is a value for
+    // RTLD_DL_SYMENT.
+    #ifndef RTLD_DL_SYMENT
+    #define RTLD_DL_SYMENT 1
+    #endif
 #ifdef _LP64
-      Elf64_Sym * info;
+    Elf64_Sym * info;
 #else
-      Elf32_Sym * info;
+    Elf32_Sym * info;
 #endif
-      if (dladdr1_func((void *)addr, &dlinfo, (void **)&info,
-                       RTLD_DL_SYMENT)) {
-        if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) {
-          if (buf != NULL) {
-            if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen))
-              jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
-            }
-            if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
-            return true;
-        }
-      }
-      if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
-        if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
-           buf, buflen, offset, dlinfo.dli_fname)) {
+    if (dladdr1_func((void *)addr, &dlinfo, (void **)&info,
+                     RTLD_DL_SYMENT) != 0) {
+      // see if we have a matching symbol that covers our address
+      if (dlinfo.dli_saddr != NULL &&
+          (char *)dlinfo.dli_saddr + info->st_size > (char *)addr) {
+        if (dlinfo.dli_sname != NULL) {
+          if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
+            jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname);
+          }
+          if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
           return true;
         }
       }
-      if (buf != NULL) buf[0] = '\0';
-      if (offset != NULL) *offset  = -1;
-      return false;
-  } else {
-      // no, only dladdr is available
-      if (dladdr((void *)addr, &dlinfo)) {
-        if (buf != NULL) {
-          if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen))
-            jio_snprintf(buf, buflen, dlinfo.dli_sname);
-        }
-        if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
-        return true;
-      } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) {
+      // no matching symbol so try for just file info
+      if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != NULL) {
         if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
-          buf, buflen, offset, dlinfo.dli_fname)) {
+                            buf, buflen, offset, dlinfo.dli_fname)) {
           return true;
         }
       }
-      if (buf != NULL) buf[0] = '\0';
-      if (offset != NULL) *offset  = -1;
-      return false;
-  }
+    }
+    buf[0] = '\0';
+    if (offset != NULL) *offset  = -1;
+    return false;
+  }
+
+  // no, only dladdr is available
+  if (dladdr((void *)addr, &dlinfo) != 0) {
+    // see if we have a matching symbol
+    if (dlinfo.dli_saddr != NULL && dlinfo.dli_sname != NULL) {
+      if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) {
+        jio_snprintf(buf, buflen, dlinfo.dli_sname);
+      }
+      if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr;
+      return true;
+    }
+    // no matching symbol so try for just file info
+    if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != NULL) {
+      if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase),
+                          buf, buflen, offset, dlinfo.dli_fname)) {
+        return true;
+      }
+    }
+  }
+  buf[0] = '\0';
+  if (offset != NULL) *offset  = -1;
+  return false;
 }
 
 bool os::dll_address_to_library_name(address addr, char* buf,
                                      int buflen, int* offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
   Dl_info dlinfo;
 
-  if (dladdr((void*)addr, &dlinfo)){
-     if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname);
-     if (offset) *offset = addr - (address)dlinfo.dli_fbase;
-     return true;
-  } else {
-     if (buf) buf[0] = '\0';
-     if (offset) *offset = -1;
-     return false;
-  }
+  if (dladdr((void*)addr, &dlinfo) != 0) {
+    if (dlinfo.dli_fname != NULL) {
+      jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname);
+    }
+    if (dlinfo.dli_fbase != NULL && offset != NULL) {
+      *offset = addr - (address)dlinfo.dli_fbase;
+    }
+    return true;
+  }
+
+  buf[0] = '\0';
+  if (offset) *offset = -1;
+  return false;
 }
 
 // Prints the names and full paths of all opened dynamic libraries
 // for current process
 void os::print_dll_info(outputStream * st) {
-    Dl_info dli;
-    void *handle;
-    Link_map *map;
-    Link_map *p;
-
-    st->print_cr("Dynamic libraries:"); st->flush();
-
-    if (!dladdr(CAST_FROM_FN_PTR(void *, os::print_dll_info), &dli)) {
-        st->print_cr("Error: Cannot print dynamic libraries.");
-        return;
-    }
-    handle = dlopen(dli.dli_fname, RTLD_LAZY);
-    if (handle == NULL) {
-        st->print_cr("Error: Cannot print dynamic libraries.");
-        return;
-    }
-    dlinfo(handle, RTLD_DI_LINKMAP, &map);
-    if (map == NULL) {
-        st->print_cr("Error: Cannot print dynamic libraries.");
-        return;
-    }
-
-    while (map->l_prev != NULL)
-        map = map->l_prev;
-
-    while (map != NULL) {
-        st->print_cr(PTR_FORMAT " \t%s", map->l_addr, map->l_name);
-        map = map->l_next;
-    }
-
-    dlclose(handle);
+  Dl_info dli;
+  void *handle;
+  Link_map *map;
+  Link_map *p;
+
+  st->print_cr("Dynamic libraries:"); st->flush();
+
+  if (dladdr(CAST_FROM_FN_PTR(void *, os::print_dll_info), &dli) == 0 ||
+      dli.dli_fname == NULL) {
+    st->print_cr("Error: Cannot print dynamic libraries.");
+    return;
+  }
+  handle = dlopen(dli.dli_fname, RTLD_LAZY);
+  if (handle == NULL) {
+    st->print_cr("Error: Cannot print dynamic libraries.");
+    return;
+  }
+  dlinfo(handle, RTLD_DI_LINKMAP, &map);
+  if (map == NULL) {
+    st->print_cr("Error: Cannot print dynamic libraries.");
+    return;
+  }
+
+  while (map->l_prev != NULL)
+    map = map->l_prev;
+
+  while (map != NULL) {
+    st->print_cr(PTR_FORMAT " \t%s", map->l_addr, map->l_name);
+    map = map->l_next;
+  }
+
+  dlclose(handle);
 }
 
   // Loads .dll/.so and
@@ -2475,7 +2430,12 @@
   Dl_info dlinfo;
   int ret = dladdr(CAST_FROM_FN_PTR(void *, os::jvm_path), &dlinfo);
   assert(ret != 0, "cannot locate libjvm");
-  realpath((char *)dlinfo.dli_fname, buf);
+  if (ret != 0 && dlinfo.dli_fname != NULL) {
+    realpath((char *)dlinfo.dli_fname, buf);
+  } else {
+    buf[0] = '\0';
+    return;
+  }
 
   if (Arguments::created_by_gamma_launcher()) {
     // Support for the gamma launcher.  Typical value for buf is
@@ -2859,7 +2819,7 @@
                                     size_t alignment_hint, bool exec) {
   int err = Solaris::commit_memory_impl(addr, bytes, exec);
   if (err == 0) {
-    if (UseMPSS && alignment_hint > (size_t)vm_page_size()) {
+    if (UseLargePages && (alignment_hint > (size_t)vm_page_size())) {
       // If the large page size has been set and the VM
       // is using large pages, use the large page size
       // if it is smaller than the alignment hint. This is
@@ -2878,7 +2838,7 @@
         page_size = alignment_hint;
       }
       // Since this is a hint, ignore any failures.
-      (void)Solaris::set_mpss_range(addr, bytes, page_size);
+      (void)Solaris::setup_large_pages(addr, bytes, page_size);
     }
   }
   return err;
@@ -2921,8 +2881,8 @@
 void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
   assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
   assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
-  if (UseLargePages && UseMPSS) {
-    Solaris::set_mpss_range(addr, bytes, alignment_hint);
+  if (UseLargePages) {
+    Solaris::setup_large_pages(addr, bytes, alignment_hint);
   }
 }
 
@@ -3321,47 +3281,8 @@
 }
 
 // Large page support
-
-// UseLargePages is the master flag to enable/disable large page memory.
-// UseMPSS and UseISM are supported for compatibility reasons. Their combined
-// effects can be described in the following table:
-//
-// UseLargePages UseMPSS UseISM
-//    false         *       *   => UseLargePages is the master switch, turning
-//                                 it off will turn off both UseMPSS and
-//                                 UseISM. VM will not use large page memory
-//                                 regardless the settings of UseMPSS/UseISM.
-//     true      false    false => Unless future Solaris provides other
-//                                 mechanism to use large page memory, this
-//                                 combination is equivalent to -UseLargePages,
-//                                 VM will not use large page memory
-//     true      true     false => JVM will use MPSS for large page memory.
-//                                 This is the default behavior.
-//     true      false    true  => JVM will use ISM for large page memory.
-//     true      true     true  => JVM will use ISM if it is available.
-//                                 Otherwise, JVM will fall back to MPSS.
-//                                 Becaues ISM is now available on all
-//                                 supported Solaris versions, this combination
-//                                 is equivalent to +UseISM -UseMPSS.
-
 static size_t _large_page_size = 0;
 
-bool os::Solaris::ism_sanity_check(bool warn, size_t * page_size) {
-  // x86 uses either 2M or 4M page, depending on whether PAE (Physical Address
-  // Extensions) mode is enabled. AMD64/EM64T uses 2M page in 64bit mode. Sparc
-  // can support multiple page sizes.
-
-  // Don't bother to probe page size because getpagesizes() comes with MPSS.
-  // ISM is only recommended on old Solaris where there is no MPSS support.
-  // Simply choose a conservative value as default.
-  *page_size = LargePageSizeInBytes ? LargePageSizeInBytes :
-               SPARC_ONLY(4 * M) IA32_ONLY(4 * M) AMD64_ONLY(2 * M)
-               ARM_ONLY(2 * M);
-
-  // ISM is available on all supported Solaris versions
-  return true;
-}
-
 // Insertion sort for small arrays (descending order).
 static void insertion_sort_descending(size_t* array, int len) {
   for (int i = 0; i < len; i++) {
@@ -3374,7 +3295,7 @@
   }
 }
 
-bool os::Solaris::mpss_sanity_check(bool warn, size_t * page_size) {
+bool os::Solaris::mpss_sanity_check(bool warn, size_t* page_size) {
   const unsigned int usable_count = VM_Version::page_size_count();
   if (usable_count == 1) {
     return false;
@@ -3440,41 +3361,24 @@
 }
 
 void os::large_page_init() {
-  if (!UseLargePages) {
-    UseISM = false;
-    UseMPSS = false;
-    return;
-  }
-
-  // print a warning if any large page related flag is specified on command line
-  bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages)        ||
-                         !FLAG_IS_DEFAULT(UseISM)               ||
-                         !FLAG_IS_DEFAULT(UseMPSS)              ||
-                         !FLAG_IS_DEFAULT(LargePageSizeInBytes);
-  UseISM = UseISM &&
-           Solaris::ism_sanity_check(warn_on_failure, &_large_page_size);
-  if (UseISM) {
-    // ISM disables MPSS to be compatible with old JDK behavior
-    UseMPSS = false;
-    _page_sizes[0] = _large_page_size;
-    _page_sizes[1] = vm_page_size();
-  }
-
-  UseMPSS = UseMPSS &&
-            Solaris::mpss_sanity_check(warn_on_failure, &_large_page_size);
-
-  UseLargePages = UseISM || UseMPSS;
-}
-
-bool os::Solaris::set_mpss_range(caddr_t start, size_t bytes, size_t align) {
+  if (UseLargePages) {
+    // print a warning if any large page related flag is specified on command line
+    bool warn_on_failure = !FLAG_IS_DEFAULT(UseLargePages)        ||
+                           !FLAG_IS_DEFAULT(LargePageSizeInBytes);
+
+    UseLargePages = Solaris::mpss_sanity_check(warn_on_failure, &_large_page_size);
+  }
+}
+
+bool os::Solaris::setup_large_pages(caddr_t start, size_t bytes, size_t align) {
   // Signal to OS that we want large pages for addresses
   // from addr, addr + bytes
   struct memcntl_mha mpss_struct;
   mpss_struct.mha_cmd = MHA_MAPSIZE_VA;
   mpss_struct.mha_pagesize = align;
   mpss_struct.mha_flags = 0;
-  if (memcntl(start, bytes, MC_HAT_ADVISE,
-              (caddr_t) &mpss_struct, 0, 0) < 0) {
+  // Upon successful completion, memcntl() returns 0
+  if (memcntl(start, bytes, MC_HAT_ADVISE, (caddr_t) &mpss_struct, 0, 0)) {
     debug_only(warning("Attempt to use MPSS failed."));
     return false;
   }
@@ -3482,72 +3386,13 @@
 }
 
 char* os::reserve_memory_special(size_t size, char* addr, bool exec) {
-  // "exec" is passed in but not used.  Creating the shared image for
-  // the code cache doesn't have an SHM_X executable permission to check.
-  assert(UseLargePages && UseISM, "only for ISM large pages");
-
-  char* retAddr = NULL;
-  int shmid;
-  key_t ismKey;
-
-  bool warn_on_failure = UseISM &&
-                        (!FLAG_IS_DEFAULT(UseLargePages)         ||
-                         !FLAG_IS_DEFAULT(UseISM)                ||
-                         !FLAG_IS_DEFAULT(LargePageSizeInBytes)
-                        );
-  char msg[128];
-
-  ismKey = IPC_PRIVATE;
-
-  // Create a large shared memory region to attach to based on size.
-  // Currently, size is the total size of the heap
-  shmid = shmget(ismKey, size, SHM_R | SHM_W | IPC_CREAT);
-  if (shmid == -1){
-     if (warn_on_failure) {
-       jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
-       warning(msg);
-     }
-     return NULL;
-  }
-
-  // Attach to the region
-  retAddr = (char *) shmat(shmid, 0, SHM_SHARE_MMU | SHM_R | SHM_W);
-  int err = errno;
-
-  // Remove shmid. If shmat() is successful, the actual shared memory segment
-  // will be deleted when it's detached by shmdt() or when the process
-  // terminates. If shmat() is not successful this will remove the shared
-  // segment immediately.
-  shmctl(shmid, IPC_RMID, NULL);
-
-  if (retAddr == (char *) -1) {
-    if (warn_on_failure) {
-      jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
-      warning(msg);
-    }
-    return NULL;
-  }
-  if ((retAddr != NULL) && UseNUMAInterleaving) {
-    numa_make_global(retAddr, size);
-  }
-
-  // The memory is committed
-  MemTracker::record_virtual_memory_reserve_and_commit((address)retAddr, size, mtNone, CURRENT_PC);
-
-  return retAddr;
+  fatal("os::reserve_memory_special should not be called on Solaris.");
+  return NULL;
 }
 
 bool os::release_memory_special(char* base, size_t bytes) {
-  MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker();
-  // detaching the SHM segment will also delete it, see reserve_memory_special()
-  int rslt = shmdt(base);
-  if (rslt == 0) {
-    tkr.record((address)base, bytes);
-    return true;
-  } else {
-    tkr.discard();
-    return false;
-  }
+  fatal("os::release_memory_special should not be called on Solaris.");
+  return false;
 }
 
 size_t os::large_page_size() {
@@ -3557,11 +3402,11 @@
 // MPSS allows application to commit large page memory on demand; with ISM
 // the entire memory region must be allocated as shared memory.
 bool os::can_commit_large_page_memory() {
-  return UseISM ? false : true;
+  return true;
 }
 
 bool os::can_execute_large_page_memory() {
-  return UseISM ? false : true;
+  return true;
 }
 
 static int os_sleep(jlong millis, bool interruptible) {
@@ -3835,28 +3680,6 @@
 static const int criticalPrio = 60; // FX/60 is critical thread class/priority on T4
 static int java_MaxPriority_to_os_priority = 0; // Saved mapping
 
-// Call the version of priocntl suitable for all supported versions
-// of Solaris. We need to call through this wrapper so that we can
-// build on Solaris 9 and run on Solaris 8, 9 and 10.
-//
-// This code should be removed if we ever stop supporting Solaris 8
-// and earlier releases.
-
-static long priocntl_stub(int pcver, idtype_t idtype, id_t id, int cmd, caddr_t arg);
-typedef long (*priocntl_type)(int pcver, idtype_t idtype, id_t id, int cmd, caddr_t arg);
-static priocntl_type priocntl_ptr = priocntl_stub;
-
-// Stub to set the value of the real pointer, and then call the real
-// function.
-
-static long priocntl_stub(int pcver, idtype_t idtype, id_t id, int cmd, caddr_t arg) {
-  // Try Solaris 8- name only.
-  priocntl_type tmp = (priocntl_type)dlsym(RTLD_DEFAULT, "__priocntl");
-  guarantee(tmp != NULL, "priocntl function not found.");
-  priocntl_ptr = tmp;
-  return (*priocntl_ptr)(PC_VERSION, idtype, id, cmd, arg);
-}
-
 
 // lwp_priocntl_init
 //
@@ -3864,9 +3687,7 @@
 //
 // Return errno or 0 if OK.
 //
-static
-int     lwp_priocntl_init ()
-{
+static int lwp_priocntl_init () {
   int rslt;
   pcinfo_t ClassInfo;
   pcparms_t ParmInfo;
@@ -3906,7 +3727,7 @@
 
   strcpy(ClassInfo.pc_clname, "TS");
   ClassInfo.pc_cid = -1;
-  rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
+  rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
   if (rslt < 0) return errno;
   assert(ClassInfo.pc_cid != -1, "cid for TS class is -1");
   tsLimits.schedPolicy = ClassInfo.pc_cid;
@@ -3915,7 +3736,7 @@
 
   strcpy(ClassInfo.pc_clname, "IA");
   ClassInfo.pc_cid = -1;
-  rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
+  rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
   if (rslt < 0) return errno;
   assert(ClassInfo.pc_cid != -1, "cid for IA class is -1");
   iaLimits.schedPolicy = ClassInfo.pc_cid;
@@ -3924,7 +3745,7 @@
 
   strcpy(ClassInfo.pc_clname, "RT");
   ClassInfo.pc_cid = -1;
-  rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
+  rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
   if (rslt < 0) return errno;
   assert(ClassInfo.pc_cid != -1, "cid for RT class is -1");
   rtLimits.schedPolicy = ClassInfo.pc_cid;
@@ -3933,7 +3754,7 @@
 
   strcpy(ClassInfo.pc_clname, "FX");
   ClassInfo.pc_cid = -1;
-  rslt = (*priocntl_ptr)(PC_VERSION, P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
+  rslt = priocntl(P_ALL, 0, PC_GETCID, (caddr_t)&ClassInfo);
   if (rslt < 0) return errno;
   assert(ClassInfo.pc_cid != -1, "cid for FX class is -1");
   fxLimits.schedPolicy = ClassInfo.pc_cid;
@@ -3944,7 +3765,7 @@
   // This will normally be IA, TS or, rarely, FX or RT.
   memset(&ParmInfo, 0, sizeof(ParmInfo));
   ParmInfo.pc_cid = PC_CLNULL;
-  rslt = (*priocntl_ptr) (PC_VERSION, P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
+  rslt = priocntl(P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
   if (rslt < 0) return errno;
   myClass = ParmInfo.pc_cid;
 
@@ -3952,7 +3773,7 @@
   // about the class.
   ClassInfo.pc_cid = myClass;
   ClassInfo.pc_clname[0] = 0;
-  rslt = (*priocntl_ptr) (PC_VERSION, (idtype)0, 0, PC_GETCLINFO, (caddr_t)&ClassInfo);
+  rslt = priocntl((idtype)0, 0, PC_GETCLINFO, (caddr_t)&ClassInfo);
   if (rslt < 0) return errno;
 
   if (ThreadPriorityVerbose) {
@@ -3961,7 +3782,7 @@
 
   memset(&ParmInfo, 0, sizeof(pcparms_t));
   ParmInfo.pc_cid = PC_CLNULL;
-  rslt = (*priocntl_ptr)(PC_VERSION, P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
+  rslt = priocntl(P_PID, P_MYID, PC_GETPARMS, (caddr_t)&ParmInfo);
   if (rslt < 0) return errno;
 
   if (ParmInfo.pc_cid == rtLimits.schedPolicy) {
@@ -4065,7 +3886,7 @@
 
   memset(&ParmInfo, 0, sizeof(pcparms_t));
   ParmInfo.pc_cid = PC_CLNULL;
-  rslt = (*priocntl_ptr)(PC_VERSION, P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ParmInfo);
+  rslt = priocntl(P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ParmInfo);
   if (rslt < 0) return errno;
 
   int cur_class = ParmInfo.pc_cid;
@@ -4133,7 +3954,7 @@
     return EINVAL;    // no clue, punt
   }
 
-  rslt = (*priocntl_ptr)(PC_VERSION, P_LWPID, lwpid, PC_SETPARMS, (caddr_t)&ParmInfo);
+  rslt = priocntl(P_LWPID, lwpid, PC_SETPARMS, (caddr_t)&ParmInfo);
   if (ThreadPriorityVerbose && rslt) {
     tty->print_cr ("PC_SETPARMS ->%d %d\n", rslt, errno);
   }
@@ -4152,7 +3973,7 @@
 
   memset(&ReadBack, 0, sizeof(pcparms_t));
   ReadBack.pc_cid = PC_CLNULL;
-  rslt = (*priocntl_ptr)(PC_VERSION, P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ReadBack);
+  rslt = priocntl(P_LWPID, lwpid, PC_GETPARMS, (caddr_t)&ReadBack);
   assert(rslt >= 0, "priocntl failed");
   Actual = Expected = 0xBAD;
   assert(ParmInfo.pc_cid == ReadBack.pc_cid, "cid's don't match");
@@ -5244,11 +5065,6 @@
   return _getisax(array, n);
 }
 
-// Symbol doesn't exist in Solaris 8 pset.h
-#ifndef PS_MYID
-#define PS_MYID -3
-#endif
-
 // int pset_getloadavg(psetid_t pset, double loadavg[], int nelem);
 typedef long (*pset_getloadavg_type)(psetid_t pset, double loadavg[], int nelem);
 static pset_getloadavg_type pset_getloadavg_ptr = NULL;
@@ -5418,20 +5234,6 @@
         UseNUMA = false;
       }
     }
-    // ISM is not compatible with the NUMA allocator - it always allocates
-    // pages round-robin across the lgroups.
-    if (UseNUMA && UseLargePages && UseISM) {
-      if (!FLAG_IS_DEFAULT(UseNUMA)) {
-        if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseISM)) {
-          UseLargePages = false;
-        } else {
-          warning("UseNUMA is not compatible with ISM large pages, disabling NUMA allocator");
-          UseNUMA = false;
-        }
-      } else {
-        UseNUMA = false;
-      }
-    }
     if (!UseNUMA && ForceNUMA) {
       UseNUMA = true;
     }
@@ -6077,24 +5879,20 @@
 bool os::find(address addr, outputStream* st) {
   Dl_info dlinfo;
   memset(&dlinfo, 0, sizeof(dlinfo));
-  if (dladdr(addr, &dlinfo)) {
-#ifdef _LP64
-    st->print("0x%016lx: ", addr);
-#else
-    st->print("0x%08x: ", addr);
-#endif
-    if (dlinfo.dli_sname != NULL)
+  if (dladdr(addr, &dlinfo) != 0) {
+    st->print(PTR_FORMAT ": ", addr);
+    if (dlinfo.dli_sname != NULL && dlinfo.dli_saddr != NULL) {
       st->print("%s+%#lx", dlinfo.dli_sname, addr-(intptr_t)dlinfo.dli_saddr);
-    else if (dlinfo.dli_fname)
+    } else if (dlinfo.dli_fbase != NULL)
       st->print("<offset %#lx>", addr-(intptr_t)dlinfo.dli_fbase);
     else
       st->print("<absolute address>");
-    if (dlinfo.dli_fname)  st->print(" in %s", dlinfo.dli_fname);
-#ifdef _LP64
-    if (dlinfo.dli_fbase)  st->print(" at 0x%016lx", dlinfo.dli_fbase);
-#else
-    if (dlinfo.dli_fbase)  st->print(" at 0x%08x", dlinfo.dli_fbase);
-#endif
+    if (dlinfo.dli_fname != NULL) {
+      st->print(" in %s", dlinfo.dli_fname);
+    }
+    if (dlinfo.dli_fbase != NULL) {
+      st->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
+    }
     st->cr();
 
     if (Verbose) {
@@ -6105,7 +5903,7 @@
       if (!lowest)  lowest = (address) dlinfo.dli_fbase;
       if (begin < lowest)  begin = lowest;
       Dl_info dlinfo2;
-      if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr
+      if (dladdr(end, &dlinfo2) != 0 && dlinfo2.dli_saddr != dlinfo.dli_saddr
           && end > dlinfo2.dli_saddr && dlinfo2.dli_saddr > begin)
         end = (address) dlinfo2.dli_saddr;
       Disassembler::decode(begin, end, st);
--- a/hotspot/src/os/solaris/vm/os_solaris.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/solaris/vm/os_solaris.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -106,8 +106,8 @@
 
   static meminfo_func_t _meminfo;
 
-  // Large Page Support--mpss.
-  static bool set_mpss_range(caddr_t start, size_t bytes, size_t align);
+  // Large Page Support
+  static bool setup_large_pages(caddr_t start, size_t bytes, size_t align);
 
   static void init_thread_fpu_state(void);
 
@@ -174,7 +174,6 @@
   static char* mmap_chunk(char *addr, size_t size, int flags, int prot);
   static char* anon_mmap(char* requested_addr, size_t bytes, size_t alignment_hint, bool fixed);
   static bool mpss_sanity_check(bool warn, size_t * page_size);
-  static bool ism_sanity_check (bool warn, size_t * page_size);
 
   // Workaround for 4352906. thr_stksegment sometimes returns
   // a bad value for the primordial thread's stack base when
--- a/hotspot/src/os/windows/vm/attachListener_windows.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/windows/vm/attachListener_windows.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -358,6 +358,10 @@
   return op;
 }
 
+void AttachListener::vm_start() {
+  // nothing to do
+}
+
 int AttachListener::pd_init() {
   return Win32AttachListener::init();
 }
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1420,34 +1420,40 @@
 
 bool os::dll_address_to_library_name(address addr, char* buf,
                                      int buflen, int* offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
 // NOTE: the reason we don't use SymGetModuleInfo() is it doesn't always
 //       return the full path to the DLL file, sometimes it returns path
 //       to the corresponding PDB file (debug info); sometimes it only
 //       returns partial path, which makes life painful.
 
-   struct _modinfo mi;
-   mi.addr      = addr;
-   mi.full_path = buf;
-   mi.buflen    = buflen;
-   int pid = os::current_process_id();
-   if (enumerate_modules(pid, _locate_module_by_addr, (void *)&mi)) {
-      // buf already contains path name
-      if (offset) *offset = addr - mi.base_addr;
-      return true;
-   } else {
-      if (buf) buf[0] = '\0';
-      if (offset) *offset = -1;
-      return false;
-   }
+  struct _modinfo mi;
+  mi.addr      = addr;
+  mi.full_path = buf;
+  mi.buflen    = buflen;
+  int pid = os::current_process_id();
+  if (enumerate_modules(pid, _locate_module_by_addr, (void *)&mi)) {
+    // buf already contains path name
+    if (offset) *offset = addr - mi.base_addr;
+    return true;
+  }
+
+  buf[0] = '\0';
+  if (offset) *offset = -1;
+  return false;
 }
 
 bool os::dll_address_to_function_name(address addr, char *buf,
                                       int buflen, int *offset) {
+  // buf is not optional, but offset is optional
+  assert(buf != NULL, "sanity check");
+
   if (Decoder::decode(addr, buf, buflen, offset)) {
     return true;
   }
   if (offset != NULL)  *offset  = -1;
-  if (buf != NULL) buf[0] = '\0';
+  buf[0] = '\0';
   return false;
 }
 
@@ -2317,6 +2323,11 @@
 #endif
   Thread* t = ThreadLocalStorage::get_thread_slow();          // slow & steady
 
+  // Handle SafeFetch32 and SafeFetchN exceptions.
+  if (StubRoutines::is_safefetch_fault(pc)) {
+    return Handle_Exception(exceptionInfo, StubRoutines::continuation_for_safefetch_fault(pc));
+  }
+
 #ifndef _WIN64
   // Execution protection violation - win32 running on AMD64 only
   // Handled first to avoid misdiagnosis as a "normal" access violation;
@@ -2689,6 +2700,19 @@
 }
 #endif
 
+#ifndef PRODUCT
+void os::win32::call_test_func_with_wrapper(void (*funcPtr)(void)) {
+  // Install a win32 structured exception handler around the test
+  // function call so the VM can generate an error dump if needed.
+  __try {
+    (*funcPtr)();
+  } __except(topLevelExceptionFilter(
+             (_EXCEPTION_POINTERS*)_exception_info())) {
+    // Nothing to do.
+  }
+}
+#endif
+
 // Virtual Memory
 
 int os::vm_page_size() { return os::win32::vm_page_size(); }
@@ -4665,6 +4689,34 @@
   }
 }
 
+os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
+  assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
+}
+
+/*
+ * See the caveats for this class in os_windows.hpp
+ * Protects the callback call so that raised OS EXCEPTIONS causes a jump back
+ * into this method and returns false. If no OS EXCEPTION was raised, returns
+ * true.
+ * The callback is supposed to provide the method that should be protected.
+ */
+bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
+  assert(Thread::current()->is_Watcher_thread(), "Only for WatcherThread");
+  assert(!WatcherThread::watcher_thread()->has_crash_protection(),
+      "crash_protection already set?");
+
+  bool success = true;
+  __try {
+    WatcherThread::watcher_thread()->set_crash_protection(this);
+    cb.call();
+  } __except(EXCEPTION_EXECUTE_HANDLER) {
+    // only for protection, nothing to do
+    success = false;
+  }
+  WatcherThread::watcher_thread()->set_crash_protection(NULL);
+  return success;
+}
+
 // An Event wraps a win32 "CreateEvent" kernel handle.
 //
 // We have a number of choices regarding "CreateEvent" win32 handle leakage:
--- a/hotspot/src/os/windows/vm/os_windows.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,10 +94,28 @@
   static address fast_jni_accessor_wrapper(BasicType);
 #endif
 
+#ifndef PRODUCT
+  static void call_test_func_with_wrapper(void (*funcPtr)(void));
+#endif
+
   // filter function to ignore faults on serializations page
   static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e);
 };
 
+/*
+ * Crash protection for the watcher thread. Wrap the callback
+ * with a __try { call() }
+ * To be able to use this - don't take locks, don't rely on destructors,
+ * don't make OS library calls, don't allocate memory, don't print,
+ * don't call code that could leave the heap / memory in an inconsistent state,
+ * or anything else where we are not in control if we suddenly jump out.
+ */
+class WatcherThreadCrashProtection : public StackObj {
+public:
+  WatcherThreadCrashProtection();
+  bool call(os::CrashProtectionCallback& cb);
+};
+
 class PlatformEvent : public CHeapObj<mtInternal> {
   private:
     double CachePad [4] ;   // increase odds that _Event is sole occupant of cache line
--- a/hotspot/src/os/windows/vm/os_windows.inline.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -106,4 +106,10 @@
 inline int os::close(int fd) {
   return ::close(fd);
 }
+
+#ifndef PRODUCT
+  #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) \
+            os::win32::call_test_func_with_wrapper(f)
+#endif
+
 #endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
--- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.s	Fri Jul 26 14:07:32 2013 -0700
@@ -63,24 +63,6 @@
         popl     %eax
         ret
 
-        .globl  SYMBOL(SafeFetch32), SYMBOL(Fetch32PFI), SYMBOL(Fetch32Resume)
-        .globl  SYMBOL(SafeFetchN)
-        ## TODO: avoid exposing Fetch32PFI and Fetch32Resume.
-        ## Instead, the signal handler would call a new SafeFetchTriage(FaultingEIP)
-        ## routine to vet the address.  If the address is the faulting LD then
-        ## SafeFetchTriage() would return the resume-at EIP, otherwise null.
-        ELF_TYPE(SafeFetch32,@function)
-        .p2align 4,,15
-SYMBOL(SafeFetch32):
-SYMBOL(SafeFetchN):
-         movl    0x8(%esp), %eax
-         movl    0x4(%esp), %ecx
-SYMBOL(Fetch32PFI):
-         movl    (%ecx), %eax
-SYMBOL(Fetch32Resume):
-         ret
-
-
         .globl  SYMBOL(SpinPause)
         ELF_TYPE(SpinPause,@function)
         .p2align 4,,15
--- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.s	Fri Jul 26 14:07:32 2013 -0700
@@ -46,28 +46,6 @@
 
 	.text
 
-        .globl SYMBOL(SafeFetch32), SYMBOL(Fetch32PFI), SYMBOL(Fetch32Resume)
-        .p2align 4,,15
-        ELF_TYPE(SafeFetch32,@function)
-        // Prototype: int SafeFetch32 (int * Adr, int ErrValue) 
-SYMBOL(SafeFetch32):
-        movl    %esi, %eax
-SYMBOL(Fetch32PFI):
-        movl    (%rdi), %eax
-SYMBOL(Fetch32Resume):
-        ret
-
-        .globl SYMBOL(SafeFetchN), SYMBOL(FetchNPFI), SYMBOL(FetchNResume)
-        .p2align 4,,15
-        ELF_TYPE(SafeFetchN,@function)
-        // Prototype: intptr_t SafeFetchN (intptr_t * Adr, intptr_t ErrValue) 
-SYMBOL(SafeFetchN):
-        movq    %rsi, %rax
-SYMBOL(FetchNPFI):
-        movq    (%rdi), %rax
-SYMBOL(FetchNResume):
-        ret
-
         .globl SYMBOL(SpinPause)
         .p2align 4,,15
         ELF_TYPE(SpinPause,@function)
--- a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -72,7 +72,7 @@
 inline juint    OrderAccess::load_acquire(volatile juint*   p) { return *p; }
 inline julong   OrderAccess::load_acquire(volatile julong*  p) { return Atomic::load((volatile jlong*)p); }
 inline jfloat   OrderAccess::load_acquire(volatile jfloat*  p) { return *p; }
-inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
+inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return jdouble_cast(Atomic::load((volatile jlong*)p)); }
 
 inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t*   p) { return *p; }
 inline void*    OrderAccess::load_ptr_acquire(volatile void*       p) { return *(void* volatile *)p; }
@@ -87,7 +87,7 @@
 inline void     OrderAccess::release_store(volatile juint*   p, juint   v) { *p = v; }
 inline void     OrderAccess::release_store(volatile julong*  p, julong  v) { Atomic::store((jlong)v, (volatile jlong*)p); }
 inline void     OrderAccess::release_store(volatile jfloat*  p, jfloat  v) { *p = v; }
-inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
+inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { release_store((volatile jlong*)p, jlong_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; }
 inline void     OrderAccess::release_store_ptr(volatile void*     p, void*    v) { *(void* volatile *)p = v; }
@@ -190,7 +190,7 @@
 inline void     OrderAccess::release_store_fence(volatile julong*  p, julong  v) { release_store_fence((volatile jlong*)p,  (jlong)v);  }
 
 inline void     OrderAccess::release_store_fence(volatile jfloat*  p, jfloat  v) { *p = v; fence(); }
-inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
+inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { release_store_fence((volatile jlong*)p, jdouble_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) {
 #ifdef AMD64
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -385,13 +385,6 @@
   trap_page_fault = 0xE
 };
 
-extern "C" void Fetch32PFI () ;
-extern "C" void Fetch32Resume () ;
-#ifdef AMD64
-extern "C" void FetchNPFI () ;
-extern "C" void FetchNResume () ;
-#endif // AMD64
-
 extern "C" JNIEXPORT int
 JVM_handle_bsd_signal(int sig,
                         siginfo_t* info,
@@ -401,6 +394,10 @@
 
   Thread* t = ThreadLocalStorage::get_thread_slow();
 
+  // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
+  // (no destructors can be run)
+  os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
+
   SignalHandlerMark shm(t);
 
   // Note: it's not uncommon that JNI code uses signal/sigset to install
@@ -454,16 +451,10 @@
   if (info != NULL && uc != NULL && thread != NULL) {
     pc = (address) os::Bsd::ucontext_get_pc(uc);
 
-    if (pc == (address) Fetch32PFI) {
-       uc->context_pc = intptr_t(Fetch32Resume) ;
-       return 1 ;
+    if (StubRoutines::is_safefetch_fault(pc)) {
+      uc->context_pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
+      return 1;
     }
-#ifdef AMD64
-    if (pc == (address) FetchNPFI) {
-       uc->context_pc = intptr_t (FetchNResume) ;
-       return 1 ;
-    }
-#endif // AMD64
 
     // Handle ALL stack overflow variations here
     if (sig == SIGSEGV || sig == SIGBUS) {
--- a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s	Fri Jul 26 14:07:32 2013 -0700
@@ -21,42 +21,6 @@
 # questions.
 #
 
-    # Prototype: int SafeFetch32 (int * adr, int ErrValue)
-    # The "ld" at Fetch32 is potentially faulting instruction.
-    # If the instruction traps the trap handler will arrange
-    # for control to resume at Fetch32Resume.  
-    # By convention with the trap handler we ensure there is a non-CTI
-    # instruction in the trap shadow.  
-        
-
-    .globl  SafeFetch32, Fetch32PFI, Fetch32Resume
-    .globl  SafeFetchN
-    .align  32
-    .type    SafeFetch32,@function
-SafeFetch32:        
-    mov     %o0, %g1
-    mov     %o1, %o0
-Fetch32PFI:
-    # <-- Potentially faulting instruction
-    ld      [%g1], %o0         
-Fetch32Resume:
-    nop
-    retl
-    nop
-
-    .globl  SafeFetchN, FetchNPFI, FetchNResume
-    .type    SafeFetchN,@function
-    .align  32
-SafeFetchN:
-    mov     %o0, %g1
-    mov     %o1, %o0
-FetchNPFI:
-    ldn     [%g1], %o0
-FetchNResume:
-    nop
-    retl
-    nop
-
     # Possibilities:
     # -- membar
     # -- CAS (SP + BIAS, G0, G0)
--- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -366,18 +366,9 @@
 
 // Utility functions
 
-extern "C" void Fetch32PFI();
-extern "C" void Fetch32Resume();
-extern "C" void FetchNPFI();
-extern "C" void FetchNResume();
-
 inline static bool checkPrefetch(sigcontext* uc, address pc) {
-  if (pc == (address) Fetch32PFI) {
-    set_cont_address(uc, address(Fetch32Resume));
-    return true;
-  }
-  if (pc == (address) FetchNPFI) {
-    set_cont_address(uc, address(FetchNResume));
+  if (StubRoutines::is_safefetch_fault(pc)) {
+    set_cont_address(uc, address(StubRoutines::continuation_for_safefetch_fault(pc)));
     return true;
   }
   return false;
@@ -553,6 +544,10 @@
 
   Thread* t = ThreadLocalStorage::get_thread_slow();
 
+  // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
+  // (no destructors can be run)
+  os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
+
   SignalHandlerMark shm(t);
 
   // Note: it's not uncommon that JNI code uses signal/sigset to install
--- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	Fri Jul 26 14:07:32 2013 -0700
@@ -42,24 +42,6 @@
 
 	.text
 
-        .globl  SafeFetch32, Fetch32PFI, Fetch32Resume
-        .globl  SafeFetchN
-        ## TODO: avoid exposing Fetch32PFI and Fetch32Resume.
-        ## Instead, the signal handler would call a new SafeFetchTriage(FaultingEIP)
-        ## routine to vet the address.  If the address is the faulting LD then
-        ## SafeFetchTriage() would return the resume-at EIP, otherwise null.
-	.type    SafeFetch32,@function
-        .p2align 4,,15
-SafeFetch32:
-SafeFetchN:
-         movl    0x8(%esp), %eax
-         movl    0x4(%esp), %ecx
-Fetch32PFI:
-         movl    (%ecx), %eax
-Fetch32Resume:
-         ret
-
-
         .globl  SpinPause
 	.type   SpinPause,@function
         .p2align 4,,15
--- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	Fri Jul 26 14:07:32 2013 -0700
@@ -38,28 +38,6 @@
 
 	.text
 
-        .globl SafeFetch32, Fetch32PFI, Fetch32Resume
-        .align  16
-        .type   SafeFetch32,@function
-        // Prototype: int SafeFetch32 (int * Adr, int ErrValue) 
-SafeFetch32:
-        movl    %esi, %eax
-Fetch32PFI:
-        movl    (%rdi), %eax
-Fetch32Resume:
-        ret
-
-        .globl SafeFetchN, FetchNPFI, FetchNResume
-        .align  16
-        .type   SafeFetchN,@function
-        // Prototype: intptr_t SafeFetchN (intptr_t * Adr, intptr_t ErrValue) 
-SafeFetchN:
-        movq    %rsi, %rax
-FetchNPFI:
-        movq    (%rdi), %rax
-FetchNResume:
-        ret
-
         .globl SpinPause
         .align 16
         .type  SpinPause,@function
--- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -72,7 +72,7 @@
 inline juint    OrderAccess::load_acquire(volatile juint*   p) { return *p; }
 inline julong   OrderAccess::load_acquire(volatile julong*  p) { return Atomic::load((volatile jlong*)p); }
 inline jfloat   OrderAccess::load_acquire(volatile jfloat*  p) { return *p; }
-inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
+inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return jdouble_cast(Atomic::load((volatile jlong*)p)); }
 
 inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t*   p) { return *p; }
 inline void*    OrderAccess::load_ptr_acquire(volatile void*       p) { return *(void* volatile *)p; }
@@ -87,7 +87,7 @@
 inline void     OrderAccess::release_store(volatile juint*   p, juint   v) { *p = v; }
 inline void     OrderAccess::release_store(volatile julong*  p, julong  v) { Atomic::store((jlong)v, (volatile jlong*)p); }
 inline void     OrderAccess::release_store(volatile jfloat*  p, jfloat  v) { *p = v; }
-inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
+inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { release_store((volatile jlong *)p, jlong_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; }
 inline void     OrderAccess::release_store_ptr(volatile void*     p, void*    v) { *(void* volatile *)p = v; }
@@ -129,7 +129,7 @@
 inline void     OrderAccess::store_fence(juint*   p, juint   v) { store_fence((jint*)p,   (jint)v);   }
 inline void     OrderAccess::store_fence(julong*  p, julong  v) { store_fence((jlong*)p,  (jlong)v);  }
 inline void     OrderAccess::store_fence(jfloat*  p, jfloat  v) { *p = v; fence(); }
-inline void     OrderAccess::store_fence(jdouble* p, jdouble v) { *p = v; fence(); }
+inline void     OrderAccess::store_fence(jdouble* p, jdouble v) { store_fence((jlong*)p, jlong_cast(v)); }
 
 inline void     OrderAccess::store_ptr_fence(intptr_t* p, intptr_t v) {
 #ifdef AMD64
@@ -190,7 +190,7 @@
 inline void     OrderAccess::release_store_fence(volatile julong*  p, julong  v) { release_store_fence((volatile jlong*)p,  (jlong)v);  }
 
 inline void     OrderAccess::release_store_fence(volatile jfloat*  p, jfloat  v) { *p = v; fence(); }
-inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
+inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { release_store_fence((volatile jlong*)p, jlong_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) {
 #ifdef AMD64
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -209,13 +209,6 @@
   trap_page_fault = 0xE
 };
 
-extern "C" void Fetch32PFI () ;
-extern "C" void Fetch32Resume () ;
-#ifdef AMD64
-extern "C" void FetchNPFI () ;
-extern "C" void FetchNResume () ;
-#endif // AMD64
-
 extern "C" JNIEXPORT int
 JVM_handle_linux_signal(int sig,
                         siginfo_t* info,
@@ -225,6 +218,10 @@
 
   Thread* t = ThreadLocalStorage::get_thread_slow();
 
+  // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
+  // (no destructors can be run)
+  os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
+
   SignalHandlerMark shm(t);
 
   // Note: it's not uncommon that JNI code uses signal/sigset to install
@@ -278,16 +275,10 @@
   if (info != NULL && uc != NULL && thread != NULL) {
     pc = (address) os::Linux::ucontext_get_pc(uc);
 
-    if (pc == (address) Fetch32PFI) {
-       uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ;
-       return 1 ;
+    if (StubRoutines::is_safefetch_fault(pc)) {
+      uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
+      return 1;
     }
-#ifdef AMD64
-    if (pc == (address) FetchNPFI) {
-       uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ;
-       return 1 ;
-    }
-#endif // AMD64
 
 #ifndef AMD64
     // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs
--- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -303,11 +303,6 @@
 #endif
 }
 
-extern "C" void Fetch32PFI () ;
-extern "C" void Fetch32Resume () ;
-extern "C" void FetchNPFI () ;
-extern "C" void FetchNResume () ;
-
 extern "C" JNIEXPORT int
 JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
                           int abort_if_unrecognized) {
@@ -315,6 +310,10 @@
 
   Thread* t = ThreadLocalStorage::get_thread_slow();
 
+  // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
+  // (no destructors can be run)
+  os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
+
   SignalHandlerMark shm(t);
 
   if(sig == SIGPIPE || sig == SIGXFSZ) {
@@ -379,17 +378,10 @@
     npc = (address) uc->uc_mcontext.gregs[REG_nPC];
 
     // SafeFetch() support
-    // Implemented with either a fixed set of addresses such
-    // as Fetch32*, or with Thread._OnTrap.
-    if (uc->uc_mcontext.gregs[REG_PC] == intptr_t(Fetch32PFI)) {
-      uc->uc_mcontext.gregs [REG_PC]  = intptr_t(Fetch32Resume) ;
-      uc->uc_mcontext.gregs [REG_nPC] = intptr_t(Fetch32Resume) + 4 ;
-      return true ;
-    }
-    if (uc->uc_mcontext.gregs[REG_PC] == intptr_t(FetchNPFI)) {
-      uc->uc_mcontext.gregs [REG_PC]  = intptr_t(FetchNResume) ;
-      uc->uc_mcontext.gregs [REG_nPC] = intptr_t(FetchNResume) + 4 ;
-      return true ;
+    if (StubRoutines::is_safefetch_fault(pc)) {
+      uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
+      uc->uc_mcontext.gregs[REG_nPC] = uc->uc_mcontext.gregs[REG_PC] + 4;
+      return 1;
     }
 
     // Handle ALL stack overflow variations here
--- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s	Fri Jul 26 14:07:32 2013 -0700
@@ -21,47 +21,6 @@
 !! questions.
 !!
 
-    !! Prototype: int SafeFetch32 (int * adr, int ErrValue)
-    !! The "ld" at Fetch32 is potentially faulting instruction.
-    !! If the instruction traps the trap handler will arrange
-    !! for control to resume at Fetch32Resume.  
-    !! By convention with the trap handler we ensure there is a non-CTI
-    !! instruction in the trap shadow.  
-    !!
-    !! The reader might be tempted to move this service to .il.
-    !! Don't.  Sun's CC back-end reads and optimize code emitted 
-    !! by the .il "call", in some cases optimizing the code, completely eliding it,
-    !! or by moving the code from the "call site". 
-        
-     !! ASM better know we may use G6 for our own purposes
-    .register %g6, #ignore
-        
-    .globl  SafeFetch32
-    .align  32
-    .global Fetch32PFI, Fetch32Resume 
-SafeFetch32:
-    mov     %o0, %g1
-    mov     %o1, %o0
-Fetch32PFI:
-    ld      [%g1], %o0          !! <-- Potentially faulting instruction
-Fetch32Resume:
-    nop
-    retl
-    nop
-
-    .globl  SafeFetchN
-    .align  32
-    .globl  FetchNPFI, FetchNResume
-SafeFetchN:
-    mov     %o0, %g1
-    mov     %o1, %o0
-FetchNPFI:
-    ldn     [%g1], %o0
-FetchNResume:
-    nop
-    retl
-    nop
-
     !! Possibilities:
     !! -- membar
     !! -- CAS (SP + BIAS, G0, G0)
--- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -88,7 +88,7 @@
 inline juint    OrderAccess::load_acquire(volatile juint*   p) { return *p; }
 inline julong   OrderAccess::load_acquire(volatile julong*  p) { return Atomic::load((volatile jlong*)p); }
 inline jfloat   OrderAccess::load_acquire(volatile jfloat*  p) { return *p; }
-inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
+inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return jdouble_cast(Atomic::load((volatile jlong*)p)); }
 
 inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t*   p) { return *p; }
 inline void*    OrderAccess::load_ptr_acquire(volatile void*       p) { return *(void* volatile *)p; }
@@ -103,7 +103,7 @@
 inline void     OrderAccess::release_store(volatile juint*   p, juint   v) { *p = v; }
 inline void     OrderAccess::release_store(volatile julong*  p, julong  v) { Atomic::store((jlong)v, (volatile jlong*)p); }
 inline void     OrderAccess::release_store(volatile jfloat*  p, jfloat  v) { *p = v; }
-inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
+inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { release_store((volatile jlong*)p, jlong_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; }
 inline void     OrderAccess::release_store_ptr(volatile void*     p, void*    v) { *(void* volatile *)p = v; }
@@ -129,9 +129,9 @@
 inline void     OrderAccess::release_store_fence(volatile jubyte*  p, jubyte  v) { *p = v; fence(); }
 inline void     OrderAccess::release_store_fence(volatile jushort* p, jushort v) { *p = v; fence(); }
 inline void     OrderAccess::release_store_fence(volatile juint*   p, juint   v) { *p = v; fence(); }
-inline void     OrderAccess::release_store_fence(volatile julong*  p, julong  v) { release_store(p, v); fence(); }
+inline void     OrderAccess::release_store_fence(volatile julong*  p, julong  v) { release_store((jlong *)p, (jlong)v); fence(); }
 inline void     OrderAccess::release_store_fence(volatile jfloat*  p, jfloat  v) { *p = v; fence(); }
-inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
+inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { release_store_fence((volatile jlong*)p, jlong_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) { *p = v; fence(); }
 inline void     OrderAccess::release_store_ptr_fence(volatile void*     p, void*    v) { *(void* volatile *)p = v; fence(); }
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -352,13 +352,6 @@
 
 }
 
-extern "C" void Fetch32PFI () ;
-extern "C" void Fetch32Resume () ;
-#ifdef AMD64
-extern "C" void FetchNPFI () ;
-extern "C" void FetchNResume () ;
-#endif // AMD64
-
 extern "C" JNIEXPORT int
 JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
                           int abort_if_unrecognized) {
@@ -374,6 +367,10 @@
 
   Thread* t = ThreadLocalStorage::get_thread_slow();  // slow & steady
 
+  // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
+  // (no destructors can be run)
+  os::WatcherThreadCrashProtection::check_crash_protection(sig, t);
+
   SignalHandlerMark shm(t);
 
   if(sig == SIGPIPE || sig == SIGXFSZ) {
@@ -436,17 +433,10 @@
     // factor me: getPCfromContext
     pc = (address) uc->uc_mcontext.gregs[REG_PC];
 
-    // SafeFetch32() support
-    if (pc == (address) Fetch32PFI) {
-      uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ;
-      return true ;
+    if (StubRoutines::is_safefetch_fault(pc)) {
+      uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
+      return true;
     }
-#ifdef AMD64
-    if (pc == (address) FetchNPFI) {
-       uc->uc_mcontext.gregs [REG_PC] = intptr_t(FetchNResume) ;
-       return true ;
-    }
-#endif // AMD64
 
     // Handle ALL stack overflow variations here
     if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) {
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.s	Fri Jul 26 14:07:32 2013 -0700
@@ -54,20 +54,6 @@
 	popl     %eax
 	ret
 
-       .align  16
-       .globl  SafeFetch32
-       .globl  SafeFetchN
-       .globl  Fetch32PFI, Fetch32Resume
-SafeFetch32:
-SafeFetchN:
-        movl    0x8(%esp), %eax
-        movl    0x4(%esp), %ecx
-Fetch32PFI:
-        movl    (%ecx), %eax
-Fetch32Resume:
-        ret
-
-
         .align  16
         .globl  SpinPause
 SpinPause:
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.s	Fri Jul 26 14:07:32 2013 -0700
@@ -21,54 +21,34 @@
 / questions.
 /
 
-	.globl fs_load
-	.globl fs_thread
+        .globl fs_load
+        .globl fs_thread
 
         // NOTE WELL!  The _Copy functions are called directly
-	// from server-compiler-generated code via CallLeafNoFP,
-	// which means that they *must* either not use floating
-	// point or use it in the same manner as does the server
-	// compiler.
+        // from server-compiler-generated code via CallLeafNoFP,
+        // which means that they *must* either not use floating
+        // point or use it in the same manner as does the server
+        // compiler.
 
         .globl _Copy_arrayof_conjoint_bytes
         .globl _Copy_conjoint_jshorts_atomic
-	.globl _Copy_arrayof_conjoint_jshorts
+        .globl _Copy_arrayof_conjoint_jshorts
         .globl _Copy_conjoint_jints_atomic
         .globl _Copy_arrayof_conjoint_jints
-	.globl _Copy_conjoint_jlongs_atomic
+        .globl _Copy_conjoint_jlongs_atomic
         .globl _Copy_arrayof_conjoint_jlongs
 
-	.section .text,"ax"
+        .section .text,"ax"
 
         / Fast thread accessors, used by threadLS_solaris_amd64.cpp
-	.align   16
+        .align   16
 fs_load:
-	movq %fs:(%rdi),%rax
-	ret
-
-	.align   16
-fs_thread:
-	movq %fs:0x0,%rax
-	ret
-
-        .globl SafeFetch32, Fetch32PFI, Fetch32Resume
-        .align  16
-        // Prototype: int SafeFetch32 (int * Adr, int ErrValue) 
-SafeFetch32:
-        movl    %esi, %eax
-Fetch32PFI:
-        movl    (%rdi), %eax
-Fetch32Resume:
+        movq %fs:(%rdi),%rax
         ret
 
-        .globl SafeFetchN, FetchNPFI, FetchNResume
-        .align  16
-        // Prototype: intptr_t SafeFetchN (intptr_t * Adr, intptr_t ErrValue) 
-SafeFetchN:
-        movq    %rsi, %rax
-FetchNPFI:
-        movq    (%rdi), %rax
-FetchNResume:
+        .align   16
+fs_thread:
+        movq %fs:0x0,%rax
         ret
 
         .globl  SpinPause
@@ -78,7 +58,7 @@
         nop
         movq    $1, %rax
         ret
-        
+
 
         / Support for void Copy::arrayof_conjoint_bytes(void* from,
         /                                               void* to,
@@ -340,7 +320,7 @@
         addq     $4,%rdx
         jg       1b
         ret
-	
+
         / Support for void Copy::arrayof_conjoint_jlongs(jlong* from,
         /                                                jlong* to,
         /                                                size_t count)
--- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -71,7 +71,7 @@
 inline juint    OrderAccess::load_acquire(volatile juint*   p) { return *p; }
 inline julong   OrderAccess::load_acquire(volatile julong*  p) { return Atomic::load((volatile jlong*)p); }
 inline jfloat   OrderAccess::load_acquire(volatile jfloat*  p) { return *p; }
-inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
+inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) { return jdouble_cast(Atomic::load((volatile jlong*)p)); }
 
 inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t*   p) { return *p; }
 inline void*    OrderAccess::load_ptr_acquire(volatile void*       p) { return *(void* volatile *)p; }
@@ -86,7 +86,7 @@
 inline void     OrderAccess::release_store(volatile juint*   p, juint   v) { *p = v; }
 inline void     OrderAccess::release_store(volatile julong*  p, julong  v) { Atomic::store((jlong)v, (volatile jlong*)p); }
 inline void     OrderAccess::release_store(volatile jfloat*  p, jfloat  v) { *p = v; }
-inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
+inline void     OrderAccess::release_store(volatile jdouble* p, jdouble v) { release_store((volatile jlong*)p, jlong_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr(volatile intptr_t* p, intptr_t v) { *p = v; }
 inline void     OrderAccess::release_store_ptr(volatile void*     p, void*    v) { *(void* volatile *)p = v; }
@@ -195,7 +195,7 @@
 inline void     OrderAccess::release_store_fence(volatile juint*   p, juint   v) { release_store_fence((volatile jint*)p,   (jint)v);   }
 inline void     OrderAccess::release_store_fence(volatile julong*  p, julong  v) { release_store_fence((volatile jlong*)p,  (jlong)v);  }
 inline void     OrderAccess::release_store_fence(volatile jfloat*  p, jfloat  v) { *p = v; fence(); }
-inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }
+inline void     OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { release_store_fence((volatile jlong*)p, jlong_cast(v)); }
 
 inline void     OrderAccess::release_store_ptr_fence(volatile intptr_t* p, intptr_t v) {
 #ifdef AMD64
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -518,24 +518,6 @@
   st->cr();
 }
 
-extern "C" int SafeFetch32 (int * adr, int Err) {
-   int rv = Err ;
-   _try {
-       rv = *((volatile int *) adr) ;
-   } __except(EXCEPTION_EXECUTE_HANDLER) {
-   }
-   return rv ;
-}
-
-extern "C" intptr_t SafeFetchN (intptr_t * adr, intptr_t Err) {
-   intptr_t rv = Err ;
-   _try {
-       rv = *((volatile intptr_t *) adr) ;
-   } __except(EXCEPTION_EXECUTE_HANDLER) {
-   }
-   return rv ;
-}
-
 extern "C" int SpinPause () {
 #ifdef AMD64
    return 0 ;
--- a/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,10 +29,15 @@
 #ifdef AMD64
 typedef unsigned char UBYTE;
 
+#if _MSC_VER < 1700
+
+/* Not needed for VS2012 compiler, comes from winnt.h. */
 #define UNW_FLAG_EHANDLER  0x01
 #define UNW_FLAG_UHANDLER  0x02
 #define UNW_FLAG_CHAININFO 0x04
 
+#endif
+
 // This structure is used to define an UNWIND_INFO that
 // only has an ExceptionHandler.  There are no UnwindCodes
 // declared.
@@ -59,6 +64,9 @@
 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
 */
 
+#if _MSC_VER < 1700
+
+/* Not needed for VS2012 compiler, comes from winnt.h. */
 typedef struct _DISPATCHER_CONTEXT {
     ULONG64 ControlPc;
     ULONG64 ImageBase;
@@ -71,6 +79,8 @@
     PVOID HandlerData;
 } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
 
+#endif
+
 #if _MSC_VER < 1500
 
 /* Not needed for VS2008 compiler, comes from winnt.h. */
--- a/hotspot/src/share/vm/adlc/forms.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/adlc/forms.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -146,7 +146,7 @@
   // Public Methods
   Form(int formType=0, int line=0)
     : _next(NULL), _linenum(line), _ftype(formType) { };
-  ~Form() {};
+  virtual ~Form() {};
 
   virtual bool ideal_only() const {
     assert(0,"Check of ideal status on non-instruction/operand form.\n");
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -138,6 +138,16 @@
   return false;
 }
 
+// return true if all argument elements of vars are returned
+bool BCEscapeAnalyzer::returns_all(ArgumentMap vars) {
+  for (int i = 0; i < _arg_size; i++) {
+    if (vars.contains(i) && !_arg_returned.test(i)) {
+      return false;
+    }
+  }
+  return true;
+}
+
 void BCEscapeAnalyzer::clear_bits(ArgumentMap vars, VectorSet &bm) {
   for (int i = 0; i < _arg_size; i++) {
     if (vars.contains(i)) {
@@ -166,6 +176,11 @@
     if (vars.contains_unknown() || vars.contains_vars()) {
       _return_allocated = false;
     }
+    if (_return_local && vars.contains_vars() && !returns_all(vars)) {
+      // Return result should be invalidated if args in new
+      // state are not recorded in return state.
+      _return_local = false;
+    }
   }
 }
 
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -80,6 +80,7 @@
   void set_returned(ArgumentMap vars);
   bool is_argument(ArgumentMap vars);
   bool is_arg_stack(ArgumentMap vars);
+  bool returns_all(ArgumentMap vars);
   void clear_bits(ArgumentMap vars, VectorSet &bs);
   void set_method_escape(ArgumentMap vars);
   void set_global_escape(ArgumentMap vars, bool merge = false);
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -3647,8 +3647,7 @@
   // If RedefineClasses() was used before the retransformable
   // agent attached, then the cached class bytes may not be the
   // original class bytes.
-  unsigned char *cached_class_file_bytes = NULL;
-  jint cached_class_file_length;
+  JvmtiCachedClassFileData *cached_class_file = NULL;
   Handle class_loader(THREAD, loader_data->class_loader());
   bool has_default_methods = false;
   ResourceMark rm(THREAD);
@@ -3680,10 +3679,7 @@
       if (h_class_being_redefined != NULL) {
         instanceKlassHandle ikh_class_being_redefined =
           instanceKlassHandle(THREAD, (*h_class_being_redefined)());
-        cached_class_file_bytes =
-          ikh_class_being_redefined->get_cached_class_file_bytes();
-        cached_class_file_length =
-          ikh_class_being_redefined->get_cached_class_file_len();
+        cached_class_file = ikh_class_being_redefined->get_cached_class_file();
       }
     }
 
@@ -3691,9 +3687,7 @@
     unsigned char* end_ptr = cfs->buffer() + cfs->length();
 
     JvmtiExport::post_class_file_load_hook(name, class_loader(), protection_domain,
-                                           &ptr, &end_ptr,
-                                           &cached_class_file_bytes,
-                                           &cached_class_file_length);
+                                           &ptr, &end_ptr, &cached_class_file);
 
     if (ptr != cfs->buffer()) {
       // JVMTI agent has modified class file data.
@@ -4011,10 +4005,9 @@
       }
     }
 
-    if (cached_class_file_bytes != NULL) {
+    if (cached_class_file != NULL) {
       // JVMTI: we have an InstanceKlass now, tell it about the cached bytes
-      this_klass->set_cached_class_file(cached_class_file_bytes,
-                                        cached_class_file_length);
+      this_klass->set_cached_class_file(cached_class_file);
     }
 
     // Fill in field values obtained by parse_classfile_attributes
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -318,17 +318,17 @@
   }
 };
 
+
 // A method family contains a set of all methods that implement a single
-// language-level method.  Because of erasure, these methods may have different
-// signatures.  As members of the set are collected while walking over the
+// erased method. As members of the set are collected while walking over the
 // hierarchy, they are tagged with a qualification state.  The qualification
 // state for an erased method is set to disqualified if there exists a path
 // from the root of hierarchy to the method that contains an interleaving
-// language-equivalent method defined in an interface.
+// erased method defined in an interface.
+
 class MethodFamily : public ResourceObj {
  private:
 
-  generic::MethodDescriptor* _descriptor; // language-level description
   GrowableArray<Pair<Method*,QualifiedState> > _members;
   ResourceHashtable<Method*, int> _member_index;
 
@@ -358,15 +358,8 @@
 
  public:
 
-  MethodFamily(generic::MethodDescriptor* canonical_desc)
-      : _descriptor(canonical_desc), _selected_target(NULL),
-        _exception_message(NULL) {}
-
-  generic::MethodDescriptor* descriptor() const { return _descriptor; }
-
-  bool descriptor_matches(generic::MethodDescriptor* md, generic::Context* ctx) {
-    return descriptor()->covariant_match(md, ctx);
-  }
+  MethodFamily()
+      : _selected_target(NULL), _exception_message(NULL) {}
 
   void set_target_if_empty(Method* m) {
     if (_selected_target == NULL && !m->is_overpass()) {
@@ -441,16 +434,10 @@
   }
 
 #ifndef PRODUCT
-  void print_on(outputStream* str) const {
-    print_on(str, 0);
-  }
-
-  void print_on(outputStream* str, int indent) const {
+  void print_sig_on(outputStream* str, Symbol* signature, int indent) const {
     streamIndentor si(str, indent * 2);
 
-    generic::Context ctx(NULL); // empty, as _descriptor already canonicalized
-    TempNewSymbol family = descriptor()->reify_signature(&ctx, Thread::current());
-    str->indent().print_cr("Logical Method %s:", family->as_C_string());
+    str->indent().print_cr("Logical Method %s:", signature->as_C_string());
 
     streamIndentor si2(str);
     for (int i = 0; i < _members.length(); ++i) {
@@ -516,36 +503,92 @@
   return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
 }
 
+// A generic method family contains a set of all methods that implement a single
+// language-level method.  Because of erasure, these methods may have different
+// signatures.  As members of the set are collected while walking over the
+// hierarchy, they are tagged with a qualification state.  The qualification
+// state for an erased method is set to disqualified if there exists a path
+// from the root of hierarchy to the method that contains an interleaving
+// language-equivalent method defined in an interface.
+class GenericMethodFamily : public MethodFamily {
+ private:
+
+  generic::MethodDescriptor* _descriptor; // language-level description
+
+ public:
+
+  GenericMethodFamily(generic::MethodDescriptor* canonical_desc)
+      : _descriptor(canonical_desc) {}
+
+  generic::MethodDescriptor* descriptor() const { return _descriptor; }
+
+  bool descriptor_matches(generic::MethodDescriptor* md, generic::Context* ctx) {
+    return descriptor()->covariant_match(md, ctx);
+  }
+
+#ifndef PRODUCT
+  Symbol* get_generic_sig() const {
+
+    generic::Context ctx(NULL); // empty, as _descriptor already canonicalized
+    TempNewSymbol sig = descriptor()->reify_signature(&ctx, Thread::current());
+    return sig;
+  }
+#endif // ndef PRODUCT
+};
+
 class StateRestorer;
 
-// StatefulMethodFamily is a wrapper around MethodFamily that maintains the
+// StatefulMethodFamily is a wrapper around a MethodFamily that maintains the
 // qualification state during hierarchy visitation, and applies that state
-// when adding members to the MethodFamily.
+// when adding members to the MethodFamily
 class StatefulMethodFamily : public ResourceObj {
   friend class StateRestorer;
  private:
-  MethodFamily* _method;
   QualifiedState _qualification_state;
 
   void set_qualification_state(QualifiedState state) {
     _qualification_state = state;
   }
 
+ protected:
+  MethodFamily* _method_family;
+
  public:
-  StatefulMethodFamily(generic::MethodDescriptor* md, generic::Context* ctx) {
-    _method = new MethodFamily(md->canonicalize(ctx));
-    _qualification_state = QUALIFIED;
+  StatefulMethodFamily() {
+   _method_family = new MethodFamily();
+   _qualification_state = QUALIFIED;
+  }
+
+  StatefulMethodFamily(MethodFamily* mf) {
+   _method_family = mf;
+   _qualification_state = QUALIFIED;
   }
 
-  void set_target_if_empty(Method* m) { _method->set_target_if_empty(m); }
+  void set_target_if_empty(Method* m) { _method_family->set_target_if_empty(m); }
+
+  MethodFamily* get_method_family() { return _method_family; }
+
+  StateRestorer* record_method_and_dq_further(Method* mo);
+};
+
 
-  MethodFamily* get_method_family() { return _method; }
+// StatefulGenericMethodFamily is a wrapper around GenericMethodFamily that maintains the
+// qualification state during hierarchy visitation, and applies that state
+// when adding members to the GenericMethodFamily.
+class StatefulGenericMethodFamily : public StatefulMethodFamily {
+
+ public:
+  StatefulGenericMethodFamily(generic::MethodDescriptor* md, generic::Context* ctx)
+  : StatefulMethodFamily(new GenericMethodFamily(md->canonicalize(ctx))) {
+
+  }
+  GenericMethodFamily* get_method_family() {
+    return (GenericMethodFamily*)_method_family;
+  }
 
   bool descriptor_matches(generic::MethodDescriptor* md, generic::Context* ctx) {
-    return _method->descriptor_matches(md, ctx);
+    return get_method_family()->descriptor_matches(md, ctx);
   }
-
-  StateRestorer* record_method_and_dq_further(Method* mo);
 };
 
 class StateRestorer : public PseudoScopeMark {
@@ -563,9 +606,9 @@
 StateRestorer* StatefulMethodFamily::record_method_and_dq_further(Method* mo) {
   StateRestorer* mark = new StateRestorer(this, _qualification_state);
   if (_qualification_state == QUALIFIED) {
-    _method->record_qualified_method(mo);
+    _method_family->record_qualified_method(mo);
   } else {
-    _method->record_disqualified_method(mo);
+    _method_family->record_disqualified_method(mo);
   }
   // Everything found "above"??? this method in the hierarchy walk is set to
   // disqualified
@@ -573,15 +616,15 @@
   return mark;
 }
 
-class StatefulMethodFamilies : public ResourceObj {
+class StatefulGenericMethodFamilies : public ResourceObj {
  private:
-  GrowableArray<StatefulMethodFamily*> _methods;
+  GrowableArray<StatefulGenericMethodFamily*> _methods;
 
  public:
-  StatefulMethodFamily* find_matching(
+  StatefulGenericMethodFamily* find_matching(
       generic::MethodDescriptor* md, generic::Context* ctx) {
     for (int i = 0; i < _methods.length(); ++i) {
-      StatefulMethodFamily* existing = _methods.at(i);
+      StatefulGenericMethodFamily* existing = _methods.at(i);
       if (existing->descriptor_matches(md, ctx)) {
         return existing;
       }
@@ -589,17 +632,17 @@
     return NULL;
   }
 
-  StatefulMethodFamily* find_matching_or_create(
+  StatefulGenericMethodFamily* find_matching_or_create(
       generic::MethodDescriptor* md, generic::Context* ctx) {
-    StatefulMethodFamily* method = find_matching(md, ctx);
+    StatefulGenericMethodFamily* method = find_matching(md, ctx);
     if (method == NULL) {
-      method = new StatefulMethodFamily(md, ctx);
+      method = new StatefulGenericMethodFamily(md, ctx);
       _methods.append(method);
     }
     return method;
   }
 
-  void extract_families_into(GrowableArray<MethodFamily*>* array) {
+  void extract_families_into(GrowableArray<GenericMethodFamily*>* array) {
     for (int i = 0; i < _methods.length(); ++i) {
       array->append(_methods.at(i)->get_method_family());
     }
@@ -683,26 +726,79 @@
   return slots;
 }
 
+// Iterates over the superinterface type hierarchy looking for all methods
+// with a specific erased signature.
+class FindMethodsByErasedSig : public HierarchyVisitor<FindMethodsByErasedSig> {
+ private:
+  // Context data
+  Symbol* _method_name;
+  Symbol* _method_signature;
+  StatefulMethodFamily*  _family;
+
+ public:
+  FindMethodsByErasedSig(Symbol* name, Symbol* signature) :
+      _method_name(name), _method_signature(signature),
+      _family(NULL) {}
+
+  void get_discovered_family(MethodFamily** family) {
+      if (_family != NULL) {
+        *family = _family->get_method_family();
+      } else {
+        *family = NULL;
+      }
+  }
+
+  void* new_node_data(InstanceKlass* cls) { return new PseudoScope(); }
+  void free_node_data(void* node_data) {
+    PseudoScope::cast(node_data)->destroy();
+  }
+
+  // Find all methods on this hierarchy that match this
+  // method's erased (name, signature)
+  bool visit() {
+    PseudoScope* scope = PseudoScope::cast(current_data());
+    InstanceKlass* iklass = current_class();
+
+    Method* m = iklass->find_method(_method_name, _method_signature);
+    if (m != NULL) {
+      if (_family == NULL) {
+        _family = new StatefulMethodFamily();
+      }
+
+      if (iklass->is_interface()) {
+        StateRestorer* restorer = _family->record_method_and_dq_further(m);
+        scope->add_mark(restorer);
+      } else {
+        // This is the rule that methods in classes "win" (bad word) over
+        // methods in interfaces. This works because of single inheritance
+        _family->set_target_if_empty(m);
+      }
+    }
+    return true;
+  }
+
+};
+
 // Iterates over the type hierarchy looking for all methods with a specific
 // method name.  The result of this is a set of method families each of
 // which is populated with a set of methods that implement the same
 // language-level signature.
-class FindMethodsByName : public HierarchyVisitor<FindMethodsByName> {
+class FindMethodsByGenericSig : public HierarchyVisitor<FindMethodsByGenericSig> {
  private:
   // Context data
   Thread* THREAD;
   generic::DescriptorCache* _cache;
   Symbol* _method_name;
   generic::Context* _ctx;
-  StatefulMethodFamilies _families;
+  StatefulGenericMethodFamilies _families;
 
  public:
 
-  FindMethodsByName(generic::DescriptorCache* cache, Symbol* name,
+  FindMethodsByGenericSig(generic::DescriptorCache* cache, Symbol* name,
       generic::Context* ctx, Thread* thread) :
     _cache(cache), _method_name(name), _ctx(ctx), THREAD(thread) {}
 
-  void get_discovered_families(GrowableArray<MethodFamily*>* methods) {
+  void get_discovered_families(GrowableArray<GenericMethodFamily*>* methods) {
     _families.extract_families_into(methods);
   }
 
@@ -733,7 +829,7 @@
         // Find all methods on this hierarchy that match this method
         // (name, signature).   This class collects other families of this
         // method name.
-        StatefulMethodFamily* family =
+        StatefulGenericMethodFamily* family =
             _families.find_matching_or_create(md, _ctx);
 
         if (klass->is_interface()) {
@@ -752,8 +848,8 @@
 };
 
 #ifndef PRODUCT
-static void print_families(
-    GrowableArray<MethodFamily*>* methods, Symbol* match) {
+static void print_generic_families(
+    GrowableArray<GenericMethodFamily*>* methods, Symbol* match) {
   streamIndentor si(tty, 4);
   if (methods->length() == 0) {
     tty->indent();
@@ -761,21 +857,86 @@
   }
   for (int i = 0; i < methods->length(); ++i) {
     tty->indent();
-    MethodFamily* lm = methods->at(i);
+    GenericMethodFamily* lm = methods->at(i);
     if (lm->contains_signature(match)) {
       tty->print_cr("<Matching>");
     } else {
       tty->print_cr("<Non-Matching>");
     }
-    lm->print_on(tty, 1);
+    lm->print_sig_on(tty, lm->get_generic_sig(), 1);
   }
 }
 #endif // ndef PRODUCT
 
+static void create_overpasses(
+    GrowableArray<EmptyVtableSlot*>* slots, InstanceKlass* klass, TRAPS);
+
+static void generate_generic_defaults(
+      InstanceKlass* klass, GrowableArray<EmptyVtableSlot*>* empty_slots,
+      EmptyVtableSlot* slot, int current_slot_index, TRAPS) {
+
+  if (slot->is_bound()) {
+#ifndef PRODUCT
+    if (TraceDefaultMethods) {
+      streamIndentor si(tty, 4);
+      tty->indent().print_cr("Already bound to logical method:");
+      GenericMethodFamily* lm = (GenericMethodFamily*)(slot->get_binding());
+      lm->print_sig_on(tty, lm->get_generic_sig(), 1);
+    }
+#endif // ndef PRODUCT
+    return; // covered by previous processing
+  }
+
+  generic::DescriptorCache cache;
+
+  generic::Context ctx(&cache);
+  FindMethodsByGenericSig visitor(&cache, slot->name(), &ctx, CHECK);
+  visitor.run(klass);
+
+  GrowableArray<GenericMethodFamily*> discovered_families;
+  visitor.get_discovered_families(&discovered_families);
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    print_generic_families(&discovered_families, slot->signature());
+  }
+#endif // ndef PRODUCT
+
+  // Find and populate any other slots that match the discovered families
+  for (int j = current_slot_index; j < empty_slots->length(); ++j) {
+    EmptyVtableSlot* open_slot = empty_slots->at(j);
+
+    if (slot->name() == open_slot->name()) {
+      for (int k = 0; k < discovered_families.length(); ++k) {
+        GenericMethodFamily* lm = discovered_families.at(k);
+
+        if (lm->contains_signature(open_slot->signature())) {
+          lm->determine_target(klass, CHECK);
+          open_slot->bind_family(lm);
+        }
+      }
+    }
+  }
+}
+
+static void generate_erased_defaults(
+     InstanceKlass* klass, GrowableArray<EmptyVtableSlot*>* empty_slots,
+     EmptyVtableSlot* slot, TRAPS) {
+
+  // sets up a set of methods with the same exact erased signature
+  FindMethodsByErasedSig visitor(slot->name(), slot->signature());
+  visitor.run(klass);
+
+  MethodFamily* family;
+  visitor.get_discovered_family(&family);
+  if (family != NULL) {
+    family->determine_target(klass, CHECK);
+    slot->bind_family(family);
+  }
+}
+
 static void merge_in_new_methods(InstanceKlass* klass,
     GrowableArray<Method*>* new_methods, TRAPS);
-static void create_overpasses(
-    GrowableArray<EmptyVtableSlot*>* slots, InstanceKlass* klass, TRAPS);
 
 // This is the guts of the default methods implementation.  This is called just
 // after the classfile has been parsed if some ancestor has default methods.
@@ -807,8 +968,6 @@
   // whatever scope it's in.
   ResourceMark rm(THREAD);
 
-  generic::DescriptorCache cache;
-
   // Keep entire hierarchy alive for the duration of the computation
   KeepAliveRegistrar keepAlive(THREAD);
   KeepAliveVisitor loadKeepAlive(&keepAlive);
@@ -837,47 +996,13 @@
       tty->print_cr("");
     }
 #endif // ndef PRODUCT
-    if (slot->is_bound()) {
-#ifndef PRODUCT
-      if (TraceDefaultMethods) {
-        streamIndentor si(tty, 4);
-        tty->indent().print_cr("Already bound to logical method:");
-        slot->get_binding()->print_on(tty, 1);
-      }
-#endif // ndef PRODUCT
-      continue; // covered by previous processing
+
+    if (ParseGenericDefaults) {
+      generate_generic_defaults(klass, empty_slots, slot, i, CHECK);
+    } else {
+      generate_erased_defaults(klass, empty_slots, slot, CHECK);
     }
-
-    generic::Context ctx(&cache);
-    FindMethodsByName visitor(&cache, slot->name(), &ctx, CHECK);
-    visitor.run(klass);
-
-    GrowableArray<MethodFamily*> discovered_families;
-    visitor.get_discovered_families(&discovered_families);
-
-#ifndef PRODUCT
-    if (TraceDefaultMethods) {
-      print_families(&discovered_families, slot->signature());
-    }
-#endif // ndef PRODUCT
-
-    // Find and populate any other slots that match the discovered families
-    for (int j = i; j < empty_slots->length(); ++j) {
-      EmptyVtableSlot* open_slot = empty_slots->at(j);
-
-      if (slot->name() == open_slot->name()) {
-        for (int k = 0; k < discovered_families.length(); ++k) {
-          MethodFamily* lm = discovered_families.at(k);
-
-          if (lm->contains_signature(open_slot->signature())) {
-            lm->determine_target(klass, CHECK);
-            open_slot->bind_family(lm);
-          }
-        }
-      }
-    }
-  }
-
+ }
 #ifndef PRODUCT
   if (TraceDefaultMethods) {
     tty->print_cr("Creating overpasses...");
@@ -893,7 +1018,6 @@
 #endif // ndef PRODUCT
 }
 
-
 /**
  * Generic analysis was used upon interface '_target' and found a unique
  * default method candidate with generic signature '_method_desc'.  This
@@ -912,16 +1036,84 @@
  * the selected method along that path.
  */
 class ShadowChecker : public HierarchyVisitor<ShadowChecker> {
- private:
-  generic::DescriptorCache* _cache;
+ protected:
   Thread* THREAD;
 
   InstanceKlass* _target;
 
   Symbol* _method_name;
   InstanceKlass* _method_holder;
+  bool _found_shadow;
+
+
+ public:
+
+  ShadowChecker(Thread* thread, Symbol* name, InstanceKlass* holder,
+                InstanceKlass* target)
+                : THREAD(thread), _method_name(name), _method_holder(holder),
+                _target(target), _found_shadow(false) {}
+
+  void* new_node_data(InstanceKlass* cls) { return NULL; }
+  void free_node_data(void* data) { return; }
+
+  bool visit() {
+    InstanceKlass* ik = current_class();
+    if (ik == _target && current_depth() == 1) {
+      return false; // This was the specified super -- no need to search it
+    }
+    if (ik == _method_holder || ik == _target) {
+      // We found a path that should be examined to see if it shadows _method
+      if (path_has_shadow()) {
+        _found_shadow = true;
+        cancel_iteration();
+      }
+      return false; // no need to continue up hierarchy
+    }
+    return true;
+  }
+
+  virtual bool path_has_shadow() = 0;
+  bool found_shadow() { return _found_shadow; }
+};
+
+// Used for Invokespecial.
+// Invokespecial is allowed to invoke a concrete interface method
+// and can be used to disambuiguate among qualified candidates,
+// which are methods in immediate superinterfaces,
+// but may not be used to invoke a candidate that would be shadowed
+// from the perspective of the caller.
+// Invokespecial is also used in the overpass generation today
+// We re-run the shadowchecker because we can't distinguish this case,
+// but it should return the same answer, since the overpass target
+// is now the invokespecial caller.
+class ErasedShadowChecker : public ShadowChecker {
+ private:
+  bool path_has_shadow() {
+
+    for (int i = current_depth() - 1; i > 0; --i) {
+      InstanceKlass* ik = class_at_depth(i);
+
+      if (ik->is_interface()) {
+        int end;
+        int start = ik->find_method_by_name(_method_name, &end);
+        if (start != -1) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+ public:
+
+  ErasedShadowChecker(Thread* thread, Symbol* name, InstanceKlass* holder,
+                InstanceKlass* target)
+    : ShadowChecker(thread, name, holder, target) {}
+};
+
+class GenericShadowChecker : public ShadowChecker {
+ private:
+  generic::DescriptorCache* _cache;
   generic::MethodDescriptor* _method_desc;
-  bool _found_shadow;
 
   bool path_has_shadow() {
     generic::Context ctx(_cache);
@@ -950,104 +1142,42 @@
 
  public:
 
-  ShadowChecker(generic::DescriptorCache* cache, Thread* thread,
+  GenericShadowChecker(generic::DescriptorCache* cache, Thread* thread,
       Symbol* name, InstanceKlass* holder, generic::MethodDescriptor* desc,
       InstanceKlass* target)
-    : _cache(cache), THREAD(thread), _method_name(name), _method_holder(holder),
-      _method_desc(desc), _target(target), _found_shadow(false) {}
-
-  void* new_node_data(InstanceKlass* cls) { return NULL; }
-  void free_node_data(void* data) { return; }
-
-  bool visit() {
-    InstanceKlass* ik = current_class();
-    if (ik == _target && current_depth() == 1) {
-      return false; // This was the specified super -- no need to search it
-    }
-    if (ik == _method_holder || ik == _target) {
-      // We found a path that should be examined to see if it shadows _method
-      if (path_has_shadow()) {
-        _found_shadow = true;
-        cancel_iteration();
-      }
-      return false; // no need to continue up hierarchy
-    }
-    return true;
-  }
-
-  bool found_shadow() { return _found_shadow; }
+    : ShadowChecker(thread, name, holder, target) {
+      _cache = cache;
+      _method_desc = desc;
+ }
 };
 
-// This is called during linktime when we find an invokespecial call that
-// refers to a direct superinterface.  It indicates that we should find the
-// default method in the hierarchy of that superinterface, and if that method
-// would have been a candidate from the point of view of 'this' class, then we
-// return that method.
-Method* DefaultMethods::find_super_default(
-    Klass* cls, Klass* super, Symbol* method_name, Symbol* sig, TRAPS) {
+
 
-  ResourceMark rm(THREAD);
-
-  assert(cls != NULL && super != NULL, "Need real classes");
-
-  InstanceKlass* current_class = InstanceKlass::cast(cls);
-  InstanceKlass* direction = InstanceKlass::cast(super);
+// Find the unique qualified candidate from the perspective of the super_class
+// which is the resolved_klass, which must be an immediate superinterface
+// of klass
+Method* find_erased_super_default(InstanceKlass* current_class, InstanceKlass* super_class, Symbol* method_name, Symbol* sig, TRAPS) {
 
-  // Keep entire hierarchy alive for the duration of the computation
-  KeepAliveRegistrar keepAlive(THREAD);
-  KeepAliveVisitor loadKeepAlive(&keepAlive);
-  loadKeepAlive.run(current_class);
+  FindMethodsByErasedSig visitor(method_name, sig);
+  visitor.run(super_class);      // find candidates from resolved_klass
 
-#ifndef PRODUCT
-  if (TraceDefaultMethods) {
-    tty->print_cr("Finding super default method %s.%s%s from %s",
-      direction->name()->as_C_string(),
-      method_name->as_C_string(), sig->as_C_string(),
-      current_class->name()->as_C_string());
-  }
-#endif // ndef PRODUCT
+  MethodFamily* family;
+  visitor.get_discovered_family(&family);
 
-  if (!direction->is_interface()) {
-    // We should not be here
-    return NULL;
+  if (family != NULL) {
+    family->determine_target(current_class, CHECK_NULL);  // get target from current_class
   }
 
-  generic::DescriptorCache cache;
-  generic::Context ctx(&cache);
-
-  // Prime the initial generic context for current -> direction
-  ctx.apply_type_arguments(current_class, direction, CHECK_NULL);
-
-  FindMethodsByName visitor(&cache, method_name, &ctx, CHECK_NULL);
-  visitor.run(direction);
-
-  GrowableArray<MethodFamily*> families;
-  visitor.get_discovered_families(&families);
-
-#ifndef PRODUCT
-  if (TraceDefaultMethods) {
-    print_families(&families, sig);
-  }
-#endif // ndef PRODUCT
-
-  MethodFamily* selected_family = NULL;
-
-  for (int i = 0; i < families.length(); ++i) {
-    MethodFamily* lm = families.at(i);
-    if (lm->contains_signature(sig)) {
-      lm->determine_target(current_class, CHECK_NULL);
-      selected_family = lm;
-    }
-  }
-
-  if (selected_family->has_target()) {
-    Method* target = selected_family->get_selected_target();
+  if (family->has_target()) {
+    Method* target = family->get_selected_target();
     InstanceKlass* holder = InstanceKlass::cast(target->method_holder());
 
     // Verify that the identified method is valid from the context of
-    // the current class
-    ShadowChecker checker(&cache, THREAD, target->name(),
-        holder, selected_family->descriptor(), direction);
+    // the current class, which is the caller class for invokespecial
+    // link resolution, i.e. ensure there it is not shadowed.
+    // You can use invokespecial to disambiguate interface methods, but
+    // you can not use it to skip over an interface method that would shadow it.
+    ErasedShadowChecker checker(THREAD, target->name(), holder, super_class);
     checker.run(current_class);
 
     if (checker.found_shadow()) {
@@ -1061,20 +1191,143 @@
     } else {
 #ifndef PRODUCT
       if (TraceDefaultMethods) {
-        tty->print("    Returning ");
-        print_method(tty, target, true);
-        tty->print_cr("");
+        family->print_sig_on(tty, target->signature(), 1);
       }
 #endif // ndef PRODUCT
       return target;
     }
   } else {
+    assert(family->throws_exception(), "must have target or throw");
+    THROW_MSG_(vmSymbols::java_lang_AbstractMethodError(),
+               family->get_exception_message()->as_C_string(), NULL);
+  }
+}
+
+// super_class is assumed to be the direct super of current_class
+Method* find_generic_super_default( InstanceKlass* current_class,
+                                    InstanceKlass* super_class,
+                                    Symbol* method_name, Symbol* sig, TRAPS) {
+  generic::DescriptorCache cache;
+  generic::Context ctx(&cache);
+
+  // Prime the initial generic context for current -> super_class
+  ctx.apply_type_arguments(current_class, super_class, CHECK_NULL);
+
+  FindMethodsByGenericSig visitor(&cache, method_name, &ctx, CHECK_NULL);
+  visitor.run(super_class);
+
+  GrowableArray<GenericMethodFamily*> families;
+  visitor.get_discovered_families(&families);
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    print_generic_families(&families, sig);
+  }
+#endif // ndef PRODUCT
+
+  GenericMethodFamily* selected_family = NULL;
+
+  for (int i = 0; i < families.length(); ++i) {
+    GenericMethodFamily* lm = families.at(i);
+    if (lm->contains_signature(sig)) {
+      lm->determine_target(current_class, CHECK_NULL);
+      selected_family = lm;
+    }
+  }
+
+  if (selected_family->has_target()) {
+    Method* target = selected_family->get_selected_target();
+    InstanceKlass* holder = InstanceKlass::cast(target->method_holder());
+
+    // Verify that the identified method is valid from the context of
+    // the current class
+    GenericShadowChecker checker(&cache, THREAD, target->name(),
+        holder, selected_family->descriptor(), super_class);
+    checker.run(current_class);
+
+    if (checker.found_shadow()) {
+#ifndef PRODUCT
+      if (TraceDefaultMethods) {
+        tty->print_cr("    Only candidate found was shadowed.");
+      }
+#endif // ndef PRODUCT
+      THROW_MSG_(vmSymbols::java_lang_AbstractMethodError(),
+                 "Accessible default method not found", NULL);
+    } else {
+      return target;
+    }
+  } else {
     assert(selected_family->throws_exception(), "must have target or throw");
     THROW_MSG_(vmSymbols::java_lang_AbstractMethodError(),
                selected_family->get_exception_message()->as_C_string(), NULL);
   }
 }
 
+// This is called during linktime when we find an invokespecial call that
+// refers to a direct superinterface.  It indicates that we should find the
+// default method in the hierarchy of that superinterface, and if that method
+// would have been a candidate from the point of view of 'this' class, then we
+// return that method.
+// This logic assumes that the super is a direct superclass of the caller
+Method* DefaultMethods::find_super_default(
+    Klass* cls, Klass* super, Symbol* method_name, Symbol* sig, TRAPS) {
+
+  ResourceMark rm(THREAD);
+
+  assert(cls != NULL && super != NULL, "Need real classes");
+
+  InstanceKlass* current_class = InstanceKlass::cast(cls);
+  InstanceKlass* super_class = InstanceKlass::cast(super);
+
+  // Keep entire hierarchy alive for the duration of the computation
+  KeepAliveRegistrar keepAlive(THREAD);
+  KeepAliveVisitor loadKeepAlive(&keepAlive);
+  loadKeepAlive.run(current_class);   // get hierarchy from current class
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    tty->print_cr("Finding super default method %s.%s%s from %s",
+      super_class->name()->as_C_string(),
+      method_name->as_C_string(), sig->as_C_string(),
+      current_class->name()->as_C_string());
+  }
+#endif // ndef PRODUCT
+
+  assert(super_class->is_interface(), "only call for default methods");
+
+  Method* target = NULL;
+  if (ParseGenericDefaults) {
+    target = find_generic_super_default(current_class, super_class,
+                                        method_name, sig, CHECK_NULL);
+  } else {
+    target = find_erased_super_default(current_class, super_class,
+                                       method_name, sig, CHECK_NULL);
+  }
+
+#ifndef PRODUCT
+  if (target != NULL) {
+    if (TraceDefaultMethods) {
+      tty->print("    Returning ");
+      print_method(tty, target, true);
+      tty->print_cr("");
+    }
+  }
+#endif // ndef PRODUCT
+  return target;
+}
+
+#ifndef PRODUCT
+// Return true is broad type is a covariant return of narrow type
+static bool covariant_return_type(BasicType narrow, BasicType broad) {
+  if (narrow == broad) {
+    return true;
+  }
+  if (broad == T_OBJECT) {
+    return true;
+  }
+  return false;
+}
+#endif // ndef PRODUCT
 
 static int assemble_redirect(
     BytecodeConstantPool* cp, BytecodeBuffer* buffer,
@@ -1103,7 +1356,7 @@
     out.next();
   }
   assert(out.at_return_type(), "Parameter counts do not match");
-  assert(in.type() == out.type(), "Return types are not compatible");
+  assert(covariant_return_type(out.type(), in.type()), "Return types are not compatible");
 
   if (parameter_count == 1 && (in.type() == T_LONG || in.type() == T_DOUBLE)) {
     ++parameter_count; // need room for return value
@@ -1144,10 +1397,15 @@
     Symbol* sig, AccessFlags flags, int max_stack, int params,
     ConstMethod::MethodType mt, TRAPS) {
 
-  address code_start = static_cast<address>(bytecodes->adr_at(0));
-  int code_length = bytecodes->length();
+  address code_start = 0;
+  int code_length = 0;
   InlineTableSizes sizes;
 
+  if (bytecodes != NULL && bytecodes->length() > 0) {
+    code_start = static_cast<address>(bytecodes->adr_at(0));
+    code_length = bytecodes->length();
+  }
+
   Method* m = Method::allocate(cp->pool_holder()->class_loader_data(),
                                code_length, flags, &sizes,
                                mt, CHECK_NULL);
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -234,6 +234,7 @@
   static GrowableArray<Klass*>* _fixup_mirror_list;
 
   static void set_init_lock(oop java_class, oop init_lock);
+  static void set_protection_domain(oop java_class, oop protection_domain);
  public:
   static void compute_offsets();
 
@@ -272,7 +273,6 @@
 
   // Support for embedded per-class oops
   static oop  protection_domain(oop java_class);
-  static void set_protection_domain(oop java_class, oop protection_domain);
   static oop  init_lock(oop java_class);
   static objArrayOop  signers(oop java_class);
   static void set_signers(oop java_class, objArrayOop signers);
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -53,8 +53,6 @@
   template(java_lang_Object,                          "java/lang/Object")                         \
   template(java_lang_Class,                           "java/lang/Class")                          \
   template(java_lang_String,                          "java/lang/String")                         \
-  template(java_lang_StringValue,                     "java/lang/StringValue")                    \
-  template(java_lang_StringCache,                     "java/lang/StringValue$StringCache")        \
   template(java_lang_Thread,                          "java/lang/Thread")                         \
   template(java_lang_ThreadGroup,                     "java/lang/ThreadGroup")                    \
   template(java_lang_Cloneable,                       "java/lang/Cloneable")                      \
@@ -106,7 +104,6 @@
   template(java_util_Vector,                          "java/util/Vector")                         \
   template(java_util_AbstractList,                    "java/util/AbstractList")                   \
   template(java_util_Hashtable,                       "java/util/Hashtable")                      \
-  template(java_util_HashMap,                         "java/util/HashMap")                        \
   template(java_lang_Compiler,                        "java/lang/Compiler")                       \
   template(sun_misc_Signal,                           "sun/misc/Signal")                          \
   template(java_lang_AssertionStatusDirectives,       "java/lang/AssertionStatusDirectives")      \
@@ -367,8 +364,6 @@
   template(offset_name,                               "offset")                                   \
   template(count_name,                                "count")                                    \
   template(hash_name,                                 "hash")                                     \
-  template(frontCacheEnabled_name,                    "frontCacheEnabled")                        \
-  template(stringCacheEnabled_name,                   "stringCacheEnabled")                       \
   template(numberOfLeadingZeros_name,                 "numberOfLeadingZeros")                     \
   template(numberOfTrailingZeros_name,                "numberOfTrailingZeros")                    \
   template(bitCount_name,                             "bitCount")                                 \
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -2017,12 +2017,6 @@
 
 ALL_SINCE_SAVE_MARKS_CLOSURES(CFLS_OOP_SINCE_SAVE_MARKS_DEFN)
 
-
-void CompactibleFreeListSpace::object_iterate_since_last_GC(ObjectClosure* cl) {
-  // ugghh... how would one do this efficiently for a non-contiguous space?
-  guarantee(false, "NYI");
-}
-
 bool CompactibleFreeListSpace::linearAllocationWouldFail() const {
   return _smallLinearAllocBlock._word_size == 0;
 }
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -396,7 +396,6 @@
   // iteration support for promotion
   void save_marks();
   bool no_allocs_since_save_marks();
-  void object_iterate_since_last_GC(ObjectClosure* cl);
 
   // iteration support for sweeping
   void save_sweep_limit() {
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -3130,26 +3130,6 @@
 ALL_SINCE_SAVE_MARKS_CLOSURES(CMS_SINCE_SAVE_MARKS_DEFN)
 
 void
-ConcurrentMarkSweepGeneration::object_iterate_since_last_GC(ObjectClosure* blk)
-{
-  // Not currently implemented; need to do the following. -- ysr.
-  // dld -- I think that is used for some sort of allocation profiler.  So it
-  // really means the objects allocated by the mutator since the last
-  // GC.  We could potentially implement this cheaply by recording only
-  // the direct allocations in a side data structure.
-  //
-  // I think we probably ought not to be required to support these
-  // iterations at any arbitrary point; I think there ought to be some
-  // call to enable/disable allocation profiling in a generation/space,
-  // and the iterator ought to return the objects allocated in the
-  // gen/space since the enable call, or the last iterator call (which
-  // will probably be at a GC.)  That way, for gens like CM&S that would
-  // require some extra data structure to support this, we only pay the
-  // cost when it's in use...
-  cmsSpace()->object_iterate_since_last_GC(blk);
-}
-
-void
 ConcurrentMarkSweepGeneration::younger_refs_iterate(OopsInGenClosure* cl) {
   cl->set_generation(this);
   younger_refs_in_space_iterate(_cmsSpace, cl);
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1273,7 +1273,6 @@
   // Iteration support and related enquiries
   void save_marks();
   bool no_allocs_since_save_marks();
-  void object_iterate_since_last_GC(ObjectClosure* cl);
   void younger_refs_iterate(OopsInGenClosure* cl);
 
   // Iteration support specific to CMS generations
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -54,7 +54,6 @@
 #include "memory/referenceProcessor.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/oop.pcgc.inline.hpp"
-#include "runtime/aprofiler.hpp"
 #include "runtime/vmThread.hpp"
 
 size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
@@ -2665,11 +2664,6 @@
   heap_region_iterate(&blk);
 }
 
-void G1CollectedHeap::object_iterate_since_last_GC(ObjectClosure* cl) {
-  // FIXME: is this right?
-  guarantee(false, "object_iterate_since_last_GC not supported by G1 heap");
-}
-
 // Calls a SpaceClosure on a HeapRegion.
 
 class SpaceClosureRegionClosure: public HeapRegionClosure {
@@ -3598,8 +3592,6 @@
 void G1CollectedHeap::gc_prologue(bool full /* Ignored */) {
   // always_do_update_barrier = false;
   assert(InlineCacheBuffer::is_empty(), "should have cleaned up ICBuffer");
-  // Call allocation profiler
-  AllocationProfiler::iterate_since_last_gc();
   // Fill TLAB's and such
   ensure_parsability(true);
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1360,11 +1360,6 @@
     object_iterate(cl);
   }
 
-  // Iterate over all objects allocated since the last collection, calling
-  // "cl.do_object" on each.  The heap must have been initialized properly
-  // to support this function, or else this call will fail.
-  virtual void object_iterate_since_last_GC(ObjectClosure* cl);
-
   // Iterate over all spaces in use in the heap, in ascending address order.
   virtual void space_iterate(SpaceClosure* cl);
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -873,7 +873,7 @@
   size_t alloc_byte_size = alloc_word_size * HeapWordSize;
 
   if ((cur_used_bytes + alloc_byte_size) > marking_initiating_used_threshold) {
-    if (gcs_are_young()) {
+    if (gcs_are_young() && !_last_young_gc) {
       ergo_verbose5(ErgoConcCycles,
         "request concurrent cycle initiation",
         ergo_format_reason("occupancy higher than threshold")
@@ -931,7 +931,7 @@
   last_pause_included_initial_mark = during_initial_mark_pause();
   if (last_pause_included_initial_mark) {
     record_concurrent_mark_init_end(0.0);
-  } else if (!_last_young_gc && need_to_start_conc_mark("end of GC")) {
+  } else if (need_to_start_conc_mark("end of GC")) {
     // Note: this might have already been set, if during the last
     // pause we decided to start a cycle but at the beginning of
     // this pause we decided to postpone it. That's OK.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -43,7 +43,6 @@
 #include "oops/instanceRefKlass.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
-#include "runtime/aprofiler.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/synchronizer.hpp"
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -23,12 +23,14 @@
  */
 
 #include "precompiled.hpp"
+#include "gc_implementation/shared/copyFailedInfo.hpp"
 #include "gc_implementation/shared/gcHeapSummary.hpp"
 #include "gc_implementation/shared/gcTimer.hpp"
 #include "gc_implementation/shared/gcTrace.hpp"
-#include "gc_implementation/shared/copyFailedInfo.hpp"
+#include "gc_implementation/shared/objectCountEventSender.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/referenceProcessorStats.hpp"
+#include "runtime/os.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 #if INCLUDE_ALL_GCS
@@ -38,7 +40,7 @@
 #define assert_unset_gc_id() assert(_shared_gc_info.id() == SharedGCInfo::UNSET_GCID, "GC already started?")
 #define assert_set_gc_id() assert(_shared_gc_info.id() != SharedGCInfo::UNSET_GCID, "GC not started?")
 
-static jlong GCTracer_next_gc_id = 0;
+static GCId GCTracer_next_gc_id = 0;
 static GCId create_new_gc_id() {
   return GCTracer_next_gc_id++;
 }
@@ -91,26 +93,38 @@
 }
 
 #if INCLUDE_SERVICES
-void ObjectCountEventSenderClosure::do_cinfo(KlassInfoEntry* entry) {
-  if (should_send_event(entry)) {
-    send_event(entry);
-  }
-}
+class ObjectCountEventSenderClosure : public KlassInfoClosure {
+  const GCId _gc_id;
+  const double _size_threshold_percentage;
+  const size_t _total_size_in_words;
+  const jlong _timestamp;
 
-void ObjectCountEventSenderClosure::send_event(KlassInfoEntry* entry) {
-  _gc_tracer->send_object_count_after_gc_event(entry->klass(), entry->count(),
-                                               entry->words() * BytesPerWord);
-}
+ public:
+  ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words, jlong timestamp) :
+    _gc_id(gc_id),
+    _size_threshold_percentage(ObjectCountCutOffPercent / 100),
+    _total_size_in_words(total_size_in_words),
+    _timestamp(timestamp)
+  {}
 
-bool ObjectCountEventSenderClosure::should_send_event(KlassInfoEntry* entry) const {
-  double percentage_of_heap = ((double) entry->words()) / _total_size_in_words;
-  return percentage_of_heap > _size_threshold_percentage;
-}
+  virtual void do_cinfo(KlassInfoEntry* entry) {
+    if (should_send_event(entry)) {
+      ObjectCountEventSender::send(entry, _gc_id, _timestamp);
+    }
+  }
+
+ private:
+  bool should_send_event(const KlassInfoEntry* entry) const {
+    double percentage_of_heap = ((double) entry->words()) / _total_size_in_words;
+    return percentage_of_heap >= _size_threshold_percentage;
+  }
+};
 
 void GCTracer::report_object_count_after_gc(BoolObjectClosure* is_alive_cl) {
   assert_set_gc_id();
+  assert(is_alive_cl != NULL, "Must supply function to check liveness");
 
-  if (should_send_object_count_after_gc_event()) {
+  if (ObjectCountEventSender::should_send_event()) {
     ResourceMark rm;
 
     KlassInfoTable cit(false);
@@ -118,12 +132,13 @@
       HeapInspection hi(false, false, false, NULL);
       hi.populate_table(&cit, is_alive_cl);
 
-      ObjectCountEventSenderClosure event_sender(this, cit.size_of_instances_in_words());
+      jlong timestamp = os::elapsed_counter();
+      ObjectCountEventSenderClosure event_sender(_shared_gc_info.id(), cit.size_of_instances_in_words(), timestamp);
       cit.iterate(&event_sender);
     }
   }
 }
-#endif
+#endif // INCLUDE_SERVICES
 
 void GCTracer::report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary, const MetaspaceSummary& meta_space_summary) const {
   assert_set_gc_id();
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -30,7 +30,6 @@
 #include "gc_implementation/shared/gcWhen.hpp"
 #include "gc_implementation/shared/copyFailedInfo.hpp"
 #include "memory/allocation.hpp"
-#include "memory/klassInfoClosure.hpp"
 #include "memory/referenceType.hpp"
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1YCTypes.hpp"
@@ -113,7 +112,6 @@
 #endif // INCLUDE_ALL_GCS
 
 class GCTracer : public ResourceObj {
-  friend class ObjectCountEventSenderClosure;
  protected:
   SharedGCInfo _shared_gc_info;
 
@@ -123,7 +121,6 @@
   void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary, const MetaspaceSummary& meta_space_summary) const;
   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
-
   bool has_reported_gc_start() const;
 
  protected:
@@ -137,25 +134,6 @@
   void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const;
   void send_reference_stats_event(ReferenceType type, size_t count) const;
   void send_phase_events(TimePartitions* time_partitions) const;
-  void send_object_count_after_gc_event(Klass* klass, jlong count, julong total_size) const NOT_SERVICES_RETURN;
-  bool should_send_object_count_after_gc_event() const;
-};
-
-class ObjectCountEventSenderClosure : public KlassInfoClosure {
-  GCTracer* _gc_tracer;
-  const double _size_threshold_percentage;
-  const size_t _total_size_in_words;
- public:
-  ObjectCountEventSenderClosure(GCTracer* gc_tracer, size_t total_size_in_words) :
-    _gc_tracer(gc_tracer),
-    _size_threshold_percentage(ObjectCountCutOffPercent / 100),
-    _total_size_in_words(total_size_in_words)
-  {}
-  virtual void do_cinfo(KlassInfoEntry* entry);
- protected:
-  virtual void send_event(KlassInfoEntry* entry);
- private:
-  bool should_send_event(KlassInfoEntry* entry) const;
 };
 
 class YoungGCTracer : public GCTracer {
--- a/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcTraceSend.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -123,27 +123,6 @@
   }
 }
 
-#if INCLUDE_SERVICES
-void GCTracer::send_object_count_after_gc_event(Klass* klass, jlong count, julong total_size) const {
-  EventObjectCountAfterGC e;
-  if (e.should_commit()) {
-    e.set_gcId(_shared_gc_info.id());
-    e.set_class(klass);
-    e.set_count(count);
-    e.set_totalSize(total_size);
-    e.commit();
-  }
-}
-#endif
-
-bool GCTracer::should_send_object_count_after_gc_event() const {
-#if INCLUDE_TRACE
-  return Tracing::is_event_enabled(EventObjectCountAfterGC::eventId);
-#else
-  return false;
-#endif
-}
-
 #if INCLUDE_ALL_GCS
 void G1NewTracer::send_g1_young_gc_event() {
   EventGCG1GarbageCollection e(UNTIMED);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/shared/objectCountEventSender.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+
+#include "precompiled.hpp"
+#include "gc_implementation/shared/objectCountEventSender.hpp"
+#include "memory/heapInspection.hpp"
+#include "trace/tracing.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+#if INCLUDE_SERVICES
+
+void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, jlong timestamp) {
+  assert(Tracing::is_event_enabled(EventObjectCountAfterGC::eventId),
+         "Only call this method if the event is enabled");
+
+  EventObjectCountAfterGC event(UNTIMED);
+  event.set_gcId(gc_id);
+  event.set_class(entry->klass());
+  event.set_count(entry->count());
+  event.set_totalSize(entry->words() * BytesPerWord);
+  event.set_endtime(timestamp);
+  event.commit();
+}
+
+bool ObjectCountEventSender::should_send_event() {
+#if INCLUDE_TRACE
+  return Tracing::is_event_enabled(EventObjectCountAfterGC::eventId);
+#else
+  return false;
+#endif // INCLUDE_TRACE
+}
+
+#endif // INCLUDE_SERVICES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/shared/objectCountEventSender.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_OBJECT_COUNT_EVENT_SENDER_HPP
+#define SHARE_VM_OBJECT_COUNT_EVENT_SENDER_HPP
+
+#include "gc_implementation/shared/gcTrace.hpp"
+#include "memory/allocation.hpp"
+#include "utilities/macros.hpp"
+
+#if INCLUDE_SERVICES
+
+class KlassInfoEntry;
+
+class ObjectCountEventSender : public AllStatic {
+ public:
+  static void send(const KlassInfoEntry* entry, GCId gc_id, jlong timestamp);
+  static bool should_send_event();
+};
+
+#endif // INCLUDE_SERVICES
+
+#endif // SHARE_VM_OBJECT_COUNT_EVENT_SENDER
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -85,16 +85,16 @@
 
 MetaspaceSummary CollectedHeap::create_metaspace_summary() {
   const MetaspaceSizes meta_space(
-      0, /*MetaspaceAux::capacity_in_bytes(),*/
-      0, /*MetaspaceAux::used_in_bytes(),*/
+      MetaspaceAux::allocated_capacity_bytes(),
+      MetaspaceAux::allocated_used_bytes(),
       MetaspaceAux::reserved_in_bytes());
   const MetaspaceSizes data_space(
-      0, /*MetaspaceAux::capacity_in_bytes(Metaspace::NonClassType),*/
-      0, /*MetaspaceAux::used_in_bytes(Metaspace::NonClassType),*/
+      MetaspaceAux::allocated_capacity_bytes(Metaspace::NonClassType),
+      MetaspaceAux::allocated_used_bytes(Metaspace::NonClassType),
       MetaspaceAux::reserved_in_bytes(Metaspace::NonClassType));
   const MetaspaceSizes class_space(
-      0, /*MetaspaceAux::capacity_in_bytes(Metaspace::ClassType),*/
-      0, /*MetaspaceAux::used_in_bytes(Metaspace::ClassType),*/
+      MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType),
+      MetaspaceAux::allocated_used_bytes(Metaspace::ClassType),
       MetaspaceAux::reserved_in_bytes(Metaspace::ClassType));
 
   return MetaspaceSummary(meta_space, data_space, class_space);
--- a/hotspot/src/share/vm/memory/allocation.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/allocation.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -236,10 +236,11 @@
   size_t       _num_used;     // number of chunks currently checked out
   const size_t _size;         // size of each chunk (must be uniform)
 
-  // Our three static pools
+  // Our four static pools
   static ChunkPool* _large_pool;
   static ChunkPool* _medium_pool;
   static ChunkPool* _small_pool;
+  static ChunkPool* _tiny_pool;
 
   // return first element or null
   void* get_first() {
@@ -319,15 +320,18 @@
   static ChunkPool* large_pool()  { assert(_large_pool  != NULL, "must be initialized"); return _large_pool;  }
   static ChunkPool* medium_pool() { assert(_medium_pool != NULL, "must be initialized"); return _medium_pool; }
   static ChunkPool* small_pool()  { assert(_small_pool  != NULL, "must be initialized"); return _small_pool;  }
+  static ChunkPool* tiny_pool()   { assert(_tiny_pool   != NULL, "must be initialized"); return _tiny_pool;   }
 
   static void initialize() {
     _large_pool  = new ChunkPool(Chunk::size        + Chunk::aligned_overhead_size());
     _medium_pool = new ChunkPool(Chunk::medium_size + Chunk::aligned_overhead_size());
     _small_pool  = new ChunkPool(Chunk::init_size   + Chunk::aligned_overhead_size());
+    _tiny_pool   = new ChunkPool(Chunk::tiny_size   + Chunk::aligned_overhead_size());
   }
 
   static void clean() {
     enum { BlocksToKeep = 5 };
+     _tiny_pool->free_all_but(BlocksToKeep);
      _small_pool->free_all_but(BlocksToKeep);
      _medium_pool->free_all_but(BlocksToKeep);
      _large_pool->free_all_but(BlocksToKeep);
@@ -337,6 +341,7 @@
 ChunkPool* ChunkPool::_large_pool  = NULL;
 ChunkPool* ChunkPool::_medium_pool = NULL;
 ChunkPool* ChunkPool::_small_pool  = NULL;
+ChunkPool* ChunkPool::_tiny_pool   = NULL;
 
 void chunkpool_init() {
   ChunkPool::initialize();
@@ -376,6 +381,7 @@
    case Chunk::size:        return ChunkPool::large_pool()->allocate(bytes, alloc_failmode);
    case Chunk::medium_size: return ChunkPool::medium_pool()->allocate(bytes, alloc_failmode);
    case Chunk::init_size:   return ChunkPool::small_pool()->allocate(bytes, alloc_failmode);
+   case Chunk::tiny_size:   return ChunkPool::tiny_pool()->allocate(bytes, alloc_failmode);
    default: {
      void* p = os::malloc(bytes, mtChunk, CALLER_PC);
      if (p == NULL && alloc_failmode == AllocFailStrategy::EXIT_OOM) {
@@ -392,6 +398,7 @@
    case Chunk::size:        ChunkPool::large_pool()->free(c); break;
    case Chunk::medium_size: ChunkPool::medium_pool()->free(c); break;
    case Chunk::init_size:   ChunkPool::small_pool()->free(c); break;
+   case Chunk::tiny_size:   ChunkPool::tiny_pool()->free(c); break;
    default:                 os::free(c, mtChunk);
   }
 }
--- a/hotspot/src/share/vm/memory/allocation.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/allocation.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -353,7 +353,8 @@
     slack      = 20,            // suspected sizeof(Chunk) + internal malloc headers
 #endif
 
-    init_size  =  1*K  - slack, // Size of first chunk
+    tiny_size  =  256  - slack, // Size of first chunk (tiny)
+    init_size  =  1*K  - slack, // Size of first chunk (normal aka small)
     medium_size= 10*K  - slack, // Size of medium-sized chunk
     size       = 32*K  - slack, // Default size of an Arena chunk (following the first)
     non_pool_size = init_size + 32 // An initial size which is not one of above
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -450,11 +450,6 @@
   }
 }
 
-void DefNewGeneration::object_iterate_since_last_GC(ObjectClosure* cl) {
-  // $$$ This may be wrong in case of "scavenge failure"?
-  eden()->object_iterate(cl);
-}
-
 void DefNewGeneration::younger_refs_iterate(OopsInGenClosure* cl) {
   assert(false, "NYI -- are you sure you want to call this?");
 }
--- a/hotspot/src/share/vm/memory/defNewGeneration.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/defNewGeneration.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -252,7 +252,6 @@
 
   // Iteration
   void object_iterate(ObjectClosure* blk);
-  void object_iterate_since_last_GC(ObjectClosure* cl);
 
   void younger_refs_iterate(OopsInGenClosure* cl);
 
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -42,7 +42,6 @@
 #include "memory/space.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/oop.inline2.hpp"
-#include "runtime/aprofiler.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.hpp"
@@ -873,12 +872,6 @@
   }
 }
 
-void GenCollectedHeap::object_iterate_since_last_GC(ObjectClosure* cl) {
-  for (int i = 0; i < _n_gens; i++) {
-    _gens[i]->object_iterate_since_last_GC(cl);
-  }
-}
-
 Space* GenCollectedHeap::space_containing(const void* addr) const {
   for (int i = 0; i < _n_gens; i++) {
     Space* res = _gens[i]->space_containing(addr);
@@ -1186,8 +1179,6 @@
   CollectedHeap::accumulate_statistics_all_tlabs();
   ensure_parsability(true);   // retire TLABs
 
-  // Call allocation profiler
-  AllocationProfiler::iterate_since_last_gc();
   // Walk generations
   GenGCPrologueClosure blk(full);
   generation_iterate(&blk, false);  // not old-to-young.
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -222,7 +222,6 @@
   void oop_iterate(MemRegion mr, ExtendedOopClosure* cl);
   void object_iterate(ObjectClosure* cl);
   void safe_object_iterate(ObjectClosure* cl);
-  void object_iterate_since_last_GC(ObjectClosure* cl);
   Space* space_containing(const void* addr) const;
 
   // A CollectedHeap is divided into a dense sequence of "blocks"; that is,
--- a/hotspot/src/share/vm/memory/generation.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/generation.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -811,16 +811,6 @@
   blk->do_space(_the_space);
 }
 
-void OneContigSpaceCardGeneration::object_iterate_since_last_GC(ObjectClosure* blk) {
-  // Deal with delayed initialization of _the_space,
-  // and lack of initialization of _last_gc.
-  if (_last_gc.space() == NULL) {
-    assert(the_space() != NULL, "shouldn't be NULL");
-    _last_gc = the_space()->bottom_mark();
-  }
-  the_space()->object_iterate_from(_last_gc, blk);
-}
-
 void OneContigSpaceCardGeneration::younger_refs_iterate(OopsInGenClosure* blk) {
   blk->set_generation(this);
   younger_refs_in_space_iterate(_the_space, blk);
--- a/hotspot/src/share/vm/memory/generation.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/generation.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -551,12 +551,6 @@
   // the heap.  This defaults to object_iterate() unless overridden.
   virtual void safe_object_iterate(ObjectClosure* cl);
 
-  // Iterate over all objects allocated in the generation since the last
-  // collection, calling "cl.do_object" on each.  The generation must have
-  // been initialized properly to support this function, or else this call
-  // will fail.
-  virtual void object_iterate_since_last_GC(ObjectClosure* cl) = 0;
-
   // Apply "cl->do_oop" to (the address of) all and only all the ref fields
   // in the current generation that contain pointers to objects in younger
   // generations. Objects allocated since the last "save_marks" call are
@@ -724,7 +718,6 @@
   // Iteration
   void object_iterate(ObjectClosure* blk);
   void space_iterate(SpaceClosure* blk, bool usedOnly = false);
-  void object_iterate_since_last_GC(ObjectClosure* cl);
 
   void younger_refs_iterate(OopsInGenClosure* blk);
 
--- a/hotspot/src/share/vm/memory/heapInspection.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/heapInspection.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -26,7 +26,6 @@
 #define SHARE_VM_MEMORY_HEAPINSPECTION_HPP
 
 #include "memory/allocation.inline.hpp"
-#include "memory/klassInfoClosure.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/annotations.hpp"
 #include "utilities/macros.hpp"
@@ -204,6 +203,12 @@
   const char* name() const;
 };
 
+class KlassInfoClosure : public StackObj {
+ public:
+  // Called for each KlassInfoEntry.
+  virtual void do_cinfo(KlassInfoEntry* cie) = 0;
+};
+
 class KlassInfoBucket: public CHeapObj<mtInternal> {
  private:
   KlassInfoEntry* _list;
--- a/hotspot/src/share/vm/memory/klassInfoClosure.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_MEMORY_KLASSINFOCLOSURE_HPP
-#define SHARE_VM_MEMORY_KLASSINFOCLOSURE_HPP
-
-class KlassInfoEntry;
-
-class KlassInfoClosure : public StackObj {
- public:
-  // Called for each KlassInfoEntry.
-  virtual void do_cinfo(KlassInfoEntry* cie) = 0;
-};
-
-#endif // SHARE_VM_MEMORY_KLASSINFOCLOSURE_HPP
--- a/hotspot/src/share/vm/memory/resourceArea.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/resourceArea.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,6 +83,10 @@
   Chunk *_chunk;                // saved arena chunk
   char *_hwm, *_max;
   size_t _size_in_bytes;
+#ifdef ASSERT
+  Thread* _thread;
+  ResourceMark* _previous_resource_mark;
+#endif //ASSERT
 
   void initialize(Thread *thread) {
     _area = thread->resource_area();
@@ -92,6 +96,11 @@
     _size_in_bytes = _area->size_in_bytes();
     debug_only(_area->_nesting++;)
     assert( _area->_nesting > 0, "must stack allocate RMs" );
+#ifdef ASSERT
+    _thread = thread;
+    _previous_resource_mark = thread->current_resource_mark();
+    thread->set_current_resource_mark(this);
+#endif // ASSERT
   }
  public:
 
@@ -111,6 +120,17 @@
     _size_in_bytes = r->_size_in_bytes;
     debug_only(_area->_nesting++;)
     assert( _area->_nesting > 0, "must stack allocate RMs" );
+#ifdef ASSERT
+    Thread* thread = ThreadLocalStorage::thread();
+    if (thread != NULL) {
+      _thread = thread;
+      _previous_resource_mark = thread->current_resource_mark();
+      thread->set_current_resource_mark(this);
+    } else {
+      _thread = NULL;
+      _previous_resource_mark = NULL;
+    }
+#endif // ASSERT
   }
 
   void reset_to_mark() {
@@ -137,6 +157,11 @@
     assert( _area->_nesting > 0, "must stack allocate RMs" );
     debug_only(_area->_nesting--;)
     reset_to_mark();
+#ifdef ASSERT
+    if (_thread != NULL) {
+      _thread->set_current_resource_mark(_previous_resource_mark);
+    }
+#endif // ASSERT
   }
 
 
--- a/hotspot/src/share/vm/memory/sharedHeap.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/sharedHeap.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -166,11 +166,6 @@
   // Same as above, restricted to a memory region.
   virtual void oop_iterate(MemRegion mr, ExtendedOopClosure* cl) = 0;
 
-  // Iterate over all objects allocated since the last collection, calling
-  // "cl->do_object" on each.  The heap must have been initialized properly
-  // to support this function, or else this call will fail.
-  virtual void object_iterate_since_last_GC(ObjectClosure* cl) = 0;
-
   // Iterate over all spaces in use in the heap, in an undefined order.
   virtual void space_iterate(SpaceClosure* cl) = 0;
 
--- a/hotspot/src/share/vm/memory/universe.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/memory/universe.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -52,7 +52,6 @@
 #include "oops/oop.inline.hpp"
 #include "oops/typeArrayKlass.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
-#include "runtime/aprofiler.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
--- a/hotspot/src/share/vm/oops/arrayKlass.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/arrayKlass.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -71,7 +71,6 @@
 }
 
 ArrayKlass::ArrayKlass(Symbol* name) {
-  set_alloc_size(0);
   set_name(name);
 
   set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
@@ -161,12 +160,6 @@
   }
 }
 
-
-void ArrayKlass::with_array_klasses_do(void f(Klass* k)) {
-  array_klasses_do(f);
-}
-
-
 // GC support
 
 void ArrayKlass::oops_do(OopClosure* cl) {
--- a/hotspot/src/share/vm/oops/arrayKlass.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/arrayKlass.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -39,7 +39,6 @@
   Klass* volatile _higher_dimension;  // Refers the (n+1)'th-dimensional array (if present).
   Klass* volatile _lower_dimension;   // Refers the (n-1)'th-dimensional array (if present).
   int      _vtable_len;        // size of vtable for this klass
-  juint    _alloc_size;        // allocation profiling support
   oop      _component_mirror;  // component type, as a java/lang/Class
 
  protected:
@@ -65,10 +64,6 @@
   void set_lower_dimension(Klass* k)  { _lower_dimension = k; }
   Klass** adr_lower_dimension()       { return (Klass**)&this->_lower_dimension;}
 
-  // Allocation profiling support
-  juint alloc_size() const              { return _alloc_size; }
-  void set_alloc_size(juint n)          { _alloc_size = n; }
-
   // offset of first element, including any padding for the sake of alignment
   int  array_header_in_bytes() const    { return layout_helper_header_size(layout_helper()); }
   int  log2_element_size() const        { return layout_helper_log2_element_size(layout_helper()); }
@@ -126,7 +121,6 @@
   // Iterators
   void array_klasses_do(void f(Klass* k));
   void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
-  void with_array_klasses_do(void f(Klass* k));
 
   // GC support
   virtual void oops_do(OopClosure* cl);
--- a/hotspot/src/share/vm/oops/cpCache.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/cpCache.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -140,8 +140,15 @@
     _f1 = f1;
   }
   void release_set_f1(Metadata* f1);
-  void set_f2(intx f2)                           { assert(_f2 == 0 || _f2 == f2,            "illegal field change"); _f2 = f2; }
-  void set_f2_as_vfinal_method(Method* f2)     { assert(_f2 == 0 || _f2 == (intptr_t) f2, "illegal field change"); assert(is_vfinal(), "flags must be set"); _f2 = (intptr_t) f2; }
+  void set_f2(intx f2) {
+    intx existing_f2 = _f2; // read once
+    assert(existing_f2 == 0 || existing_f2 == f2, "illegal field change");
+    _f2 = f2;
+  }
+  void set_f2_as_vfinal_method(Method* f2) {
+    assert(is_vfinal(), "flags must be set");
+    set_f2((intx)f2);
+  }
   int make_flags(TosState state, int option_bits, int field_index_or_method_params);
   void set_flags(intx flags)                     { _flags = flags; }
   bool init_flags_atomic(intx flags);
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -48,6 +48,7 @@
 #include "oops/symbol.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiRedefineClassesTrace.hpp"
+#include "prims/jvmtiRedefineClasses.hpp"
 #include "prims/methodComparator.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/handles.inline.hpp"
@@ -291,7 +292,7 @@
   set_initial_method_idnum(0);
   _dependencies = NULL;
   set_jvmti_cached_class_field_map(NULL);
-  set_cached_class_file(NULL, 0);
+  set_cached_class_file(NULL);
   set_initial_method_idnum(0);
   set_minor_version(0);
   set_major_version(0);
@@ -1321,12 +1322,6 @@
     ArrayKlass::cast(array_klasses())->array_klasses_do(f);
 }
 
-
-void InstanceKlass::with_array_klasses_do(void f(Klass* k)) {
-  f(this);
-  array_klasses_do(f);
-}
-
 #ifdef ASSERT
 static int linear_search(Array<Method*>* methods, Symbol* name, Symbol* signature) {
   int len = methods->length();
@@ -2363,10 +2358,9 @@
   }
 
   // deallocate the cached class file
-  if (_cached_class_file_bytes != NULL) {
-    os::free(_cached_class_file_bytes, mtClass);
-    _cached_class_file_bytes = NULL;
-    _cached_class_file_len = 0;
+  if (_cached_class_file != NULL) {
+    os::free(_cached_class_file, mtClass);
+    _cached_class_file = NULL;
   }
 
   // Decrement symbol reference counts associated with the unloaded class.
@@ -3536,6 +3530,14 @@
   return m;
 }
 
+jint InstanceKlass::get_cached_class_file_len() {
+  return VM_RedefineClasses::get_cached_class_file_len(_cached_class_file);
+}
+
+unsigned char * InstanceKlass::get_cached_class_file_bytes() {
+  return VM_RedefineClasses::get_cached_class_file_bytes(_cached_class_file);
+}
+
 
 // Construct a PreviousVersionNode entry for the array hung off
 // the InstanceKlass.
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -133,6 +133,8 @@
   uint _count;
 };
 
+struct JvmtiCachedClassFileData;
+
 class InstanceKlass: public Klass {
   friend class VMStructs;
   friend class ClassFileParser;
@@ -249,8 +251,8 @@
   // InstanceKlass. See PreviousVersionWalker below.
   GrowableArray<PreviousVersionNode *>* _previous_versions;
   // JVMTI fields can be moved to their own structure - see 6315920
-  unsigned char * _cached_class_file_bytes;       // JVMTI: cached class file, before retransformable agent modified it in CFLH
-  jint            _cached_class_file_len;         // JVMTI: length of above
+  // JVMTI: cached class file, before retransformable agent modified it in CFLH
+  JvmtiCachedClassFileData* _cached_class_file;
 
   volatile u2     _idnum_allocated_count;         // JNI/JVMTI: increments with the addition of methods, old ids don't change
 
@@ -615,11 +617,12 @@
   static void purge_previous_versions(InstanceKlass* ik);
 
   // JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
-  void set_cached_class_file(unsigned char *class_file_bytes,
-                             jint class_file_len)     { _cached_class_file_len = class_file_len;
-                                                        _cached_class_file_bytes = class_file_bytes; }
-  jint get_cached_class_file_len()                    { return _cached_class_file_len; }
-  unsigned char * get_cached_class_file_bytes()       { return _cached_class_file_bytes; }
+  void set_cached_class_file(JvmtiCachedClassFileData *data) {
+    _cached_class_file = data;
+  }
+  JvmtiCachedClassFileData * get_cached_class_file() { return _cached_class_file; }
+  jint get_cached_class_file_len();
+  unsigned char * get_cached_class_file_bytes();
 
   // JVMTI: Support for caching of field indices, types, and offsets
   void set_jvmti_cached_class_field_map(JvmtiCachedClassFieldMap* descriptor) {
@@ -794,7 +797,6 @@
   void methods_do(void f(Method* method));
   void array_klasses_do(void f(Klass* k));
   void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
-  void with_array_klasses_do(void f(Klass* k));
   bool super_types_do(SuperTypeClosure* blk);
 
   // Casting from Klass*
@@ -874,10 +876,6 @@
     }
   }
 
-  // Allocation profiling support
-  juint alloc_size() const            { return _alloc_count * size_helper(); }
-  void set_alloc_size(juint n)        {}
-
   // Use this to return the size of an instance in heap words:
   int size_helper() const {
     return layout_helper_to_size_helper(layout_helper());
--- a/hotspot/src/share/vm/oops/klass.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/klass.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -168,7 +168,6 @@
   set_subklass(NULL);
   set_next_sibling(NULL);
   set_next_link(NULL);
-  set_alloc_count(0);
   TRACE_INIT_ID(this);
 
   set_prototype_header(markOopDesc::prototype());
@@ -543,12 +542,6 @@
   return NULL;
 }
 
-
-void Klass::with_array_klasses_do(void f(Klass* k)) {
-  f(this);
-}
-
-
 oop Klass::class_loader() const { return class_loader_data()->class_loader(); }
 
 const char* Klass::external_name() const {
--- a/hotspot/src/share/vm/oops/klass.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/klass.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -79,7 +79,6 @@
 //    [last_biased_lock_bulk_revocation_time] (64 bits)
 //    [prototype_header]
 //    [biased_lock_revocation_count]
-//    [alloc_count   ]
 //    [_modified_oops]
 //    [_accumulated_modified_oops]
 //    [trace_id]
@@ -171,8 +170,6 @@
   markOop  _prototype_header;   // Used when biased locking is both enabled and disabled for this type
   jint     _biased_lock_revocation_count;
 
-  juint    _alloc_count;        // allocation profiling support
-
   TRACE_DEFINE_KLASS_TRACE_ID;
 
   // Remembered sets support for the oops in the klasses.
@@ -290,11 +287,6 @@
   void     set_next_sibling(Klass* s);
 
  public:
-  // Allocation profiling support
-  juint alloc_count() const          { return _alloc_count; }
-  void set_alloc_count(juint n)      { _alloc_count = n; }
-  virtual juint alloc_size() const = 0;
-  virtual void set_alloc_size(juint n) = 0;
 
   // Compiler support
   static ByteSize super_offset()                 { return in_ByteSize(offset_of(Klass, _super)); }
@@ -677,7 +669,6 @@
 #endif // INCLUDE_ALL_GCS
 
   virtual void array_klasses_do(void f(Klass* k)) {}
-  virtual void with_array_klasses_do(void f(Klass* k));
 
   // Return self, except for abstract classes with exactly 1
   // implementor.  Then return the 1 concrete implementation.
--- a/hotspot/src/share/vm/oops/method.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/oops/method.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1163,6 +1163,7 @@
   newm->constMethod()->set_constMethod_size(new_const_method_size);
   newm->set_method_size(new_method_size);
   assert(newm->code_size() == new_code_length, "check");
+  assert(newm->method_parameters_length() == method_parameters_len, "check");
   assert(newm->checked_exceptions_length() == checked_exceptions_len, "check");
   assert(newm->exception_table_length() == exception_table_len, "check");
   assert(newm->localvariable_table_length() == localvariable_len, "check");
@@ -1174,6 +1175,12 @@
            new_compressed_linenumber_table,
            new_compressed_linenumber_size);
   }
+  // Copy method_parameters
+  if (method_parameters_len > 0) {
+    memcpy(newm->method_parameters_start(),
+           m->method_parameters_start(),
+           method_parameters_len * sizeof(MethodParametersElement));
+  }
   // Copy checked_exceptions
   if (checked_exceptions_len > 0) {
     memcpy(newm->checked_exceptions_start(),
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -297,15 +297,6 @@
     }
   }
 
-  if (UseStringCache) {
-    // Do not inline StringCache::profile() method used only at the beginning.
-    if (callee_method->name() == ciSymbol::profile_name() &&
-        callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
-      set_msg("profiling method");
-      return true;
-    }
-  }
-
   // use frequency-based objections only for non-trivial methods
   if (callee_method->code_size() <= MaxTrivialSize) {
     return false;
--- a/hotspot/src/share/vm/opto/matcher.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -2305,26 +2305,26 @@
 // atomic instruction acting as a store_load barrier without any
 // intervening volatile load, and thus we don't need a barrier here.
 // We retain the Node to act as a compiler ordering barrier.
-bool Matcher::post_store_load_barrier(const Node *vmb) {
-  Compile *C = Compile::current();
-  assert( vmb->is_MemBar(), "" );
-  assert( vmb->Opcode() != Op_MemBarAcquire, "" );
-  const MemBarNode *mem = (const MemBarNode*)vmb;
+bool Matcher::post_store_load_barrier(const Node* vmb) {
+  Compile* C = Compile::current();
+  assert(vmb->is_MemBar(), "");
+  assert(vmb->Opcode() != Op_MemBarAcquire, "");
+  const MemBarNode* membar = vmb->as_MemBar();
 
-  // Get the Proj node, ctrl, that can be used to iterate forward
-  Node *ctrl = NULL;
-  DUIterator_Fast imax, i = mem->fast_outs(imax);
-  while( true ) {
-    ctrl = mem->fast_out(i);            // Throw out-of-bounds if proj not found
-    assert( ctrl->is_Proj(), "only projections here" );
-    ProjNode *proj = (ProjNode*)ctrl;
-    if( proj->_con == TypeFunc::Control &&
-        !C->node_arena()->contains(ctrl) ) // Unmatched old-space only
+  // Get the Ideal Proj node, ctrl, that can be used to iterate forward
+  Node* ctrl = NULL;
+  for (DUIterator_Fast imax, i = membar->fast_outs(imax); i < imax; i++) {
+    Node* p = membar->fast_out(i);
+    assert(p->is_Proj(), "only projections here");
+    if ((p->as_Proj()->_con == TypeFunc::Control) &&
+        !C->node_arena()->contains(p)) { // Unmatched old-space only
+      ctrl = p;
       break;
-    i++;
+    }
   }
+  assert((ctrl != NULL), "missing control projection");
 
-  for( DUIterator_Fast jmax, j = ctrl->fast_outs(jmax); j < jmax; j++ ) {
+  for (DUIterator_Fast jmax, j = ctrl->fast_outs(jmax); j < jmax; j++) {
     Node *x = ctrl->fast_out(j);
     int xop = x->Opcode();
 
@@ -2336,37 +2336,36 @@
     // that a monitor exit operation contains a serializing instruction.
 
     if (xop == Op_MemBarVolatile ||
-        xop == Op_FastLock ||
         xop == Op_CompareAndSwapL ||
         xop == Op_CompareAndSwapP ||
         xop == Op_CompareAndSwapN ||
-        xop == Op_CompareAndSwapI)
+        xop == Op_CompareAndSwapI) {
       return true;
+    }
+
+    // Op_FastLock previously appeared in the Op_* list above.
+    // With biased locking we're no longer guaranteed that a monitor
+    // enter operation contains a serializing instruction.
+    if ((xop == Op_FastLock) && !UseBiasedLocking) {
+      return true;
+    }
 
     if (x->is_MemBar()) {
       // We must retain this membar if there is an upcoming volatile
-      // load, which will be preceded by acquire membar.
-      if (xop == Op_MemBarAcquire)
+      // load, which will be followed by acquire membar.
+      if (xop == Op_MemBarAcquire) {
         return false;
-      // For other kinds of barriers, check by pretending we
-      // are them, and seeing if we can be removed.
-      else
-        return post_store_load_barrier((const MemBarNode*)x);
+      } else {
+        // For other kinds of barriers, check by pretending we
+        // are them, and seeing if we can be removed.
+        return post_store_load_barrier(x->as_MemBar());
+      }
     }
 
-    // Delicate code to detect case of an upcoming fastlock block
-    if( x->is_If() && x->req() > 1 &&
-        !C->node_arena()->contains(x) ) { // Unmatched old-space only
-      Node *iff = x;
-      Node *bol = iff->in(1);
-      // The iff might be some random subclass of If or bol might be Con-Top
-      if (!bol->is_Bool())  return false;
-      assert( bol->req() > 1, "" );
-      return (bol->in(1)->Opcode() == Op_FastUnlock);
+    // probably not necessary to check for these
+    if (x->is_Call() || x->is_SafePoint() || x->is_block_proj()) {
+      return false;
     }
-    // probably not necessary to check for these
-    if (x->is_Call() || x->is_SafePoint() || x->is_block_proj())
-      return false;
   }
   return false;
 }
--- a/hotspot/src/share/vm/opto/parse3.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/opto/parse3.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -294,25 +294,7 @@
   // If reference is volatile, prevent following volatiles ops from
   // floating up before the volatile write.
   if (is_vol) {
-    // First place the specific membar for THIS volatile index. This first
-    // membar is dependent on the store, keeping any other membars generated
-    // below from floating up past the store.
-    int adr_idx = C->get_alias_index(adr_type);
-    insert_mem_bar_volatile(Op_MemBarVolatile, adr_idx, store);
-
-    // Now place a membar for AliasIdxBot for the unknown yet-to-be-parsed
-    // volatile alias indices. Skip this if the membar is redundant.
-    if (adr_idx != Compile::AliasIdxBot) {
-      insert_mem_bar_volatile(Op_MemBarVolatile, Compile::AliasIdxBot, store);
-    }
-
-    // Finally, place alias-index-specific membars for each volatile index
-    // that isn't the adr_idx membar. Typically there's only 1 or 2.
-    for( int i = Compile::AliasIdxRaw; i < C->num_alias_types(); i++ ) {
-      if (i != adr_idx && C->alias_type(i)->is_volatile()) {
-        insert_mem_bar_volatile(Op_MemBarVolatile, i, store);
-      }
-    }
+    insert_mem_bar(Op_MemBarVolatile); // Use fat membar
   }
 
   // If the field is final, the rules of Java say we are in <init> or <clinit>.
--- a/hotspot/src/share/vm/prims/forte.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/forte.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -31,6 +31,7 @@
 #include "oops/oop.inline.hpp"
 #include "oops/oop.inline2.hpp"
 #include "prims/forte.hpp"
+#include "runtime/javaCalls.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/vframe.hpp"
 #include "runtime/vframeArray.hpp"
@@ -308,10 +309,14 @@
 
   for (loop_count = 0; loop_count < loop_max; loop_count++) {
 
-    if (candidate.is_first_frame()) {
+    if (candidate.is_entry_frame()) {
+      // jcw is NULL if the java call wrapper couldn't be found
+      JavaCallWrapper *jcw = candidate.entry_frame_call_wrapper_if_safe(thread);
       // If initial frame is frame from StubGenerator and there is no
       // previous anchor, there are no java frames associated with a method
-      return false;
+      if (jcw == NULL || jcw->is_first_frame()) {
+        return false;
+      }
     }
 
     if (candidate.is_interpreted_frame()) {
--- a/hotspot/src/share/vm/prims/jni.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jni.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -5097,7 +5097,7 @@
   // function used to determine this will always return false. Atomic::xchg
   // does not have this problem.
   if (Atomic::xchg(1, &vm_created) == 1) {
-    return JNI_ERR;   // already created, or create attempt in progress
+    return JNI_EEXIST;   // already created, or create attempt in progress
   }
   if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) {
     return JNI_ERR;  // someone tried and failed and retry not allowed.
@@ -5138,9 +5138,21 @@
       event.commit();
     }
 
+#ifndef PRODUCT
+  #ifndef TARGET_OS_FAMILY_windows
+    #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) f()
+  #endif
+
     // Check if we should compile all classes on bootclasspath
-    NOT_PRODUCT(if (CompileTheWorld) ClassLoader::compile_the_world();)
-    NOT_PRODUCT(if (ReplayCompiles) ciReplay::replay(thread);)
+    if (CompileTheWorld) ClassLoader::compile_the_world();
+    if (ReplayCompiles) ciReplay::replay(thread);
+
+    // Some platforms (like Win*) need a wrapper around these test
+    // functions in order to properly handle error conditions.
+    CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(test_error_handler);
+    CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(execute_internal_vm_tests);
+#endif
+
     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
     ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
   } else {
@@ -5157,8 +5169,6 @@
     OrderAccess::release_store(&vm_created, 0);
   }
 
-  NOT_PRODUCT(test_error_handler(ErrorHandlerTest));
-  NOT_PRODUCT(execute_internal_vm_tests());
   return result;
 }
 
--- a/hotspot/src/share/vm/prims/jniCheck.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -126,6 +126,7 @@
 static const char * fatal_non_weak_method = "non-weak methodID passed to JNI call";
 static const char * fatal_unknown_array_object = "Unknown array object passed to JNI array operations";
 static const char * fatal_object_array_expected = "Object array expected but not received for JNI array operation";
+static const char * fatal_prim_type_array_expected = "Primitive type array expected but not received for JNI array operation";
 static const char * fatal_non_array  = "Non-array passed to JNI array operations";
 static const char * fatal_element_type_mismatch = "Array element type mismatch in JNI";
 static const char * fatal_should_be_static = "Non-static field ID passed to JNI";
@@ -278,30 +279,49 @@
     ReportJNIFatalError(thr, fatal_non_string);
 }
 
-static inline void
-checkArray(JavaThread* thr, jarray jArray, int elementType)
+static inline arrayOop
+check_is_array(JavaThread* thr, jarray jArray)
 {
   ASSERT_OOPS_ALLOWED;
   arrayOop aOop;
 
   aOop = (arrayOop)jniCheck::validate_object(thr, jArray);
-  if (aOop == NULL || !aOop->is_array())
+  if (aOop == NULL || !aOop->is_array()) {
     ReportJNIFatalError(thr, fatal_non_array);
+  }
+  return aOop;
+}
+
+static inline arrayOop
+check_is_primitive_array(JavaThread* thr, jarray jArray) {
+  arrayOop aOop = check_is_array(thr, jArray);
 
-  if (elementType != -1) {
-    if (aOop->is_typeArray()) {
-      BasicType array_type = TypeArrayKlass::cast(aOop->klass())->element_type();
-      if (array_type != elementType)
-        ReportJNIFatalError(thr, fatal_element_type_mismatch);
-      } else if (aOop->is_objArray()) {
-        if ( T_OBJECT != elementType)
-          ReportJNIFatalError(thr, fatal_object_array_expected);
-      } else {
-        ReportJNIFatalError(thr, fatal_unknown_array_object);
-    }
+  if (!aOop->is_typeArray()) {
+     ReportJNIFatalError(thr, fatal_prim_type_array_expected);
+  }
+  return aOop;
+}
+
+static inline void
+check_primitive_array_type(JavaThread* thr, jarray jArray, BasicType elementType)
+{
+  BasicType array_type;
+  arrayOop aOop;
+
+  aOop = check_is_primitive_array(thr, jArray);
+  array_type = TypeArrayKlass::cast(aOop->klass())->element_type();
+  if (array_type != elementType) {
+    ReportJNIFatalError(thr, fatal_element_type_mismatch);
   }
 }
 
+static inline void
+check_is_obj_array(JavaThread* thr, jarray jArray) {
+  arrayOop aOop = check_is_array(thr, jArray);
+  if (!aOop->is_objArray()) {
+    ReportJNIFatalError(thr, fatal_object_array_expected);
+  }
+}
 
 oop jniCheck::validate_handle(JavaThread* thr, jobject obj) {
   if (JNIHandles::is_frame_handle(thr, obj) ||
@@ -1417,7 +1437,7 @@
                              jarray array))
     functionEnter(thr);
     IN_VM(
-      checkArray(thr, array, -1);
+      check_is_array(thr, array);
     )
     jsize result = UNCHECKED()->GetArrayLength(env,array);
     functionExit(env);
@@ -1441,7 +1461,7 @@
                                     jsize index))
     functionEnter(thr);
     IN_VM(
-      checkArray(thr, array, T_OBJECT);
+      check_is_obj_array(thr, array);
     )
     jobject result = UNCHECKED()->GetObjectArrayElement(env,array,index);
     functionExit(env);
@@ -1455,7 +1475,7 @@
                                     jobject val))
     functionEnter(thr);
     IN_VM(
-      checkArray(thr, array, T_OBJECT);
+      check_is_obj_array(thr, array);
     )
     UNCHECKED()->SetObjectArrayElement(env,array,index,val);
     functionExit(env);
@@ -1487,7 +1507,7 @@
                                          jboolean *isCopy)) \
     functionEnter(thr); \
     IN_VM( \
-      checkArray(thr, array, ElementTag); \
+      check_primitive_array_type(thr, array, ElementTag); \
     ) \
     ElementType *result = UNCHECKED()->Get##Result##ArrayElements(env, \
                                                                   array, \
@@ -1513,7 +1533,7 @@
                                              jint mode)) \
     functionEnterExceptionAllowed(thr); \
     IN_VM( \
-      checkArray(thr, array, ElementTag); \
+      check_primitive_array_type(thr, array, ElementTag); \
       ASSERT_OOPS_ALLOWED; \
       typeArrayOop a = typeArrayOop(JNIHandles::resolve_non_null(array)); \
       /* cannot check validity of copy, unless every request is logged by
@@ -1543,7 +1563,7 @@
                                        ElementType *buf)) \
     functionEnter(thr); \
     IN_VM( \
-      checkArray(thr, array, ElementTag); \
+      check_primitive_array_type(thr, array, ElementTag); \
     ) \
     UNCHECKED()->Get##Result##ArrayRegion(env,array,start,len,buf); \
     functionExit(env); \
@@ -1567,7 +1587,7 @@
                                        const ElementType *buf)) \
     functionEnter(thr); \
     IN_VM( \
-      checkArray(thr, array, ElementTag); \
+      check_primitive_array_type(thr, array, ElementTag); \
     ) \
     UNCHECKED()->Set##Result##ArrayRegion(env,array,start,len,buf); \
     functionExit(env); \
@@ -1669,7 +1689,7 @@
                                         jboolean *isCopy))
     functionEnterCritical(thr);
     IN_VM(
-      checkArray(thr, array, -1);
+      check_is_primitive_array(thr, array);
     )
     void *result = UNCHECKED()->GetPrimitiveArrayCritical(env, array, isCopy);
     functionExit(env);
@@ -1683,7 +1703,7 @@
                                             jint mode))
     functionEnterCriticalExceptionAllowed(thr);
     IN_VM(
-      checkArray(thr, array, -1);
+      check_is_primitive_array(thr, array);
     )
     /* The Hotspot JNI code does not use the parameters, so just check the
      * array parameter as a minor sanity check
--- a/hotspot/src/share/vm/prims/jvm.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1121,26 +1121,6 @@
 JVM_END
 
 
-// Obsolete since 1.2 (Class.setProtectionDomain removed), although
-// still defined in core libraries as of 1.5.
-JVM_ENTRY(void, JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain))
-  JVMWrapper("JVM_SetProtectionDomain");
-  if (JNIHandles::resolve(cls) == NULL) {
-    THROW(vmSymbols::java_lang_NullPointerException());
-  }
-  if (!java_lang_Class::is_primitive(JNIHandles::resolve(cls))) {
-    // Call is ignored for primitive types
-    Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls));
-
-    // cls won't be an array, as this called only from ClassLoader.defineClass
-    if (k->oop_is_instance()) {
-      oop pd = JNIHandles::resolve(protection_domain);
-      assert(pd == NULL || pd->is_oop(), "just checking");
-      java_lang_Class::set_protection_domain(k->java_mirror(), pd);
-    }
-  }
-JVM_END
-
 static bool is_authorized(Handle context, instanceKlassHandle klass, TRAPS) {
   // If there is a security manager and protection domain, check the access
   // in the protection domain, otherwise it is authorized.
--- a/hotspot/src/share/vm/prims/jvm.h	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jvm.h	Fri Jul 26 14:07:32 2013 -0700
@@ -471,9 +471,6 @@
 JNIEXPORT jobject JNICALL
 JVM_GetProtectionDomain(JNIEnv *env, jclass cls);
 
-JNIEXPORT void JNICALL
-JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain);
-
 JNIEXPORT jboolean JNICALL
 JVM_IsArrayClass(JNIEnv *env, jclass cls);
 
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -41,6 +41,7 @@
 #include "prims/jvmtiRawMonitor.hpp"
 #include "prims/jvmtiTagMap.hpp"
 #include "prims/jvmtiThreadState.inline.hpp"
+#include "prims/jvmtiRedefineClasses.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/interfaceSupport.hpp"
@@ -516,8 +517,7 @@
   jint                 _curr_len;
   unsigned char *      _curr_data;
   JvmtiEnv *           _curr_env;
-  jint *               _cached_length_ptr;
-  unsigned char **     _cached_data_ptr;
+  JvmtiCachedClassFileData ** _cached_class_file_ptr;
   JvmtiThreadState *   _state;
   KlassHandle *        _h_class_being_redefined;
   JvmtiClassLoadKind   _load_kind;
@@ -526,8 +526,7 @@
   inline JvmtiClassFileLoadHookPoster(Symbol* h_name, Handle class_loader,
                                       Handle h_protection_domain,
                                       unsigned char **data_ptr, unsigned char **end_ptr,
-                                      unsigned char **cached_data_ptr,
-                                      jint *cached_length_ptr) {
+                                      JvmtiCachedClassFileData **cache_ptr) {
     _h_name = h_name;
     _class_loader = class_loader;
     _h_protection_domain = h_protection_domain;
@@ -537,8 +536,7 @@
     _curr_len = *end_ptr - *data_ptr;
     _curr_data = *data_ptr;
     _curr_env = NULL;
-    _cached_length_ptr = cached_length_ptr;
-    _cached_data_ptr = cached_data_ptr;
+    _cached_class_file_ptr = cache_ptr;
 
     _state = _thread->jvmti_thread_state();
     if (_state != NULL) {
@@ -615,15 +613,20 @@
     }
     if (new_data != NULL) {
       // this agent has modified class data.
-      if (caching_needed && *_cached_data_ptr == NULL) {
+      if (caching_needed && *_cached_class_file_ptr == NULL) {
         // data has been changed by the new retransformable agent
         // and it hasn't already been cached, cache it
-        *_cached_data_ptr = (unsigned char *)os::malloc(_curr_len, mtInternal);
-        if (*_cached_data_ptr == NULL) {
-          vm_exit_out_of_memory(_curr_len, OOM_MALLOC_ERROR, "unable to allocate cached copy of original class bytes");
+        JvmtiCachedClassFileData *p;
+        p = (JvmtiCachedClassFileData *)os::malloc(
+          offset_of(JvmtiCachedClassFileData, data) + _curr_len, mtInternal);
+        if (p == NULL) {
+          vm_exit_out_of_memory(offset_of(JvmtiCachedClassFileData, data) + _curr_len,
+            OOM_MALLOC_ERROR,
+            "unable to allocate cached copy of original class bytes");
         }
-        memcpy(*_cached_data_ptr, _curr_data, _curr_len);
-        *_cached_length_ptr = _curr_len;
+        p->length = _curr_len;
+        memcpy(p->data, _curr_data, _curr_len);
+        *_cached_class_file_ptr = p;
       }
 
       if (_curr_data != *_data_ptr) {
@@ -662,13 +665,11 @@
                                             Handle h_protection_domain,
                                             unsigned char **data_ptr,
                                             unsigned char **end_ptr,
-                                            unsigned char **cached_data_ptr,
-                                            jint *cached_length_ptr) {
+                                            JvmtiCachedClassFileData **cache_ptr) {
   JvmtiClassFileLoadHookPoster poster(h_name, class_loader,
                                       h_protection_domain,
                                       data_ptr, end_ptr,
-                                      cached_data_ptr,
-                                      cached_length_ptr);
+                                      cache_ptr);
   poster.post();
 }
 
--- a/hotspot/src/share/vm/prims/jvmtiExport.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -323,8 +323,7 @@
   static void post_class_file_load_hook(Symbol* h_name, Handle class_loader,
                                         Handle h_protection_domain,
                                         unsigned char **data_ptr, unsigned char **end_ptr,
-                                        unsigned char **cached_data_ptr,
-                                        jint *cached_length_ptr) NOT_JVMTI_RETURN;
+                                        JvmtiCachedClassFileData **cache_ptr) NOT_JVMTI_RETURN;
   static void post_native_method_bind(Method* method, address* function_ptr) NOT_JVMTI_RETURN;
   static void post_compiled_method_load(nmethod *nm) NOT_JVMTI_RETURN;
   static void post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end) NOT_JVMTI_RETURN;
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -3342,9 +3342,7 @@
   // should get cleared in the_class too.
   if (the_class->get_cached_class_file_bytes() == 0) {
     // the_class doesn't have a cache yet so copy it
-    the_class->set_cached_class_file(
-      scratch_class->get_cached_class_file_bytes(),
-      scratch_class->get_cached_class_file_len());
+    the_class->set_cached_class_file(scratch_class->get_cached_class_file());
   }
 #ifndef PRODUCT
   else {
@@ -3357,7 +3355,7 @@
 
   // NULL out in scratch class to not delete twice.  The class to be redefined
   // always owns these bytes.
-  scratch_class->set_cached_class_file(NULL, 0);
+  scratch_class->set_cached_class_file(NULL);
 
   // Replace inner_classes
   Array<u2>* old_inner_classes = the_class->inner_classes();
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -331,6 +331,11 @@
 //   coordinate a cleanup of these constants with Runtime.
 //
 
+struct JvmtiCachedClassFileData {
+  jint length;
+  unsigned char data[1];
+};
+
 class VM_RedefineClasses: public VM_Operation {
  private:
   // These static fields are needed by ClassLoaderDataGraph::classes_do()
@@ -509,5 +514,12 @@
   // Modifiable test must be shared between IsModifiableClass query
   // and redefine implementation
   static bool is_modifiable_class(oop klass_mirror);
+
+  static jint get_cached_class_file_len(JvmtiCachedClassFileData *cache) {
+    return cache == NULL ? 0 : cache->length;
+  }
+  static unsigned char * get_cached_class_file_bytes(JvmtiCachedClassFileData *cache) {
+    return cache == NULL ? NULL : cache->data;
+  }
 };
 #endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSES_HPP
--- a/hotspot/src/share/vm/runtime/aprofiler.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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/systemDictionary.hpp"
-#include "gc_interface/collectedHeap.inline.hpp"
-#include "memory/resourceArea.hpp"
-#include "memory/space.hpp"
-#include "oops/oop.inline.hpp"
-#include "oops/oop.inline2.hpp"
-#include "runtime/aprofiler.hpp"
-
-
-bool AllocationProfiler::_active = false;
-GrowableArray<Klass*>* AllocationProfiler::_print_array = NULL;
-
-
-class AllocProfClosure : public ObjectClosure {
- public:
-  void do_object(oop obj) {
-    Klass* k = obj->klass();
-    k->set_alloc_count(k->alloc_count() + 1);
-    k->set_alloc_size(k->alloc_size() + obj->size());
-  }
-};
-
-
-void AllocationProfiler::iterate_since_last_gc() {
-  if (is_active()) {
-    AllocProfClosure blk;
-    GenCollectedHeap* heap = GenCollectedHeap::heap();
-    heap->object_iterate_since_last_GC(&blk);
-  }
-}
-
-
-void AllocationProfiler::engage() {
-  _active = true;
-}
-
-
-void AllocationProfiler::disengage() {
-  _active = false;
-}
-
-
-void AllocationProfiler::add_class_to_array(Klass* k) {
-  _print_array->append(k);
-}
-
-
-void AllocationProfiler::add_classes_to_array(Klass* k) {
-  // Iterate over klass and all array klasses for klass
-  k->with_array_klasses_do(&AllocationProfiler::add_class_to_array);
-}
-
-
-int AllocationProfiler::compare_classes(Klass** k1, Klass** k2) {
-  // Sort by total allocation size
-  return (*k2)->alloc_size() - (*k1)->alloc_size();
-}
-
-
-int AllocationProfiler::average(size_t alloc_size, int alloc_count) {
-  return (int) ((double) (alloc_size * BytesPerWord) / MAX2(alloc_count, 1) + 0.5);
-}
-
-
-void AllocationProfiler::sort_and_print_array(size_t cutoff) {
-  _print_array->sort(&AllocationProfiler::compare_classes);
-  tty->print_cr("________________Size"
-                "__Instances"
-                "__Average"
-                "__Class________________");
-  size_t total_alloc_size = 0;
-  int total_alloc_count = 0;
-  for (int index = 0; index < _print_array->length(); index++) {
-    Klass* k = _print_array->at(index);
-    size_t alloc_size = k->alloc_size();
-    if (alloc_size > cutoff) {
-      int alloc_count = k->alloc_count();
-#ifdef PRODUCT
-      const char* name = k->external_name();
-#else
-      const char* name = k->internal_name();
-#endif
-      tty->print_cr("%20u %10u %8u  %s",
-        alloc_size * BytesPerWord,
-        alloc_count,
-        average(alloc_size, alloc_count),
-        name);
-      total_alloc_size += alloc_size;
-      total_alloc_count += alloc_count;
-    }
-    k->set_alloc_count(0);
-    k->set_alloc_size(0);
-  }
-  tty->print_cr("%20u %10u %8u  --total--",
-    total_alloc_size * BytesPerWord,
-    total_alloc_count,
-    average(total_alloc_size, total_alloc_count));
-  tty->cr();
-}
-
-
-void AllocationProfiler::print(size_t cutoff) {
-  ResourceMark rm;
-  assert(!is_active(), "AllocationProfiler cannot be active while printing profile");
-
-  tty->cr();
-  tty->print_cr("Allocation profile (sizes in bytes, cutoff = " SIZE_FORMAT " bytes):", cutoff * BytesPerWord);
-  tty->cr();
-
-  // Print regular instance klasses and basic type array klasses
-  _print_array = new GrowableArray<Klass*>(SystemDictionary::number_of_classes()*2);
-  SystemDictionary::classes_do(&add_classes_to_array);
-  Universe::basic_type_classes_do(&add_classes_to_array);
-  sort_and_print_array(cutoff);
-
-  // This used to print metadata in the permgen but since there isn't a permgen
-  // anymore, it is not yet implemented.
-}
--- a/hotspot/src/share/vm/runtime/aprofiler.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * 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_RUNTIME_APROFILER_HPP
-#define SHARE_VM_RUNTIME_APROFILER_HPP
-
-#include "memory/allocation.hpp"
-#include "memory/universe.hpp"
-#include "oops/klass.hpp"
-#include "utilities/top.hpp"
-
-// A simple allocation profiler for Java. The profiler collects and prints
-// the number and total size of instances allocated per class, including
-// array classes.
-//
-// The profiler is currently global for all threads. It can be changed to a
-// per threads profiler by keeping a more elaborate data structure and calling
-// iterate_since_last_scavenge at thread switches.
-
-
-class AllocationProfiler: AllStatic {
-  friend class GenCollectedHeap;
-  friend class G1CollectedHeap;
-  friend class MarkSweep;
- private:
-  static bool _active;                          // tells whether profiler is active
-  static GrowableArray<Klass*>* _print_array; // temporary array for printing
-
-  // Utility printing functions
-  static void add_class_to_array(Klass* k);
-  static void add_classes_to_array(Klass* k);
-  static int  compare_classes(Klass** k1, Klass** k2);
-  static int  average(size_t alloc_size, int alloc_count);
-  static void sort_and_print_array(size_t cutoff);
-
-  // Call for collecting allocation information. Called at scavenge, mark-sweep and disengage.
-  static void iterate_since_last_gc();
-
- public:
-  // Start profiler
-  static void engage();
-  // Stop profiler
-  static void disengage();
-  // Tells whether profiler is active
-  static bool is_active()                   { return _active; }
-  // Print profile
-  static void print(size_t cutoff);   // Cutoff in total allocation size (in words)
-};
-
-#endif // SHARE_VM_RUNTIME_APROFILER_HPP
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -68,7 +68,6 @@
 SystemProperty* Arguments::_system_properties   = NULL;
 const char*  Arguments::_gc_log_filename        = NULL;
 bool   Arguments::_has_profile                  = false;
-bool   Arguments::_has_alloc_profile            = false;
 uintx  Arguments::_min_heap_size                = 0;
 Arguments::Mode Arguments::_mode                = _mixed;
 bool   Arguments::_java_compiler                = false;
@@ -261,6 +260,10 @@
   { "PrintRevisitStats",             JDK_Version::jdk(8), JDK_Version::jdk(9) },
   { "UseVectoredExceptions",         JDK_Version::jdk(8), JDK_Version::jdk(9) },
   { "UseSplitVerifier",              JDK_Version::jdk(8), JDK_Version::jdk(9) },
+  { "UseISM",                        JDK_Version::jdk(8), JDK_Version::jdk(9) },
+  { "UsePermISM",                    JDK_Version::jdk(8), JDK_Version::jdk(9) },
+  { "UseMPSS",                       JDK_Version::jdk(8), JDK_Version::jdk(9) },
+  { "UseStringCache",                JDK_Version::jdk(8), JDK_Version::jdk(9) },
 #ifdef PRODUCT
   { "DesiredMethodLimit",
                            JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
@@ -1855,8 +1858,13 @@
                 "please refer to the release notes for the combinations "
                 "allowed\n");
     status = false;
+  } else if (ReservedCodeCacheSize > 2*G) {
+    // Code cache size larger than MAXINT is not supported.
+    jio_fprintf(defaultStream::error_stream(),
+                "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
+                (2*G)/M);
+    status = false;
   }
-
   return status;
 }
 
@@ -1986,23 +1994,6 @@
   status = status && check_gc_consistency();
   status = status && check_stack_pages();
 
-  if (_has_alloc_profile) {
-    if (UseParallelGC || UseParallelOldGC) {
-      jio_fprintf(defaultStream::error_stream(),
-                  "error:  invalid argument combination.\n"
-                  "Allocation profiling (-Xaprof) cannot be used together with "
-                  "Parallel GC (-XX:+UseParallelGC or -XX:+UseParallelOldGC).\n");
-      status = false;
-    }
-    if (UseConcMarkSweepGC) {
-      jio_fprintf(defaultStream::error_stream(),
-                  "error:  invalid argument combination.\n"
-                  "Allocation profiling (-Xaprof) cannot be used together with "
-                  "the CMS collector (-XX:+UseConcMarkSweepGC).\n");
-      status = false;
-    }
-  }
-
   if (CMSIncrementalMode) {
     if (!UseConcMarkSweepGC) {
       jio_fprintf(defaultStream::error_stream(),
@@ -2239,8 +2230,13 @@
                 "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
                 min_code_cache_size/K);
     status = false;
+  } else if (ReservedCodeCacheSize > 2*G) {
+    // Code cache size larger than MAXINT is not supported.
+    jio_fprintf(defaultStream::error_stream(),
+                "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
+                (2*G)/M);
+    status = false;
   }
-
   return status;
 }
 
@@ -2700,9 +2696,6 @@
         "Flat profiling is not supported in this VM.\n");
       return JNI_ERR;
 #endif // INCLUDE_FPROF
-    // -Xaprof
-    } else if (match_option(option, "-Xaprof", &tail)) {
-      _has_alloc_profile = true;
     // -Xconcurrentio
     } else if (match_option(option, "-Xconcurrentio", &tail)) {
       FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true);
@@ -2957,13 +2950,6 @@
       FLAG_SET_CMDLINE(bool, UseTLAB, true);
     } else if (match_option(option, "-XX:-UseTLE", &tail)) {
       FLAG_SET_CMDLINE(bool, UseTLAB, false);
-SOLARIS_ONLY(
-    } else if (match_option(option, "-XX:+UsePermISM", &tail)) {
-      warning("-XX:+UsePermISM is obsolete.");
-      FLAG_SET_CMDLINE(bool, UseISM, true);
-    } else if (match_option(option, "-XX:-UsePermISM", &tail)) {
-      FLAG_SET_CMDLINE(bool, UseISM, false);
-)
     } else if (match_option(option, "-XX:+DisplayVMOutputToStderr", &tail)) {
       FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, false);
       FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, true);
@@ -3136,8 +3122,6 @@
     // Note that large pages are enabled/disabled for both the
     // Java heap and the code cache.
     FLAG_SET_DEFAULT(UseLargePages, false);
-    SOLARIS_ONLY(FLAG_SET_DEFAULT(UseMPSS, false));
-    SOLARIS_ONLY(FLAG_SET_DEFAULT(UseISM, false));
   }
 
   // Tiered compilation is undefined with C1.
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -262,7 +262,6 @@
 
   // Option flags
   static bool   _has_profile;
-  static bool   _has_alloc_profile;
   static const char*  _gc_log_filename;
   static uintx  _min_heap_size;
 
@@ -464,9 +463,8 @@
   // -Xloggc:<file>, if not specified will be NULL
   static const char* gc_log_filename()      { return _gc_log_filename; }
 
-  // -Xprof/-Xaprof
+  // -Xprof
   static bool has_profile()                 { return _has_profile; }
-  static bool has_alloc_profile()           { return _has_alloc_profile; }
 
   // -Xms, -Xmx
   static uintx min_heap_size()              { return _min_heap_size; }
--- a/hotspot/src/share/vm/runtime/frame.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -221,9 +221,20 @@
 
 
 bool frame::entry_frame_is_first() const {
-  return entry_frame_call_wrapper()->anchor()->last_Java_sp() == NULL;
+  return entry_frame_call_wrapper()->is_first_frame();
 }
 
+JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) const {
+  JavaCallWrapper** jcw = entry_frame_call_wrapper_addr();
+  address addr = (address) jcw;
+
+  // addr must be within the usable part of the stack
+  if (thread->is_in_usable_stack(addr)) {
+    return *jcw;
+  }
+
+  return NULL;
+}
 
 bool frame::should_be_deoptimized() const {
   if (_deopt_state == is_deoptimized ||
--- a/hotspot/src/share/vm/runtime/frame.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/frame.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -353,7 +353,9 @@
 
  public:
   // Entry frames
-  JavaCallWrapper* entry_frame_call_wrapper() const;
+  JavaCallWrapper* entry_frame_call_wrapper() const { return *entry_frame_call_wrapper_addr(); }
+  JavaCallWrapper* entry_frame_call_wrapper_if_safe(JavaThread* thread) const;
+  JavaCallWrapper** entry_frame_call_wrapper_addr() const;
   intptr_t* entry_frame_argument_at(int offset) const;
 
   // tells whether there is another chunk of Delta stack above
--- a/hotspot/src/share/vm/runtime/globals.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -175,6 +175,7 @@
 define_pd_global(intx, ReservedCodeCacheSize,        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(bool, NeverActAsServerClassMachine, true);
 define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
@@ -2588,9 +2589,6 @@
   product(bool, AggressiveOpts, false,                                      \
           "Enable aggressive optimizations - see arguments.cpp")            \
                                                                             \
-  product(bool, UseStringCache, false,                                      \
-          "Enable String cache capabilities on String.java")                \
-                                                                            \
   /* statistics */                                                          \
   develop(bool, CountCompiledCalls, false,                                  \
           "counts method invocations")                                      \
@@ -3679,6 +3677,9 @@
   develop(bool, VerifyGenericSignatures, false,                             \
           "Abort VM on erroneous or inconsistent generic signatures")       \
                                                                             \
+  product(bool, ParseGenericDefaults, false,                                \
+          "Parse generic signatures for default method handling")           \
+                                                                            \
   product(bool, UseVMInterruptibleIO, false,                                \
           "(Unstable, Solaris-specific) Thread interrupt before or with "   \
           "EINTR for I/O operations results in OS_INTRPT. The default value"\
--- a/hotspot/src/share/vm/runtime/handles.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/handles.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -227,7 +227,7 @@
   HandleArea* _prev;          // link to outer (older) area
  public:
   // Constructor
-  HandleArea(HandleArea* prev) {
+  HandleArea(HandleArea* prev) : Arena(Chunk::tiny_size) {
     debug_only(_handle_mark_nesting    = 0);
     debug_only(_no_handle_mark_nesting = 0);
     _prev = prev;
--- a/hotspot/src/share/vm/runtime/java.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/java.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -42,7 +42,6 @@
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "prims/jvmtiExport.hpp"
-#include "runtime/aprofiler.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/compilationPolicy.hpp"
@@ -509,16 +508,6 @@
     }
   }
 
-
-  if (Arguments::has_alloc_profile()) {
-    HandleMark hm;
-    // Do one last collection to enumerate all the objects
-    // allocated since the last one.
-    Universe::heap()->collect(GCCause::_allocation_profiler);
-    AllocationProfiler::disengage();
-    AllocationProfiler::print(0);
-  }
-
   if (PrintBytecodeHistogram) {
     BytecodeHistogram::print();
   }
--- a/hotspot/src/share/vm/runtime/javaCalls.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/javaCalls.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -80,6 +80,8 @@
   oop              receiver()               { return _receiver; }
   void             oops_do(OopClosure* f);
 
+  bool             is_first_frame() const   { return _anchor.last_Java_sp() == NULL; }
+
 };
 
 
--- a/hotspot/src/share/vm/runtime/mutex.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/mutex.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1370,6 +1370,10 @@
     debug_only(if (rank() != Mutex::special) \
       thread->check_for_valid_safepoint_state(false);)
   }
+  if (thread->is_Watcher_thread()) {
+    assert(!WatcherThread::watcher_thread()->has_crash_protection(),
+        "locking not allowed when crash protection is set");
+  }
 }
 
 void Monitor::check_block_state(Thread *thread) {
--- a/hotspot/src/share/vm/runtime/os.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/os.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -595,6 +595,22 @@
   NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1));
   NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size));
 
+#ifdef ASSERT
+  // checking for the WatcherThread and crash_protection first
+  // since os::malloc can be called when the libjvm.{dll,so} is
+  // first loaded and we don't have a thread yet.
+  // try to find the thread after we see that the watcher thread
+  // exists and has crash protection.
+  WatcherThread *wt = WatcherThread::watcher_thread();
+  if (wt != NULL && wt->has_crash_protection()) {
+    Thread* thread = ThreadLocalStorage::get_thread_slow();
+    if (thread == wt) {
+      assert(!wt->has_crash_protection(),
+          "Can't malloc with crash protection from WatcherThread");
+    }
+  }
+#endif
+
   if (size == 0) {
     // return a valid pointer if size is zero
     // if NULL is returned the calling functions assume out of memory.
--- a/hotspot/src/share/vm/runtime/os.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/os.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -32,15 +32,18 @@
 #include "utilities/top.hpp"
 #ifdef TARGET_OS_FAMILY_linux
 # include "jvm_linux.h"
+# include <setjmp.h>
 #endif
 #ifdef TARGET_OS_FAMILY_solaris
 # include "jvm_solaris.h"
+# include <setjmp.h>
 #endif
 #ifdef TARGET_OS_FAMILY_windows
 # include "jvm_windows.h"
 #endif
 #ifdef TARGET_OS_FAMILY_bsd
 # include "jvm_bsd.h"
+# include <setjmp.h>
 #endif
 
 // os defines the interface to operating system; this includes traditional
@@ -507,16 +510,16 @@
 
   // Symbol lookup, find nearest function name; basically it implements
   // dladdr() for all platforms. Name of the nearest function is copied
-  // to buf. Distance from its base address is returned as offset.
+  // to buf. Distance from its base address is optionally returned as offset.
   // If function name is not found, buf[0] is set to '\0' and offset is
-  // set to -1.
+  // set to -1 (if offset is non-NULL).
   static bool dll_address_to_function_name(address addr, char* buf,
                                            int buflen, int* offset);
 
   // Locate DLL/DSO. On success, full path of the library is copied to
-  // buf, and offset is set to be the distance between addr and the
-  // library's base address. On failure, buf[0] is set to '\0' and
-  // offset is set to -1.
+  // buf, and offset is optionally set to be the distance between addr
+  // and the library's base address. On failure, buf[0] is set to '\0'
+  // and offset is set to -1 (if offset is non-NULL).
   static bool dll_address_to_library_name(address addr, char* buf,
                                           int buflen, int* offset);
 
@@ -730,6 +733,10 @@
 #include "runtime/os_ext.hpp"
 
  public:
+  class CrashProtectionCallback : public StackObj {
+  public:
+    virtual void call() = 0;
+  };
 
   // Platform dependent stuff
 #ifdef TARGET_OS_FAMILY_linux
@@ -908,6 +915,7 @@
                                 char pathSep);
   static bool set_boot_path(char fileSep, char pathSep);
   static char** split_path(const char* path, int* n);
+
 };
 
 // Note that "PAUSE" is almost always used with synchronization
@@ -915,8 +923,6 @@
 // of the global SpinPause() with C linkage.
 // It'd also be eligible for inlining on many platforms.
 
-extern "C" int SpinPause () ;
-extern "C" int SafeFetch32 (int * adr, int errValue) ;
-extern "C" intptr_t SafeFetchN (intptr_t * adr, intptr_t errValue) ;
+extern "C" int SpinPause();
 
 #endif // SHARE_VM_RUNTIME_OS_HPP
--- a/hotspot/src/share/vm/runtime/stubRoutines.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -136,6 +136,13 @@
 double (* StubRoutines::_intrinsic_cos   )(double) = NULL;
 double (* StubRoutines::_intrinsic_tan   )(double) = NULL;
 
+address StubRoutines::_safefetch32_entry                 = NULL;
+address StubRoutines::_safefetch32_fault_pc              = NULL;
+address StubRoutines::_safefetch32_continuation_pc       = NULL;
+address StubRoutines::_safefetchN_entry                  = NULL;
+address StubRoutines::_safefetchN_fault_pc               = NULL;
+address StubRoutines::_safefetchN_continuation_pc        = NULL;
+
 // Initialization
 //
 // Note: to break cycle with universe initialization, stubs are generated in two phases.
--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -221,6 +221,14 @@
   static double (*_intrinsic_cos)(double);
   static double (*_intrinsic_tan)(double);
 
+  // Safefetch stubs.
+  static address _safefetch32_entry;
+  static address _safefetch32_fault_pc;
+  static address _safefetch32_continuation_pc;
+  static address _safefetchN_entry;
+  static address _safefetchN_fault_pc;
+  static address _safefetchN_continuation_pc;
+
  public:
   // Initialization/Testing
   static void    initialize1();                            // must happen before universe::genesis
@@ -382,6 +390,34 @@
   }
 
   //
+  // Safefetch stub support
+  //
+
+  typedef int      (*SafeFetch32Stub)(int*      adr, int      errValue);
+  typedef intptr_t (*SafeFetchNStub) (intptr_t* adr, intptr_t errValue);
+
+  static SafeFetch32Stub SafeFetch32_stub() { return CAST_TO_FN_PTR(SafeFetch32Stub, _safefetch32_entry); }
+  static SafeFetchNStub  SafeFetchN_stub()  { return CAST_TO_FN_PTR(SafeFetchNStub,  _safefetchN_entry); }
+
+  static bool is_safefetch_fault(address pc) {
+    return pc != NULL &&
+          (pc == _safefetch32_fault_pc ||
+           pc == _safefetchN_fault_pc);
+  }
+
+  static address continuation_for_safefetch_fault(address pc) {
+    assert(_safefetch32_continuation_pc != NULL &&
+           _safefetchN_continuation_pc  != NULL,
+           "not initialized");
+
+    if (pc == _safefetch32_fault_pc) return _safefetch32_continuation_pc;
+    if (pc == _safefetchN_fault_pc)  return _safefetchN_continuation_pc;
+
+    ShouldNotReachHere();
+    return NULL;
+  }
+
+  //
   // Default versions of the above arraycopy functions for platforms which do
   // not have specialized versions
   //
@@ -400,4 +436,15 @@
   static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count);
 };
 
+// Safefetch allows to load a value from a location that's not known
+// to be valid. If the load causes a fault, the error value is returned.
+inline int SafeFetch32(int* adr, int errValue) {
+  assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");
+  return StubRoutines::SafeFetch32_stub()(adr, errValue);
+}
+inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
+  assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated");
+  return StubRoutines::SafeFetchN_stub()(adr, errValue);
+}
+
 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP
--- a/hotspot/src/share/vm/runtime/thread.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -45,7 +45,6 @@
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "prims/privilegedStack.hpp"
-#include "runtime/aprofiler.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/deoptimization.hpp"
@@ -219,6 +218,7 @@
   // allocated data structures
   set_osthread(NULL);
   set_resource_area(new (mtThread)ResourceArea());
+  DEBUG_ONLY(_current_resource_mark = NULL;)
   set_handle_area(new (mtThread) HandleArea(NULL));
   set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(30, true));
   set_active_handles(NULL);
@@ -954,6 +954,14 @@
 }
 
 
+bool Thread::is_in_usable_stack(address adr) const {
+  size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackYellowPages + StackRedPages) * os::vm_page_size() : 0;
+  size_t usable_stack_size = _stack_size - stack_guard_size;
+
+  return ((adr < stack_base()) && (adr >= stack_base() - usable_stack_size));
+}
+
+
 // We had to move these methods here, because vm threads get into ObjectSynchronizer::enter
 // However, there is a note in JavaThread::is_lock_owned() about the VM threads not being
 // used for compilation in the future. If that change is made, the need for these methods
@@ -1218,7 +1226,7 @@
 bool WatcherThread::_startable = false;
 volatile bool  WatcherThread::_should_terminate = false;
 
-WatcherThread::WatcherThread() : Thread() {
+WatcherThread::WatcherThread() : Thread(), _crash_protection(NULL) {
   assert(watcher_thread() == NULL, "we can only allocate one WatcherThread");
   if (os::create_thread(this, os::watcher_thread)) {
     _watcher_thread = this;
@@ -3482,44 +3490,6 @@
 
     initialize_class(vmSymbols::java_lang_String(), CHECK_0);
 
-    if (AggressiveOpts) {
-      {
-        // Forcibly initialize java/util/HashMap and mutate the private
-        // static final "frontCacheEnabled" field before we start creating instances
-#ifdef ASSERT
-        Klass* tmp_k = SystemDictionary::find(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
-        assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
-#endif
-        Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
-        KlassHandle k = KlassHandle(THREAD, k_o);
-        guarantee(k.not_null(), "Must find java/util/HashMap");
-        instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
-        ik->initialize(CHECK_0);
-        fieldDescriptor fd;
-        // Possible we might not find this field; if so, don't break
-        if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
-          k()->java_mirror()->bool_field_put(fd.offset(), true);
-        }
-      }
-
-      if (UseStringCache) {
-        // Forcibly initialize java/lang/StringValue and mutate the private
-        // static final "stringCacheEnabled" field before we start creating instances
-        Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_lang_StringValue(), Handle(), Handle(), CHECK_0);
-        // Possible that StringValue isn't present: if so, silently don't break
-        if (k_o != NULL) {
-          KlassHandle k = KlassHandle(THREAD, k_o);
-          instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
-          ik->initialize(CHECK_0);
-          fieldDescriptor fd;
-          // Possible we might not find this field: if so, silently don't break
-          if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
-            k()->java_mirror()->bool_field_put(fd.offset(), true);
-          }
-        }
-      }
-    }
-
     // Initialize java_lang.System (needed before creating the thread)
     initialize_class(vmSymbols::java_lang_System(), CHECK_0);
     initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0);
@@ -3637,6 +3607,7 @@
 
   // Start Attach Listener if +StartAttachListener or it can't be started lazily
   if (!DisableAttachMechanism) {
+    AttachListener::vm_start();
     if (StartAttachListener || AttachListener::init_at_startup()) {
       AttachListener::init();
     }
@@ -3677,7 +3648,6 @@
   }
 
   if (Arguments::has_profile())       FlatProfiler::engage(main_thread, true);
-  if (Arguments::has_alloc_profile()) AllocationProfiler::engage();
   if (MemProfiling)                   MemProfiler::engage();
   StatSampler::engage();
   if (CheckJNICalls)                  JniPeriodicChecker::engage();
--- a/hotspot/src/share/vm/runtime/thread.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/thread.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -86,6 +86,8 @@
 class ThreadClosure;
 class IdealGraphPrinter;
 
+DEBUG_ONLY(class ResourceMark;)
+
 class WorkerThread;
 
 // Class hierarchy
@@ -519,6 +521,9 @@
   // Check if address is in the stack of the thread (not just for locks).
   // Warning: the method can only be used on the running thread
   bool is_in_stack(address adr) const;
+  // Check if address is in the usable part of the stack (excludes protected
+  // guard pages)
+  bool is_in_usable_stack(address adr) const;
 
   // Sets this thread as starting thread. Returns failure if thread
   // creation fails due to lack of memory, too many threads etc.
@@ -531,6 +536,8 @@
   // Thread local resource area for temporary allocation within the VM
   ResourceArea* _resource_area;
 
+  DEBUG_ONLY(ResourceMark* _current_resource_mark;)
+
   // Thread local handle area for allocation of handles within the VM
   HandleArea* _handle_area;
   GrowableArray<Metadata*>* _metadata_handles;
@@ -585,6 +592,8 @@
 
   // Deadlock detection
   bool allow_allocation()                        { return _allow_allocation_count == 0; }
+  ResourceMark* current_resource_mark()          { return _current_resource_mark; }
+  void set_current_resource_mark(ResourceMark* rm) { _current_resource_mark = rm; }
 #endif
 
   void check_for_valid_safepoint_state(bool potential_vm_operation) PRODUCT_RETURN;
@@ -724,6 +733,8 @@
 
   static bool _startable;
   volatile static bool _should_terminate; // updated without holding lock
+
+  os::WatcherThreadCrashProtection* _crash_protection;
  public:
   enum SomeConstants {
     delay_interval = 10                          // interrupt delay in milliseconds
@@ -751,6 +762,14 @@
   // Otherwise the first task to enroll will trigger the start
   static void make_startable();
 
+  void set_crash_protection(os::WatcherThreadCrashProtection* crash_protection) {
+    assert(Thread::current()->is_Watcher_thread(), "Can only be set by WatcherThread");
+    _crash_protection = crash_protection;
+  }
+
+  bool has_crash_protection() const { return _crash_protection != NULL; }
+  os::WatcherThreadCrashProtection* crash_protection() const { return _crash_protection; }
+
  private:
   int sleep() const;
 };
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -263,7 +263,7 @@
                    unchecked_c2_static_field) \
                                                                                                                                      \
   /******************************************************************/                                                               \
-  /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */                                                               \
+  /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete) */                                                                 \
   /******************************************************************/                                                               \
                                                                                                                                      \
   volatile_nonstatic_field(oopDesc,            _mark,                                         markOop)                               \
@@ -274,21 +274,20 @@
   volatile_nonstatic_field(ArrayKlass,         _higher_dimension,                             Klass*)                                \
   volatile_nonstatic_field(ArrayKlass,         _lower_dimension,                              Klass*)                                \
   nonstatic_field(ArrayKlass,                  _vtable_len,                                   int)                                   \
-  nonstatic_field(ArrayKlass,                  _alloc_size,                                   juint)                                 \
   nonstatic_field(ArrayKlass,                  _component_mirror,                             oop)                                   \
-  nonstatic_field(CompiledICHolder,     _holder_method,                                Method*)                        \
+  nonstatic_field(CompiledICHolder,     _holder_method,                                Method*)                               \
   nonstatic_field(CompiledICHolder,     _holder_klass,                                 Klass*)                                \
   nonstatic_field(ConstantPool,         _tags,                                         Array<u1>*)                            \
-  nonstatic_field(ConstantPool,         _cache,                                        ConstantPoolCache*)             \
+  nonstatic_field(ConstantPool,         _cache,                                        ConstantPoolCache*)                    \
   nonstatic_field(ConstantPool,         _pool_holder,                                  InstanceKlass*)                        \
   nonstatic_field(ConstantPool,         _operands,                                     Array<u2>*)                            \
   nonstatic_field(ConstantPool,         _length,                                       int)                                   \
   nonstatic_field(ConstantPool,         _resolved_references,                          jobject)                               \
   nonstatic_field(ConstantPool,         _reference_map,                                Array<u2>*)                            \
   nonstatic_field(ConstantPoolCache,    _length,                                       int)                                   \
-  nonstatic_field(ConstantPoolCache,    _constant_pool,                                ConstantPool*)                  \
+  nonstatic_field(ConstantPoolCache,    _constant_pool,                                ConstantPool*)                         \
   nonstatic_field(InstanceKlass,               _array_klasses,                                Klass*)                                \
-  nonstatic_field(InstanceKlass,               _methods,                                      Array<Method*>*)                \
+  nonstatic_field(InstanceKlass,               _methods,                                      Array<Method*>*)                       \
   nonstatic_field(InstanceKlass,               _local_interfaces,                             Array<Klass*>*)                        \
   nonstatic_field(InstanceKlass,               _transitive_interfaces,                        Array<Klass*>*)                        \
   nonstatic_field(InstanceKlass,               _fields,                                       Array<u2>*)                            \
@@ -336,9 +335,8 @@
   nonstatic_field(Klass,                       _access_flags,                                 AccessFlags)                           \
   nonstatic_field(Klass,                       _subklass,                                     Klass*)                                \
   nonstatic_field(Klass,                       _next_sibling,                                 Klass*)                                \
-  nonstatic_field(Klass,                       _alloc_count,                                  juint)                                 \
   nonstatic_field(MethodData,           _size,                                         int)                                   \
-  nonstatic_field(MethodData,           _method,                                       Method*)                        \
+  nonstatic_field(MethodData,           _method,                                       Method*)                               \
   nonstatic_field(MethodData,           _data_size,                                    int)                                   \
   nonstatic_field(MethodData,           _data[0],                                      intptr_t)                              \
   nonstatic_field(MethodData,           _nof_decompiles,                               uint)                                  \
--- a/hotspot/src/share/vm/services/attachListener.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/services/attachListener.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -50,6 +50,7 @@
 
 class AttachListener: AllStatic {
  public:
+  static void vm_start() NOT_SERVICES_RETURN;
   static void init()  NOT_SERVICES_RETURN;
   static void abort() NOT_SERVICES_RETURN;
 
--- a/hotspot/src/share/vm/services/memBaseline.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/services/memBaseline.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -486,7 +486,7 @@
   const MemPointerRecord* mp1 = (const MemPointerRecord*)p1;
   const MemPointerRecord* mp2 = (const MemPointerRecord*)p2;
   int delta = UNSIGNED_COMPARE(mp1->addr(), mp2->addr());
-  assert(delta != 0, "dup pointer");
+  assert(p1 == p2 || delta != 0, "dup pointer");
   return delta;
 }
 
--- a/hotspot/src/share/vm/services/memTracker.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/services/memTracker.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -81,13 +81,13 @@
   } else if (strcmp(option_line, "=detail") == 0) {
     // detail relies on a stack-walking ability that may not
     // be available depending on platform and/or compiler flags
-    if (PLATFORM_NMT_DETAIL_SUPPORTED) {
+#if PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
       _tracking_level = NMT_detail;
-    } else {
+#else
       jio_fprintf(defaultStream::error_stream(),
-        "NMT detail is not supported on this platform.  Using NMT summary instead.");
+        "NMT detail is not supported on this platform.  Using NMT summary instead.\n");
       _tracking_level = NMT_summary;
-    }
+#endif
   } else if (strcmp(option_line, "=off") != 0) {
     vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
   }
@@ -385,6 +385,7 @@
 #define SAFE_SEQUENCE_THRESHOLD    30
 #define HIGH_GENERATION_THRESHOLD  60
 #define MAX_RECORDER_THREAD_RATIO  30
+#define MAX_RECORDER_PER_THREAD    100
 
 void MemTracker::sync() {
   assert(_tracking_level > NMT_off, "NMT is not enabled");
@@ -437,6 +438,11 @@
         // means that worker thread is lagging behind in processing them.
         if (!AutoShutdownNMT) {
           _slowdown_calling_thread = (MemRecorder::_instance_count > MAX_RECORDER_THREAD_RATIO * _thread_count);
+        } else {
+          // If auto shutdown is on, enforce MAX_RECORDER_PER_THREAD threshold to prevent OOM
+          if (MemRecorder::_instance_count >= _thread_count * MAX_RECORDER_PER_THREAD) {
+            shutdown(NMT_out_of_memory);
+          }
         }
 
         // check _worker_thread with lock to avoid racing condition
--- a/hotspot/src/share/vm/services/memTracker.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/services/memTracker.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -470,7 +470,21 @@
   static void check_NMT_load(Thread* thr) {
     assert(thr != NULL, "Sanity check");
     if (_slowdown_calling_thread && thr != _worker_thread) {
+#ifdef _WINDOWS
+      // On Windows, os::NakedYield() does not work as well
+      // as os::yield_all()
       os::yield_all();
+#else
+     // On Solaris, os::yield_all() depends on os::sleep()
+     // which requires JavaTherad in _thread_in_vm state.
+     // Transits thread to _thread_in_vm state can be dangerous
+     // if caller holds lock, as it may deadlock with Threads_lock.
+     // So use NaKedYield instead.
+     //
+     // Linux and BSD, NakedYield() and yield_all() implementations
+     // are the same.
+      os::NakedYield();
+#endif
     }
   }
 
--- a/hotspot/src/share/vm/trace/traceDataTypes.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/trace/traceDataTypes.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -63,5 +63,7 @@
 typedef u8 methodid;
 typedef u8 fieldid;
 
+class TraceUnicodeString;
+
 #endif // SHARE_VM_TRACE_TRACEDATATYPES_HPP
 
--- a/hotspot/src/share/vm/trace/tracetypes.xml	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/trace/tracetypes.xml	Fri Jul 26 14:07:32 2013 -0700
@@ -55,18 +55,6 @@
               type="u8" sizeop="sizeof(u1)"/>
 
 Now we can use the content + data type in declaring event fields.
-Remember however, that for us to be able to resolve the value later we must also add
-creating the constant pool data in  VM_JFRCheckpoint::write_checkpoint
-
-   ...
-   //CGMODE
-   w->be_uint(CONTENT_TYPE_GCMODE);
-   w->be_uint(MM_GC_MODE_UNINITIALIZED);
-   for (i = 0; i < MM_GC_MODE_UNINITIALIZED; i++) {
-      w->uchar(i);
-      w->write_utf8(gcModeGetName(i));
-   }
-
  -->
 
  <types>
@@ -81,10 +69,6 @@
       <value type="OSTHREAD" field="thread" label="VM Thread"/>
     </content_type>
 
-    <!-- The first argument ("JavaThread") is misleading, it's really a
-         java.lang.Thread id (long), but Mission Control depends on the name
-         being "JavaThread" so it shouldn't be changed.
-    -->
     <content_type id="JavaThread" hr_name="Java thread"
                   type="U8" builtin_type="JAVALANGTHREAD">
       <value type="OSTHREAD" field="thread" label="OS Thread ID"/>
@@ -285,6 +269,10 @@
     <primary_type symbol="UTF8" datatype="UTF8" contenttype="NONE"
                   type="const char *" sizeop="sizeof_utf(%)"/>
 
+    <!-- UTF-16 encoded (Unicode) string, max length maxjuint -->
+    <primary_type symbol="STRING" datatype="STRING" contenttype="NONE"
+                  type="TraceUnicodeString*" sizeop="sizeof_unicode(%)"/>
+
     <!-- Symbol* constant. Note that this may currently ONLY be used by
           classes, methods fields.  This restriction might be lifted. -->
     <primary_type symbol="SYMBOL" datatype="U8" contenttype="SYMBOL"
--- a/hotspot/src/share/vm/trace/xinclude.mod	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/trace/xinclude.mod	Fri Jul 26 14:07:32 2013 -0700
@@ -22,30 +22,6 @@
  questions.
   
 -->
-
-<!--
- Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
-  
--->
 <!ELEMENT xi:include (xi:fallback?) >
 <!ATTLIST xi:include
     xmlns:xi   CDATA       #FIXED    "http://www.w3.org/2001/XInclude"
--- a/hotspot/src/share/vm/utilities/debug.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/utilities/debug.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -314,8 +314,8 @@
 #ifndef PRODUCT
 #include <signal.h>
 
-void test_error_handler(size_t test_num)
-{
+void test_error_handler() {
+  uintx test_num = ErrorHandlerTest;
   if (test_num == 0) return;
 
   // If asserts are disabled, use the corresponding guarantee instead.
@@ -327,6 +327,8 @@
 
   const char* const eol = os::line_separator();
   const char* const msg = "this message should be truncated during formatting";
+  char * const dataPtr = NULL;  // bad data pointer
+  const void (*funcPtr)(void) = (const void(*)()) 0xF;  // bad function pointer
 
   // Keep this in sync with test/runtime/6888954/vmerrors.sh.
   switch (n) {
@@ -348,11 +350,16 @@
     case  9: ShouldNotCallThis();
     case 10: ShouldNotReachHere();
     case 11: Unimplemented();
-    // This is last because it does not generate an hs_err* file on Windows.
-    case 12: os::signal_raise(SIGSEGV);
+    // There's no guarantee the bad data pointer will crash us
+    // so "break" out to the ShouldNotReachHere().
+    case 12: *dataPtr = '\0'; break;
+    // There's no guarantee the bad function pointer will crash us
+    // so "break" out to the ShouldNotReachHere().
+    case 13: (*funcPtr)(); break;
 
-    default: ShouldNotReachHere();
+    default: tty->print_cr("ERROR: %d: unexpected test_num value.", n);
   }
+  ShouldNotReachHere();
 }
 #endif // !PRODUCT
 
--- a/hotspot/src/share/vm/utilities/debug.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/utilities/debug.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -243,7 +243,7 @@
 void set_error_reported();
 
 /* Test assert(), fatal(), guarantee(), etc. */
-NOT_PRODUCT(void test_error_handler(size_t test_num);)
+NOT_PRODUCT(void test_error_handler();)
 
 void pd_ps(frame f);
 void pd_obfuscate_location(char *buf, size_t buflen);
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -381,12 +381,12 @@
 #endif
 
 /*
- * If a platform does not support NMT_detail
+ * If a platform does not support native stack walking
  * the platform specific globalDefinitions (above)
- * can set PLATFORM_NMT_DETAIL_SUPPORTED to false
+ * can set PLATFORM_NATIVE_STACK_WALKING_SUPPORTED to 0
  */
-#ifndef PLATFORM_NMT_DETAIL_SUPPORTED
-#define PLATFORM_NMT_DETAIL_SUPPORTED true
+#ifndef PLATFORM_NATIVE_STACK_WALKING_SUPPORTED
+#define PLATFORM_NATIVE_STACK_WALKING_SUPPORTED 1
 #endif
 
 // The byte alignment to be used by Arena::Amalloc.  See bugid 4169348.
--- a/hotspot/src/share/vm/utilities/ostream.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/utilities/ostream.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -296,6 +296,7 @@
   buffer        = NEW_RESOURCE_ARRAY(char, buffer_length);
   buffer_pos    = 0;
   buffer_fixed  = false;
+  DEBUG_ONLY(rm = Thread::current()->current_resource_mark();)
 }
 
 // useful for output to fixed chunks of memory, such as performance counters
@@ -321,6 +322,8 @@
         end = buffer_length * 2;
       }
       char* oldbuf = buffer;
+      assert(rm == NULL || Thread::current()->current_resource_mark() == rm,
+             "stringStream is re-allocated with a different ResourceMark");
       buffer = NEW_RESOURCE_ARRAY(char, end);
       strncpy(buffer, oldbuf, buffer_pos);
       buffer_length = end;
--- a/hotspot/src/share/vm/utilities/ostream.hpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/utilities/ostream.hpp	Fri Jul 26 14:07:32 2013 -0700
@@ -28,6 +28,8 @@
 #include "memory/allocation.hpp"
 #include "runtime/timer.hpp"
 
+DEBUG_ONLY(class ResourceMark;)
+
 // Output streams for printing
 //
 // Printing guidelines:
@@ -177,6 +179,7 @@
   size_t buffer_pos;
   size_t buffer_length;
   bool   buffer_fixed;
+  DEBUG_ONLY(ResourceMark* rm;)
  public:
   stringStream(size_t initial_bufsize = 256);
   stringStream(char* fixed_buffer, size_t fixed_buffer_size);
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Fri Jul 26 14:07:32 2013 -0700
@@ -908,10 +908,11 @@
     // This is not the first error, see if it happened in a different thread
     // or in the same thread during error reporting.
     if (first_error_tid != mytid) {
-      jio_snprintf(buffer, sizeof(buffer),
+      char msgbuf[64];
+      jio_snprintf(msgbuf, sizeof(msgbuf),
                    "[thread " INT64_FORMAT " also had an error]",
                    mytid);
-      out.print_raw_cr(buffer);
+      out.print_raw_cr(msgbuf);
 
       // error reporting is not MT-safe, block current thread
       os::infinite_sleep();
--- a/hotspot/test/compiler/8005956/PolynomialRoot.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/test/compiler/8005956/PolynomialRoot.java	Fri Jul 26 14:07:32 2013 -0700
@@ -15,7 +15,7 @@
 * @bug 8005956
 * @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
 *
-* @run main PolynomialRoot
+* @run main/timeout=300 PolynomialRoot
 */
 
 public class PolynomialRoot  {
@@ -757,19 +757,26 @@
 
     public static void main(final String [] args)
     {
-  final long t0=System.currentTimeMillis();
-  final double eps=1e-6;
-  //checkRoots();
-  final java.util.Random r=new java.util.Random(-1381923);
-  printSpecialValues();
+      if (System.getProperty("os.arch").equals("x86") ||
+         System.getProperty("os.arch").equals("amd64") ||
+         System.getProperty("os.arch").equals("x86_64")){
+        final long t0=System.currentTimeMillis();
+        final double eps=1e-6;
+        //checkRoots();
+        final java.util.Random r=new java.util.Random(-1381923);
+        printSpecialValues();
 
-  final int n_tests=10000000;
-  //testRoots(2,n_tests,r,eps);
-  //testRoots(3,n_tests,r,eps);
-  testRoots(4,n_tests,r,eps);
-  final long t1=System.currentTimeMillis();
-  System.err.println("PolynomialRoot.main: "+n_tests+" tests OK done in "+(t1-t0)+" milliseconds. ver=$Id: PolynomialRoot.java,v 1.105 2012/08/18 00:00:05 mal Exp $");
-    }
+        final int n_tests=100000;
+        //testRoots(2,n_tests,r,eps);
+        //testRoots(3,n_tests,r,eps);
+        testRoots(4,n_tests,r,eps);
+        final long t1=System.currentTimeMillis();
+        System.err.println("PolynomialRoot.main: "+n_tests+" tests OK done in "+(t1-t0)+" milliseconds. ver=$Id: PolynomialRoot.java,v 1.105 2012/08/18 00:00:05 mal Exp $");
+        System.out.println("PASSED");
+     } else {
+       System.out.println("PASS test for non-x86");
+     }
+   }
 
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/EscapeAnalysis/Test8020215.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8020215
+ * @summary Different execution plan when using JIT vs interpreter
+ * @run main Test8020215
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Test8020215 {
+    public static class NamedObject {
+        public int id;
+        public String name;
+        public NamedObject(int id, String name) {
+            this.id = id;
+            this.name = name;
+        }
+    }
+
+    public static class NamedObjectList {
+        public List<NamedObject> namedObjectList = new ArrayList<NamedObject>();
+
+        public NamedObject getBest(int id) {
+            NamedObject bestObject = null;
+            for (NamedObject o : namedObjectList) {
+                bestObject = id==o.id ? getBetter(bestObject, o) : bestObject;
+            }
+            return (bestObject != null) ? bestObject : null;
+        }
+
+        private static NamedObject getBetter(NamedObject p1, NamedObject p2) {
+            return (p1 == null) ? p2 : (p2 == null) ? p1 : (p2.name.compareTo(p1.name) >= 0) ? p2 : p1;
+        }
+    }
+
+    static void test(NamedObjectList b, int i) {
+        NamedObject x = b.getBest(2);
+        // test
+        if (x == null) {
+            throw new RuntimeException("x should never be null here! (i=" + i + ")");
+        }
+    }
+
+    public static void main(String[] args) {
+        // setup
+        NamedObjectList b = new NamedObjectList();
+        for (int i = 0; i < 10000; i++) {
+            b.namedObjectList.add(new NamedObject(1, "2012-12-31"));
+        }
+        b.namedObjectList.add(new NamedObject(2, "2013-12-31"));
+
+        // execution
+        for (int i = 0; i < 12000; i++) {
+            test(b, i);
+        }
+        System.out.println("PASSED");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/codecache/CheckUpperLimit.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8015635
+ * @summary Test ensures that the ReservedCodeCacheSize is at most MAXINT
+ * @library /testlibrary
+ *
+ */
+import com.oracle.java.testlibrary.*;
+
+public class CheckUpperLimit {
+  public static void main(String[] args) throws Exception {
+    ProcessBuilder pb;
+    OutputAnalyzer out;
+
+    pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2048m", "-version");
+    out = new OutputAnalyzer(pb.start());
+    out.shouldHaveExitValue(0);
+
+    pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
+    out = new OutputAnalyzer(pb.start());
+    out.shouldContain("Invalid ReservedCodeCacheSize=");
+    out.shouldHaveExitValue(1);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/cpuflags/RestoreMXCSR.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8020433
+ * @summary Crash when using -XX:+RestoreMXCSROnJNICalls
+ * @library /testlibrary
+ *
+ */
+import com.oracle.java.testlibrary.*;
+
+public class RestoreMXCSR {
+  public static void main(String[] args) throws Exception {
+    ProcessBuilder pb;
+    OutputAnalyzer out;
+
+    pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version");
+    out = new OutputAnalyzer(pb.start());
+    out.shouldHaveExitValue(0);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/membars/DekkerTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2013 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
+ * 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 8007898
+ * @summary Incorrect optimization of Memory Barriers in Matcher::post_store_load_barrier().
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest
+ * @author Martin Doerr martin DOT doerr AT sap DOT com
+ *
+ * Run 3 times since the failure is intermittent.
+ */
+
+public class DekkerTest {
+
+    /*
+      Read After Write Test (basically a simple Dekker test with volatile variables)
+      Derived from the original jcstress test, available at:
+        http://hg.openjdk.java.net/code-tools/jcstress/file/6c339a5aa00d/
+        tests-custom/src/main/java/org/openjdk/jcstress/tests/volatiles/DekkerTest.java
+     */
+
+    static final int ITERATIONS = 1000000;
+
+    static class TestData {
+        public volatile int a;
+        public volatile int b;
+    }
+
+    static class ResultData {
+        public int a;
+        public int b;
+    }
+
+    TestData[]   testDataArray;
+    ResultData[] results;
+
+    volatile boolean start;
+
+    public DekkerTest() {
+        testDataArray = new TestData[ITERATIONS];
+        results = new ResultData[ITERATIONS];
+        for (int i = 0; i < ITERATIONS; ++i) {
+            testDataArray[i] = new TestData();
+            results[i] = new ResultData();
+        }
+        start = false;
+    }
+
+    public void reset() {
+        for (int i = 0; i < ITERATIONS; ++i) {
+            testDataArray[i].a = 0;
+            testDataArray[i].b = 0;
+            results[i].a = 0;
+            results[i].b = 0;
+        }
+        start = false;
+    }
+
+    int actor1(TestData t) {
+        t.a = 1;
+        return t.b;
+    }
+
+    int actor2(TestData t) {
+        t.b = 1;
+        return t.a;
+    }
+
+    class Runner1 extends Thread {
+        public void run() {
+            do {} while (!start);
+            for (int i = 0; i < ITERATIONS; ++i) {
+                results[i].a = actor1(testDataArray[i]);
+            }
+        }
+    }
+
+    class Runner2 extends Thread {
+        public void run() {
+            do {} while (!start);
+            for (int i = 0; i < ITERATIONS; ++i) {
+                results[i].b = actor2(testDataArray[i]);
+            }
+        }
+    }
+
+    void testRunner() {
+        Thread thread1 = new Runner1();
+        Thread thread2 = new Runner2();
+        thread1.start();
+        thread2.start();
+        do {} while (!thread1.isAlive());
+        do {} while (!thread2.isAlive());
+        start = true;
+        Thread.yield();
+        try {
+            thread1.join();
+            thread2.join();
+        } catch (InterruptedException e) {
+            System.out.println("interrupted!");
+            System.exit(1);
+        }
+    }
+
+    boolean printResult() {
+        int[] count = new int[4];
+        for (int i = 0; i < ITERATIONS; ++i) {
+            int event_kind = (results[i].a << 1) + results[i].b;
+            ++count[event_kind];
+        }
+        if (count[0] == 0 && count[3] == 0) {
+            System.out.println("[not interesting]");
+            return false; // not interesting
+        }
+        String error = (count[0] == 0) ? " ok" : " disallowed!";
+        System.out.println("[0,0] " + count[0] + error);
+        System.out.println("[0,1] " + count[1]);
+        System.out.println("[1,0] " + count[2]);
+        System.out.println("[1,1] " + count[3]);
+        return (count[0] != 0);
+    }
+
+    public static void main(String args[]) {
+        DekkerTest test = new DekkerTest();
+        final int runs = 30;
+        int failed = 0;
+        for (int c = 0; c < runs; ++c) {
+            test.testRunner();
+            if (test.printResult()) {
+                failed++;
+            }
+            test.reset();
+        }
+        if (failed > 0) {
+            throw new InternalError("FAILED. Got " + failed + " failed ITERATIONS");
+        }
+        System.out.println("PASSED.");
+    }
+
+}
--- a/hotspot/test/runtime/6888954/vmerrors.sh	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/test/runtime/6888954/vmerrors.sh	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,6 @@
 # @test
 # @bug 6888954
+# @bug 8015884
 # @summary exercise HotSpot error handling code
 # @author John Coomes
 # @run shell vmerrors.sh
@@ -27,9 +28,24 @@
 rc=0
 
 assert_re='(assert|guarantee)[(](str|num).*failed: *'
+# for bad_data_ptr_re:
+# EXCEPTION_ACCESS_VIOLATION - Win-*
+# SIGILL - MacOS X
+# SIGSEGV - Linux-*, Solaris SPARC-*, Solaris X86-*
+#
+bad_data_ptr_re='(SIGILL|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
+#
+# for bad_func_ptr_re:
+# EXCEPTION_ACCESS_VIOLATION - Win-*
+# SIGBUS - Solaris SPARC-64
+# SIGSEGV - Linux-*, Solaris SPARC-32, Solaris X86-*
+#
+# Note: would like to use "pc=0x00*0f," in the pattern, but Solaris SPARC-*
+# gets its signal at a PC in test_error_handler().
+#
+bad_func_ptr_re='(SIGBUS|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
 guarantee_re='guarantee[(](str|num).*failed: *'
 fatal_re='fatal error: *'
-signal_re='(SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
 tail_1='.*expected null'
 tail_2='.*num='
 
@@ -39,8 +55,9 @@
     "${fatal_re}${tail_1}"     "${fatal_re}${tail_2}"     \
     "${fatal_re}.*truncated"   "ChunkPool::allocate"      \
     "ShouldNotCall"            "ShouldNotReachHere"       \
-    "Unimplemented"            "$signal_re"
-    
+    "Unimplemented"            "$bad_data_ptr_re"         \
+    "$bad_func_ptr_re"
+
 do
     i2=$i
     [ $i -lt 10 ] && i2=0$i
--- a/hotspot/test/runtime/8001071/Test8001071.sh	Fri Jul 26 10:12:14 2013 +0200
+++ b/hotspot/test/runtime/8001071/Test8001071.sh	Fri Jul 26 14:07:32 2013 -0700
@@ -2,21 +2,21 @@
 
 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
+#
 # This code is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 only, as
 # published by the Free Software Foundation.
-
+#
 # This code is distributed in the hope that it will be useful, but WITHOUT
 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 # version 2 for more details (a copy is included in the LICENSE file that
 # accompanied this code).
-
+#
 # You should have received a copy of the GNU General Public License version
 # 2 along with this work; if not, write to the Free Software Foundation,
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
+#
 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 # or visit www.oracle.com if you need additional information or have any
 # questions.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/jsig/Test8017498.sh	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+#
+#  Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+#  This code is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License version 2 only, as
+#  published by the Free Software Foundation.
+#
+#  This code is distributed in the hope that it will be useful, but WITHOUT
+#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#  version 2 for more details (a copy is included in the LICENSE file that
+#  accompanied this code).
+#
+#  You should have received a copy of the GNU General Public License version
+#  2 along with this work; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+#  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+#  or visit www.oracle.com if you need additional information or have any
+#  questions.
+#
+
+##
+## @test Test8017498.sh
+## @bug 8017498
+## @bug 8020791
+## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX
+## @run shell/timeout=30 Test8017498.sh
+##
+
+if [ "${TESTSRC}" = "" ]
+then
+  TESTSRC=${PWD}
+  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
+fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  Linux)
+    echo "Testing on Linux"
+    if [ "$VM_BITS" = "64" ]
+    then
+        MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}amd64${FS}libjsig.so
+    else
+        MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}i386${FS}libjsig.so
+    fi
+    echo MY_LD_PRELOAD = ${MY_LD_PRELOAD}
+    ;;
+  *)
+    echo "Test passed; only valid for Linux"
+    exit 0;
+    ;;
+esac
+
+THIS_DIR=.
+
+cp ${TESTSRC}${FS}*.java ${THIS_DIR}
+${TESTJAVA}${FS}bin${FS}javac *.java
+
+gcc -DLINUX -fPIC -shared \
+    -o ${TESTSRC}${FS}libTestJNI.so \
+    -I${TESTJAVA}${FS}include \
+    -I${TESTJAVA}${FS}include${FS}linux \
+    ${TESTSRC}${FS}TestJNI.c
+if [ $? != 0 ]
+then
+    echo "WARNING: the gcc command failed." 2>&1
+fi
+
+# run the java test in the background
+cmd="LD_PRELOAD=$MY_LD_PRELOAD \
+    ${TESTJAVA}${FS}bin${FS}java \
+    -Djava.library.path=${TESTSRC}${FS} -server TestJNI 100"
+echo "$cmd > test.out 2>&1"
+eval $cmd > test.out 2>&1
+
+grep "old handler" test.out > ${NULL}
+if [ $? = 0 ]
+then
+    echo "Test Passed"
+    exit 0
+fi
+
+echo "Test Failed"
+exit 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/jsig/TestJNI.c	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#define _GNU_SOURCE // for the definition of REG_RIP in ucontext.h
+#include <stdio.h>
+#include <jni.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void sig_handler(int sig, siginfo_t *info, ucontext_t *context) {
+    int thrNum;
+
+    printf( " HANDLER (1) " );
+    // Move forward RIP to skip failing instruction
+    context->uc_mcontext.gregs[REG_RIP] += 6;
+}
+
+JNIEXPORT void JNICALL Java_TestJNI_doSomething(JNIEnv *env, jclass klass, jint val) {
+    struct sigaction act;
+    struct sigaction oact;
+
+    act.sa_flags = SA_ONSTACK|SA_RESTART|SA_SIGINFO;
+    sigfillset(&act.sa_mask);
+    act.sa_handler = SIG_DFL;
+    act.sa_sigaction = (void (*)())sig_handler;
+    sigaction(0x20+val, &act, &oact);
+
+    printf( " doSomething(%d) " , val);
+    printf( " old handler = %p " , oact.sa_handler);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/jsig/TestJNI.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class TestJNI {
+    static {
+        System.loadLibrary("TestJNI");
+    }
+    public static native void doSomething(int val);
+    public static void main(String[] args) {
+        int intArg = 43;
+        if (args.length > 0) {
+            try {
+                intArg = Integer.parseInt(args[0]);
+            } catch (NumberFormatException e) {
+                System.err.println("arg " + args[0] + " must be an integer");
+                System.exit(1);
+            }
+        }
+        TestJNI.doSomething(intArg);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7162400
+ * @key regression
+ * @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
+ * @library /testlibrary
+ * @compile AttachWithStalePidFileTarget.java
+ * @run main AttachWithStalePidFile
+ */
+
+import com.oracle.java.testlibrary.*;
+import com.sun.tools.attach.VirtualMachine;
+import sun.tools.attach.HotSpotVirtualMachine;
+import java.lang.reflect.Field;
+import java.nio.file.*;
+import java.nio.file.attribute.*;
+import java.io.*;
+
+public class AttachWithStalePidFile {
+  public static void main(String... args) throws Exception {
+
+    // this test is only valid on non-Windows platforms
+    if(Platform.isWindows()) {
+      System.out.println("This test is only valid on non-Windows platforms.");
+      return;
+    }
+
+    // Since there might be stale pid-files owned by different
+    // users on the system we may need to retry the test in case we
+    // are unable to remove the existing file.
+    int retries = 5;
+    while(!runTest() && --retries > 0);
+
+    if(retries == 0) {
+      throw new RuntimeException("Test failed after 5 retries. " +
+        "Remove any /tmp/.java_pid* files and retry.");
+    }
+  }
+
+  public static boolean runTest() throws Exception {
+    ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+      "-XX:+UnlockDiagnosticVMOptions", "-XX:+PauseAtStartup", "AttachWithStalePidFileTarget");
+    Process target = pb.start();
+    Path pidFile = null;
+
+    try {
+      int pid = getUnixProcessId(target);
+
+      // create the stale .java_pid file. use hard-coded /tmp path as in th VM
+      pidFile = createJavaPidFile(pid);
+      if(pidFile == null) {
+        return false;
+      }
+
+      // wait for vm.paused file to be created and delete it once we find it.
+      waitForAndResumeVM(pid);
+
+      // unfortunately there's no reliable way to know the VM is ready to receive the
+      // attach request so we have to do an arbitrary sleep.
+      Thread.sleep(5000);
+
+      HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
+      BufferedReader remoteDataReader = new BufferedReader(new InputStreamReader(vm.remoteDataDump()));
+      String line = null;
+      while((line = remoteDataReader.readLine()) != null);
+
+      vm.detach();
+      return true;
+    }
+    finally {
+      target.destroy();
+      target.waitFor();
+
+      if(pidFile != null && Files.exists(pidFile)) {
+        Files.delete(pidFile);
+      }
+    }
+  }
+
+  private static Path createJavaPidFile(int pid) throws Exception {
+    Path pidFile = Paths.get("/tmp/.java_pid" + pid);
+    if(Files.exists(pidFile)) {
+      try {
+        Files.delete(pidFile);
+      }
+      catch(FileSystemException e) {
+        if(e.getReason().equals("Operation not permitted")) {
+          System.out.println("Unable to remove exisiting stale PID file" + pidFile);
+          return null;
+        }
+        throw e;
+      }
+    }
+    return Files.createFile(pidFile,
+      PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------")));
+  }
+
+  private static void waitForAndResumeVM(int pid) throws Exception {
+    Path pauseFile = Paths.get("vm.paused." + pid);
+    int retries = 60;
+    while(!Files.exists(pauseFile) && --retries > 0) {
+      Thread.sleep(1000);
+    }
+    if(retries == 0) {
+      throw new RuntimeException("Timeout waiting for VM to start. " +
+        "vm.paused file not created within 60 seconds.");
+    }
+    Files.delete(pauseFile);
+  }
+
+  private static int getUnixProcessId(Process unixProcess) throws Exception {
+    Field pidField = unixProcess.getClass().getDeclaredField("pid");
+    pidField.setAccessible(true);
+    return (Integer)pidField.get(unixProcess);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/serviceability/attach/AttachWithStalePidFileTarget.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+public class AttachWithStalePidFileTarget {
+  public static void main(String... args) throws Exception {
+    Thread.sleep(2*60*1000);
+  }
+}
--- a/jaxp/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -219,3 +219,6 @@
 b8c5f4b6f0fffb44618fc609a584953c4ed67c0b jdk8-b95
 6121efd299235b057f3de94b0a4158c388c2907c jdk8-b96
 6c830db28d21108f32af990ecf4d80a75887980d jdk8-b97
+15e5bb51bc0cd89304dc2f7f29b4c8002e632353 jdk8-b98
+adf49c3ef83c160d53ece623049b2cdccaf78fc7 jdk8-b99
+5d1974c1d7b9a86431bc253dc5a6a52d4586622e jdk8-b100
--- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java	Fri Jul 26 14:07:32 2013 -0700
@@ -73,13 +73,39 @@
      * Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true
      */
     public static final String EXTERNAL_ACCESS_DEFAULT_FSP = "";
-    /**
-     * JDK version by which the default is to restrict external connection
-     */
-    public static final int RESTRICT_BY_DEFAULT_JDK_VERSION = 8;
+
     /**
      * FEATURE_SECURE_PROCESSING (FSP) is false by default
      */
     public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
 
+    public static final String XML_SECURITY_PROPERTY_MANAGER =
+            ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager";
+
+    /**
+     * Check if we're in jdk8 or above
+     */
+    public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
+
+    /*
+     * Check the version of the current JDK against that specified in the
+     * parameter
+     *
+     * There is a proposal to change the java version string to:
+     * MAJOR.MINOR.FU.CPU.PSU-BUILDNUMBER_BUGIDNUMBER_OPTIONAL
+     * This method would work with both the current format and that proposed
+     *
+     * @param compareTo a JDK version to be compared to
+     * @return true if the current version is the same or above that represented
+     * by the parameter
+     */
+    public static boolean isJavaVersionAtLeast(int compareTo) {
+        String javaVersion = SecuritySupport.getSystemProperty("java.version");
+        String versions[] = javaVersion.split("\\.", 3);
+        if (Integer.parseInt(versions[0]) >= compareTo ||
+            Integer.parseInt(versions[1]) >= compareTo) {
+            return true;
+        }
+        return false;
+    }
 } // class Constants
--- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/SecuritySupport.java	Fri Jul 26 14:07:32 2013 -0700
@@ -229,7 +229,8 @@
      * @return the name of the protocol if rejected, null otherwise
      */
     public static String checkAccess(String systemId, String allowedProtocols, String accessAny) throws IOException {
-        if (systemId == null || allowedProtocols.equalsIgnoreCase(accessAny)) {
+        if (systemId == null || (allowedProtocols != null &&
+                allowedProtocols.equalsIgnoreCase(accessAny))) {
             return null;
         }
 
@@ -262,6 +263,9 @@
      * @return true if the protocol is in the list
      */
     private static boolean isProtocolAllowed(String protocol, String allowedProtocols) {
+         if (allowedProtocols == null) {
+             return false;
+         }
          String temp[] = allowedProtocols.split(",");
          for (String t : temp) {
              t = t.trim();
@@ -273,18 +277,16 @@
      }
 
     /**
-     * Read from $java.home/lib/jaxp.properties for the specified property
+     * Read JAXP system property in this order: system property,
+     * $java.home/lib/jaxp.properties if the system property is not specified
      *
      * @param propertyId the Id of the property
      * @return the value of the property
      */
-    public static String getDefaultAccessProperty(String sysPropertyId, String defaultVal) {
-        String accessExternal = SecuritySupport.getSystemProperty(sysPropertyId);
+    public static String getJAXPSystemProperty(String sysPropertyId) {
+        String accessExternal = getSystemProperty(sysPropertyId);
         if (accessExternal == null) {
             accessExternal = readJAXPProperty(sysPropertyId);
-            if (accessExternal == null) {
-                accessExternal = defaultVal;
-            }
         }
         return accessExternal;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.org.apache.xalan.internal.utils;
+
+
+import com.sun.org.apache.xalan.internal.XalanConstants;
+import javax.xml.XMLConstants;
+
+/**
+ * This class manages security related properties
+ *
+ */
+public final class XMLSecurityPropertyManager {
+
+    /**
+     * States of the settings of a property, in the order: default value, value
+     * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
+     * properties, and jaxp api properties
+     */
+    public static enum State {
+        //this order reflects the overriding order
+        DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
+    }
+
+    /**
+     * Limits managed by the security manager
+     */
+    public static enum Property {
+        ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD,
+                XalanConstants.EXTERNAL_ACCESS_DEFAULT),
+        ACCESS_EXTERNAL_STYLESHEET(XMLConstants.ACCESS_EXTERNAL_STYLESHEET,
+                XalanConstants.EXTERNAL_ACCESS_DEFAULT);
+
+        final String name;
+        final String defaultValue;
+
+        Property(String name, String value) {
+            this.name = name;
+            this.defaultValue = value;
+        }
+
+        public boolean equalsName(String propertyName) {
+            return (propertyName == null) ? false : name.equals(propertyName);
+        }
+
+        String defaultValue() {
+            return defaultValue;
+        }
+    }
+
+
+    /**
+     * Values of the properties as defined in enum Properties
+     */
+    private final String[] values;
+    /**
+     * States of the settings for each property in Properties above
+     */
+    private State[] states = {State.DEFAULT, State.DEFAULT};
+
+    /**
+     * Default constructor. Establishes default values
+     */
+    public XMLSecurityPropertyManager() {
+        values = new String[Property.values().length];
+        for (Property property : Property.values()) {
+            values[property.ordinal()] = property.defaultValue();
+        }
+        //read system properties or jaxp.properties
+        readSystemProperties();
+    }
+
+    /**
+     * Set the value for a specific property.
+     *
+     * @param property the property
+     * @param state the state of the property
+     * @param value the value of the property
+     */
+    public void setValue(Property property, State state, String value) {
+        //only update if it shall override
+        if (state.compareTo(states[property.ordinal()]) >= 0) {
+            values[property.ordinal()] = value;
+            states[property.ordinal()] = state;
+        }
+    }
+
+    /**
+     * Set the value of a property by its index
+     * @param index the index of the property
+     * @param state the state of the property
+     * @param value the value of the property
+     */
+    public void setValue(int index, State state, String value) {
+        //only update if it shall override
+        if (state.compareTo(states[index]) >= 0) {
+            values[index] = value;
+            states[index] = state;
+        }
+    }
+    /**
+     * Return the value of the specified property
+     *
+     * @param property the property
+     * @return the value of the property
+     */
+    public String getValue(Property property) {
+        return values[property.ordinal()];
+    }
+
+    /**
+     * Return the value of a property by its ordinal
+     * @param index the index of a property
+     * @return value of a property
+     */
+    public String getValueByIndex(int index) {
+        return values[index];
+    }
+
+    /**
+     * Get the index by property name
+     * @param propertyName property name
+     * @return the index of the property if found; return -1 if not
+     */
+    public int getIndex(String propertyName){
+        for (Property property : Property.values()) {
+            if (property.equalsName(propertyName)) {
+                //internally, ordinal is used as index
+                return property.ordinal();
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Read from system properties, or those in jaxp.properties
+     */
+    private void readSystemProperties() {
+        getSystemProperty(Property.ACCESS_EXTERNAL_DTD,
+                XalanConstants.SP_ACCESS_EXTERNAL_DTD);
+        getSystemProperty(Property.ACCESS_EXTERNAL_STYLESHEET,
+                XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET);
+    }
+
+    /**
+     * Read from system properties, or those in jaxp.properties
+     *
+     * @param property the property
+     * @param systemProperty the name of the system property
+     */
+    private void getSystemProperty(Property property, String systemProperty) {
+        try {
+            String value = SecuritySupport.getSystemProperty(systemProperty);
+            if (value != null) {
+                values[property.ordinal()] = value;
+                states[property.ordinal()] = State.SYSTEMPROPERTY;
+                return;
+            }
+
+            value = SecuritySupport.readJAXPProperty(systemProperty);
+            if (value != null) {
+                values[property.ordinal()] = value;
+                states[property.ordinal()] = State.JAXPDOTPROPERTIES;
+            }
+        } catch (NumberFormatException e) {
+            //invalid setting ignored
+        }
+    }
+}
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,6 +27,9 @@
 import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
 import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
 import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
+import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager;
+import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property;
+import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.State;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
@@ -215,11 +218,13 @@
      * protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.
      */
     private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
+
      /**
      * protocols allowed for external DTD references in source file and/or stylesheet.
      */
     private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
 
+    private XMLSecurityPropertyManager _xmlSecurityPropertyMgr;
 
     /**
      * javax.xml.transform.sax.TransformerFactory implementation.
@@ -235,15 +240,16 @@
     private TransformerFactoryImpl(boolean useServicesMechanism) {
         this._useServicesMechanism = useServicesMechanism;
 
-        String defaultAccess = XalanConstants.EXTERNAL_ACCESS_DEFAULT;
         if (System.getSecurityManager() != null) {
             _isSecureMode = true;
             _isNotSecureProcessing = false;
         }
-        _accessExternalStylesheet =  SecuritySupport.getDefaultAccessProperty(
-                XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET, defaultAccess);
-        _accessExternalDTD =  SecuritySupport.getDefaultAccessProperty(
-                XalanConstants.SP_ACCESS_EXTERNAL_DTD, defaultAccess);
+
+        _xmlSecurityPropertyMgr = new XMLSecurityPropertyManager();
+        _accessExternalDTD = _xmlSecurityPropertyMgr.getValue(
+                Property.ACCESS_EXTERNAL_DTD);
+        _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue(
+                Property.ACCESS_EXTERNAL_STYLESHEET);
     }
 
     /**
@@ -306,11 +312,10 @@
             else
               return Boolean.FALSE;
         }
-        else if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) {
-            return _accessExternalStylesheet;
-        }
-        else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) {
-            return _accessExternalDTD;
+
+        int index = _xmlSecurityPropertyMgr.getIndex(name);
+        if (index > -1) {
+            return _xmlSecurityPropertyMgr.getValueByIndex(index);
         }
 
         // Throw an exception for all other attributes
@@ -413,12 +418,15 @@
                 return;
             }
         }
-        else if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) {
-            _accessExternalStylesheet = (String)value;
-            return;
-        }
-        else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) {
-            _accessExternalDTD = (String)value;
+
+        int index = _xmlSecurityPropertyMgr.getIndex(name);
+        if (index > -1) {
+            _xmlSecurityPropertyMgr.setValue(index,
+                    State.APIPROPERTY, (String)value);
+            _accessExternalDTD = _xmlSecurityPropertyMgr.getValue(
+                    Property.ACCESS_EXTERNAL_DTD);
+            _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue(
+                    Property.ACCESS_EXTERNAL_STYLESHEET);
             return;
         }
 
@@ -466,11 +474,18 @@
             }
             _isNotSecureProcessing = !value;
 
-            // set restriction, allowing no access to external stylesheet
-            if (value) {
-                _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP;
-                _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP;
+            // set external access restriction when FSP is explicitly set
+            if (value && XalanConstants.IS_JDK8_OR_ABOVE) {
+                _xmlSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD,
+                        State.FSP, XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                _xmlSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_STYLESHEET,
+                        State.FSP, XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                _accessExternalDTD = _xmlSecurityPropertyMgr.getValue(
+                        Property.ACCESS_EXTERNAL_DTD);
+                _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue(
+                        Property.ACCESS_EXTERNAL_STYLESHEET);
             }
+
             return;
         }
         else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -33,7 +33,7 @@
 import com.sun.org.apache.xerces.internal.util.PropertyState;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
 import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
@@ -156,13 +156,9 @@
     protected static final String SCHEMA_DV_FACTORY =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
 
-    /** Property identifier: access to external dtd */
-    protected static final String ACCESS_EXTERNAL_DTD =
-        XMLConstants.ACCESS_EXTERNAL_DTD;
-
-    /** Property identifier: access to external schema  */
-    protected static final String ACCESS_EXTERNAL_SCHEMA =
-        XMLConstants.ACCESS_EXTERNAL_SCHEMA;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     //
     // Data
@@ -283,8 +279,7 @@
             JAXP_SCHEMA_LANGUAGE,
             DTD_VALIDATOR_FACTORY_PROPERTY,
             SCHEMA_DV_FACTORY,
-            ACCESS_EXTERNAL_DTD,
-            ACCESS_EXTERNAL_SCHEMA
+            XML_SECURITY_PROPERTY_MANAGER
         };
         addRecognizedProperties(recognizedProperties);
 
@@ -318,14 +313,8 @@
         fValidationManager = createValidationManager();
         setProperty(VALIDATION_MANAGER, fValidationManager);
 
-        //For DOM, the secure feature is set to true by default
-        String accessExternal =  SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT);
-        setProperty(ACCESS_EXTERNAL_DTD, accessExternal);
-
-        accessExternal =  SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT);
-        setProperty(ACCESS_EXTERNAL_SCHEMA, accessExternal);
+        setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
+                new XMLSecurityPropertyManager());
 
         // add message formatters
         if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java	Fri Jul 26 14:07:32 2013 -0700
@@ -184,6 +184,9 @@
     public static final String ORACLE_JAXP_PROPERTY_PREFIX =
         "http://www.oracle.com/xml/jaxp/properties/";
 
+    public static final String XML_SECURITY_PROPERTY_MANAGER =
+            ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager";
+
     //System Properties corresponding to ACCESS_EXTERNAL_* properties
     public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD";
     public static final String SP_ACCESS_EXTERNAL_SCHEMA = "javax.xml.accessExternalSchema";
@@ -194,16 +197,17 @@
      * Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true
      */
     public static final String EXTERNAL_ACCESS_DEFAULT_FSP = "";
-    /**
-     * JDK version by which the default is to restrict external connection
-     */
-    public static final int RESTRICT_BY_DEFAULT_JDK_VERSION = 8;
 
     /**
      * FEATURE_SECURE_PROCESSING (FSP) is true by default
      */
     public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
 
+    /**
+     * Check if we're in jdk8 or above
+     */
+    public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
+
     //
     // DOM features
     //
@@ -697,6 +701,27 @@
         ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
     } // getXercesProperties():Enumeration
 
+    /*
+     * Check the version of the current JDK against that specified in the
+     * parameter
+     *
+     * There is a proposal to change the java version string to:
+     * MAJOR.MINOR.FU.CPU.PSU-BUILDNUMBER_BUGIDNUMBER_OPTIONAL
+     * This method would work with both the current format and that proposed
+     *
+     * @param compareTo a JDK version to be compared to
+     * @return true if the current version is the same or above that represented
+     * by the parameter
+     */
+    public static boolean isJavaVersionAtLeast(int compareTo) {
+        String javaVersion = SecuritySupport.getSystemProperty("java.version");
+        String versions[] = javaVersion.split("\\.", 3);
+        if (Integer.parseInt(versions[0]) >= compareTo ||
+            Integer.parseInt(versions[1]) >= compareTo) {
+            return true;
+        }
+        return false;
+    }
 
     //
     // Classes
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,10 +25,9 @@
 
 package com.sun.org.apache.xerces.internal.impl;
 
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.xml.internal.stream.StaxEntityResolverWrapper;
 import java.util.HashMap;
-import javax.xml.XMLConstants;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLResolver;
@@ -51,15 +50,14 @@
 
     private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning";
 
-
-    /** Property identifier: access to external dtd */
-    protected static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
-    /** Property identifier: access to external schema  */
-    protected static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     HashMap supportedProps = new HashMap();
 
+    private XMLSecurityPropertyManager fSecurityPropertyMgr;
+
     public static final int CONTEXT_READER = 1;
     public static final int CONTEXT_WRITER = 2;
 
@@ -84,6 +82,7 @@
 
         HashMap properties = propertyManager.getProperties();
         supportedProps.putAll(properties);
+        fSecurityPropertyMgr = (XMLSecurityPropertyManager)getProperty(XML_SECURITY_PROPERTY_MANAGER);
     }
 
     private HashMap getProperties(){
@@ -125,14 +124,8 @@
         supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE, new Boolean(false));
         supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE, new Boolean(false));
 
-        //For DOM/SAX, the secure feature is set to true by default
-        String accessExternal =  SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT);
-        supportedProps.put(ACCESS_EXTERNAL_DTD, accessExternal);
-
-        accessExternal =  SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT);
-        supportedProps.put(ACCESS_EXTERNAL_SCHEMA, accessExternal);
+        fSecurityPropertyMgr = new XMLSecurityPropertyManager();
+        supportedProps.put(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
     }
 
     private void initWriterProps(){
@@ -148,7 +141,8 @@
      * }
      */
     public boolean containsProperty(String property){
-        return supportedProps.containsKey(property) ;
+        return supportedProps.containsKey(property) ||
+                (fSecurityPropertyMgr!=null && fSecurityPropertyMgr.getIndex(property) > -1) ;
     }
 
     public Object getProperty(String property){
@@ -174,7 +168,15 @@
             //add internal stax property
             supportedProps.put( Constants.XERCES_PROPERTY_PREFIX + Constants.STAX_ENTITY_RESOLVER_PROPERTY , new StaxEntityResolverWrapper((XMLResolver)value)) ;
         }
-        supportedProps.put(property, value ) ;
+
+        int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(property) : -1;
+        if (index > -1) {
+            fSecurityPropertyMgr.setValue(index,
+                    XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
+        } else {
+            supportedProps.put(property, value);
+        }
+
         if(equivalentProperty != null){
             supportedProps.put(equivalentProperty, value ) ;
         }
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -53,6 +53,7 @@
 import com.sun.org.apache.xerces.internal.util.SecurityManager;
 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
 import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.xml.internal.stream.Entity;
 import javax.xml.XMLConstants;
@@ -166,8 +167,9 @@
     protected static final String STANDARD_URI_CONFORMANT =
             Constants.XERCES_FEATURE_PREFIX +Constants.STANDARD_URI_CONFORMANT_FEATURE;
 
-    /** property identifier: access external dtd. */
-    protected static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     /** access external dtd: file protocol
      *  For DOM/SAX, the secure feature is set to true by default
@@ -199,7 +201,7 @@
         SYMBOL_TABLE,
                 ERROR_REPORTER,
                 ENTITY_MANAGER,
-                ACCESS_EXTERNAL_DTD
+                XML_SECURITY_PROPERTY_MANAGER
     };
 
     /** Property defaults. */
@@ -610,7 +612,10 @@
         dtdGrammarUtil = null;
 
         // JAXP 1.5 features and properties
-        fAccessExternalDTD = (String) componentManager.getProperty(ACCESS_EXTERNAL_DTD, EXTERNAL_ACCESS_DEFAULT);
+        XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
+                componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER, null);
+        fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
+
         fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false);
 
         //fEntityManager.test();
@@ -662,9 +667,10 @@
 
         dtdGrammarUtil = null;
 
-        // Oracle jdk feature
-        fAccessExternalDTD = (String) propertyManager.getProperty(ACCESS_EXTERNAL_DTD);
-
+         // JAXP 1.5 features and properties
+        XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
+                propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
+        fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
     } // reset(XMLComponentManager)
 
     /**
@@ -762,11 +768,10 @@
         }
 
         //JAXP 1.5 properties
-        if (propertyId.startsWith(Constants.JAXPAPI_PROPERTY_PREFIX)) {
-            if (propertyId.equals(ACCESS_EXTERNAL_DTD))
-            {
-                fAccessExternalDTD = (String)value;
-            }
+        if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER))
+        {
+            XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)value;
+            fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
         }
 
     } // setProperty(String,Object)
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java	Fri Jul 26 14:07:32 2013 -0700
@@ -31,6 +31,7 @@
 import com.sun.org.apache.xerces.internal.util.SecurityManager;
 import com.sun.org.apache.xerces.internal.util.URI;
 import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
@@ -166,8 +167,9 @@
     protected static final String PARSER_SETTINGS =
         Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
 
-    /** property identifier: access external dtd. */
-    protected static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     /** access external dtd: file protocol */
     static final String EXTERNAL_ACCESS_DEFAULT = Constants.EXTERNAL_ACCESS_DEFAULT;
@@ -203,7 +205,7 @@
                 VALIDATION_MANAGER,
                 BUFFER_SIZE,
                 SECURITY_MANAGER,
-                ACCESS_EXTERNAL_DTD
+                XML_SECURITY_PROPERTY_MANAGER
     };
 
     /** Property defaults. */
@@ -214,7 +216,7 @@
                 null,
                 new Integer(DEFAULT_BUFFER_SIZE),
                 null,
-                EXTERNAL_ACCESS_DEFAULT
+                null
     };
 
     private static final String XMLEntity = "[xml]".intern();
@@ -1421,7 +1423,8 @@
         fLoadExternalDTD = !((Boolean)propertyManager.getProperty(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.IGNORE_EXTERNAL_DTD)).booleanValue();
 
         // JAXP 1.5 feature
-        fAccessExternalDTD = (String) propertyManager.getProperty(ACCESS_EXTERNAL_DTD);
+        XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
+        fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
 
         // initialize state
         //fStandalone = false;
@@ -1485,7 +1488,11 @@
         fSecurityManager = (SecurityManager)componentManager.getProperty(SECURITY_MANAGER, null);
 
         // JAXP 1.5 feature
-        fAccessExternalDTD = (String) componentManager.getProperty(ACCESS_EXTERNAL_DTD, EXTERNAL_ACCESS_DEFAULT);
+        XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER, null);
+        if (spm == null) {
+            spm = new XMLSecurityPropertyManager();
+        }
+        fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
 
         //reset general state
         reset();
@@ -1641,11 +1648,10 @@
         }
 
         //JAXP 1.5 properties
-        if (propertyId.startsWith(Constants.JAXPAPI_PROPERTY_PREFIX)) {
-            if (propertyId.equals(ACCESS_EXTERNAL_DTD))
-            {
-                fAccessExternalDTD = (String)value;
-            }
+        if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER))
+        {
+            XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)value;
+            fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
         }
     }
 
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java	Fri Jul 26 14:07:32 2013 -0700
@@ -54,6 +54,7 @@
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
 import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
@@ -218,6 +219,10 @@
     protected static final String ENTITY_MANAGER =
         Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
 
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
+
     /** Property identifier: access to external dtd */
     public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
 
@@ -238,8 +243,7 @@
         SECURITY_MANAGER,
         LOCALE,
         SCHEMA_DV_FACTORY,
-        ACCESS_EXTERNAL_DTD,
-        ACCESS_EXTERNAL_SCHEMA
+        XML_SECURITY_PROPERTY_MANAGER
     };
 
     // Data
@@ -270,7 +274,6 @@
     private final CMNodeFactory fNodeFactory = new CMNodeFactory(); //component mgr will be set later
     private CMBuilder fCMBuilder;
     private XSDDescription fXSDDescription = new XSDDescription();
-    private String faccessExternalDTD = Constants.EXTERNAL_ACCESS_DEFAULT;
     private String faccessExternalSchema = Constants.EXTERNAL_ACCESS_DEFAULT;
 
     private Map fJAXPCache;
@@ -466,11 +469,9 @@
                 fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
             }
         }
-        else if (propertyId.equals(ACCESS_EXTERNAL_DTD)) {
-            faccessExternalDTD = (String) state;
-        }
-        else if (propertyId.equals(ACCESS_EXTERNAL_SCHEMA)) {
-            faccessExternalSchema = (String) state;
+        else if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER)) {
+            XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)state;
+            faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
         }
     } // setProperty(String, Object)
 
@@ -1066,8 +1067,8 @@
         fSchemaHandler.setGenerateSyntheticAnnotations(componentManager.getFeature(GENERATE_SYNTHETIC_ANNOTATIONS, false));
         fSchemaHandler.reset(componentManager);
 
-        faccessExternalDTD = (String) componentManager.getProperty(ACCESS_EXTERNAL_DTD);
-        faccessExternalSchema = (String) componentManager.getProperty(ACCESS_EXTERNAL_SCHEMA);
+        XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
+        faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
     }
 
     private void initGrammarBucket(){
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -233,11 +233,9 @@
     protected static final String SCHEMA_DV_FACTORY =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
 
-    /** property identifier: access external dtd. */
-    private static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
-    /** Property identifier: access to external schema */
-    private static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     protected static final String USE_SERVICE_MECHANISM = Constants.ORACLE_FEATURE_SERVICE_MECHANISM;
 
@@ -297,8 +295,7 @@
             JAXP_SCHEMA_SOURCE,
             JAXP_SCHEMA_LANGUAGE,
             SCHEMA_DV_FACTORY,
-            ACCESS_EXTERNAL_DTD,
-            ACCESS_EXTERNAL_SCHEMA
+            XML_SECURITY_PROPERTY_MANAGER
             };
 
     /** Property defaults. */
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Fri Jul 26 14:07:32 2013 -0700
@@ -78,6 +78,7 @@
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
 import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
 import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.QName;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
@@ -112,6 +113,7 @@
 import org.w3c.dom.Node;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
@@ -223,11 +225,9 @@
     protected static final String LOCALE =
         Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
 
-    /** property identifier: access external dtd. */
-    public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
-    /** Property identifier: access to external schema */
-    public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
+        /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     protected static final boolean DEBUG_NODE_POOL = false;
 
@@ -260,6 +260,7 @@
     protected SecurityManager fSecureProcessing = null;
 
     private String fAccessExternalSchema;
+    private String fAccessExternalDTD;
 
     // These tables correspond to the symbol spaces defined in the
     // spec.
@@ -2249,6 +2250,13 @@
                         }
                     }
                     catch (SAXException se) {}
+
+                    try {
+                        parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, fAccessExternalDTD);
+                    } catch (SAXNotRecognizedException exc) {
+                        System.err.println("Warning: " + parser.getClass().getName() + ": " +
+                                exc.getMessage());
+                    }
                 }
                 // If XML names and Namespace URIs are already internalized we
                 // can avoid running them through the SymbolTable.
@@ -3580,11 +3588,17 @@
         } catch (XMLConfigurationException e) {
         }
 
-        //For Schema validation, the secure feature is set to true by default
-        fSchemaParser.setProperty(ACCESS_EXTERNAL_DTD,
-                componentManager.getProperty(ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT));
-        fAccessExternalSchema = (String) componentManager.getProperty(
-                ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT);
+        XMLSecurityPropertyManager securityPropertyMgr = (XMLSecurityPropertyManager)
+                componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
+        //Passing on the setting to the parser
+        fSchemaParser.setProperty(XML_SECURITY_PROPERTY_MANAGER, securityPropertyMgr);
+
+        fAccessExternalDTD = securityPropertyMgr.getValue(
+                XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
+
+        fAccessExternalSchema = securityPropertyMgr.getValue(
+                XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
+
     } // reset(XMLComponentManager)
 
 
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -37,6 +37,9 @@
 import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer;
 import com.sun.org.apache.xerces.internal.parsers.DOMParser;
 import com.sun.org.apache.xerces.internal.util.SecurityManager;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.Property;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.State;
 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
@@ -97,12 +100,17 @@
     private static final String SECURITY_MANAGER =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
+
     /** property identifier: access external dtd. */
     public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
 
     /** Property identifier: access to external schema */
     public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
 
+
     private final DOMParser domParser;
     private final Schema grammar;
 
@@ -117,6 +125,8 @@
     /** Initial EntityResolver */
     private final EntityResolver fInitEntityResolver;
 
+    private XMLSecurityPropertyManager fSecurityPropertyMgr;
+
     DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Hashtable dbfAttrs, Hashtable features)
         throws SAXNotRecognizedException, SAXNotSupportedException {
         this(dbf, dbfAttrs, features, false);
@@ -160,23 +170,27 @@
             domParser.setFeature(XINCLUDE_FEATURE, true);
         }
 
+        fSecurityPropertyMgr = new XMLSecurityPropertyManager();
+        domParser.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
+
         // If the secure processing feature is on set a security manager.
         if (secureProcessing) {
             domParser.setProperty(SECURITY_MANAGER, new SecurityManager());
 
             /**
-             * By default, secure processing is set, no external access is allowed.
-             * However, we need to check if it is actively set on the factory since we
-             * allow the use of the System Property or jaxp.properties to override
-             * the default value
+             * If secure processing is explicitly set on the factory, the
+             * access properties will be set unless the corresponding
+             * System Properties or jaxp.properties are set
              */
             if (features != null) {
                 Object temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING);
                 if (temp != null) {
                     boolean value = ((Boolean) temp).booleanValue();
-                    if (value) {
-                        domParser.setProperty(ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
-                        domParser.setProperty(ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                    if (value && Constants.IS_JDK8_OR_ABOVE) {
+                        fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD,
+                                State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                        fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_SCHEMA,
+                                State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
                     }
                 }
             }
@@ -220,7 +234,7 @@
             setFeatures(features);
         }
 
-        // Set attributes
+        //setAttribute override those that may be set by other means
         setDocumentBuilderFactoryAttributes(dbfAttrs);
 
         // Initial EntityResolver
@@ -275,26 +289,32 @@
                             // spec when schema validation is enabled
                             domParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                         }
-                    }
-                        } else if(JAXP_SCHEMA_SOURCE.equals(name)){
-                        if( isValidating() ) {
-                                                String value=(String)dbfAttrs.get(JAXP_SCHEMA_LANGUAGE);
-                                                if(value !=null && W3C_XML_SCHEMA.equals(value)){
-                                        domParser.setProperty(name, val);
-                                                }else{
+                     }
+                 } else if(JAXP_SCHEMA_SOURCE.equals(name)){
+                    if( isValidating() ) {
+                        String value=(String)dbfAttrs.get(JAXP_SCHEMA_LANGUAGE);
+                        if(value !=null && W3C_XML_SCHEMA.equals(value)){
+                            domParser.setProperty(name, val);
+                        }else{
                             throw new IllegalArgumentException(
                                 DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
                                 "jaxp-order-not-supported",
                                 new Object[] {JAXP_SCHEMA_LANGUAGE, JAXP_SCHEMA_SOURCE}));
-                                                }
-                                        }
-                } else {
-                    // Let Xerces code handle the property
-                    domParser.setProperty(name, val);
-                                }
                         }
-                }
+                     }
+                  } else {
+                    int index = fSecurityPropertyMgr.getIndex(name);
+                    if (index > -1) {
+                        fSecurityPropertyMgr.setValue(index,
+                                XMLSecurityPropertyManager.State.APIPROPERTY, (String)val);
+                    } else {
+                        // Let Xerces code handle the property
+                        domParser.setProperty(name, val);
+                    }
+                  }
+             }
         }
+    }
 
     /**
      * Non-preferred: use the getDOMImplementation() method instead of this
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -36,6 +36,7 @@
 import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
 import com.sun.org.apache.xerces.internal.util.SecurityManager;
 import com.sun.org.apache.xerces.internal.util.Status;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
@@ -92,11 +93,9 @@
     private static final String SECURITY_MANAGER =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 
-    /** property identifier: access external dtd. */
-    public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
-    /** Property identifier: access to external schema */
-    public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     private final JAXPSAXParser xmlReader;
     private String schemaLanguage = null;     // null means DTD
@@ -113,6 +112,8 @@
     /** Initial EntityResolver */
     private final EntityResolver fInitEntityResolver;
 
+    private XMLSecurityPropertyManager fSecurityPropertyMgr;
+
     /**
      * Create a SAX parser with the associated features
      * @param features Hashtable of SAX features, may be null
@@ -149,6 +150,9 @@
             xmlReader.setFeature0(XINCLUDE_FEATURE, true);
         }
 
+        fSecurityPropertyMgr = new XMLSecurityPropertyManager();
+        xmlReader.setProperty0(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
+
         // If the secure processing feature is on set a security manager.
         if (secureProcessing) {
             xmlReader.setProperty0(SECURITY_MANAGER, new SecurityManager());
@@ -162,9 +166,12 @@
                 Object temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING);
                 if (temp != null) {
                     boolean value = ((Boolean) temp).booleanValue();
-                    if (value) {
-                        xmlReader.setProperty0(ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
-                        xmlReader.setProperty0(ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                    if (value && Constants.IS_JDK8_OR_ABOVE) {
+                        fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
+                                XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                        fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
+                                XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+
                     }
                 }
             }
@@ -530,14 +537,21 @@
                     return;
                 }
             }
-            if (!fInitProperties.containsKey(name)) {
-                fInitProperties.put(name, super.getProperty(name));
-            }
             /** Forward property to the schema validator if there is one. **/
             if (fSAXParser != null && fSAXParser.fSchemaValidator != null) {
                 setSchemaValidatorProperty(name, value);
             }
-            super.setProperty(name, value);
+            /** Check to see if the property is managed by the property manager **/
+            int index = fSAXParser.fSecurityPropertyMgr.getIndex(name);
+            if (index > -1) {
+                fSAXParser.fSecurityPropertyMgr.setValue(index,
+                        XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
+            } else {
+                if (!fInitProperties.containsKey(name)) {
+                    fInitProperties.put(name, super.getProperty(name));
+                }
+                super.setProperty(name, value);
+            }
         }
 
         public synchronized Object getProperty(String name)
@@ -550,6 +564,11 @@
                 // JAXP 1.2 support
                 return fSAXParser.schemaLanguage;
             }
+            int index = fSAXParser.fSecurityPropertyMgr.getIndex(name);
+            if (index > -1) {
+                return fSAXParser.fSecurityPropertyMgr.getValueByIndex(index);
+            }
+
             return super.getProperty(name);
         }
 
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java	Fri Jul 26 14:07:32 2013 -0700
@@ -177,11 +177,11 @@
         }
         config.setProperty(SYMBOL_TABLE, fComponentManager.getProperty(SYMBOL_TABLE));
         config.setProperty(VALIDATION_MANAGER, fComponentManager.getProperty(VALIDATION_MANAGER));
-        config.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,
-                fComponentManager.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD));
         config.setDocumentHandler(fSchemaValidator);
         config.setDTDHandler(null);
         config.setDTDContentModelHandler(null);
+        config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER,
+                fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER));
         fConfiguration = new SoftReference(config);
         return config;
     }
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -53,6 +53,7 @@
 import com.sun.org.apache.xerces.internal.util.URI;
 import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.Augmentations;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xni.QName;
@@ -134,6 +135,10 @@
     private static final String VALIDATION_MANAGER =
         Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
 
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
+
     //
     // Data
     //
@@ -686,8 +691,10 @@
                                catch (SAXException exc) {}
                            }
                            try {
+                               XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
+                                       fComponentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
                                reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,
-                                      fComponentManager.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD));
+                                       spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD));
                            } catch (SAXException exc) {
                                System.err.println("Warning: " + reader.getClass().getName() + ": " +
                                       exc.getMessage());
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java	Fri Jul 26 14:07:32 2013 -0700
@@ -45,7 +45,7 @@
 import com.sun.org.apache.xerces.internal.util.StAXInputSource;
 import com.sun.org.apache.xerces.internal.util.Status;
 import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
@@ -83,11 +83,10 @@
     private static final String SECURITY_MANAGER =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 
-    /** property identifier: access external dtd. */
-    public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
-    /** Property identifier: access to external schema  */
-    public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
 
     //
     // Data
@@ -111,6 +110,9 @@
     /** The SecurityManager. */
     private SecurityManager fSecurityManager;
 
+    /** The Security property manager. */
+    private XMLSecurityPropertyManager fSecurityPropertyMgr;
+
     /** The container for the real grammar pool. */
     private XMLGrammarPoolWrapper fXMLGrammarPoolWrapper;
 
@@ -120,6 +122,8 @@
      * Note the default value (false) is the safe option..
      */
     private final boolean fUseServicesMechanism;
+
+
     public XMLSchemaFactory() {
         this(true);
     }
@@ -140,13 +144,9 @@
         fSecurityManager = new SecurityManager();
         fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
 
-        //by default, the secure feature is set to true, otherwise the default would have been 'file'
-        String accessExternal = SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT);
-        fXMLSchemaLoader.setProperty(ACCESS_EXTERNAL_DTD, accessExternal);
-        accessExternal = SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT);
-        fXMLSchemaLoader.setProperty(ACCESS_EXTERNAL_SCHEMA, accessExternal);
+        fSecurityPropertyMgr = new XMLSecurityPropertyManager();
+        fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER,
+                fSecurityPropertyMgr);
     }
 
     /**
@@ -282,6 +282,7 @@
             schema = new EmptyXMLSchema();
         }
         propagateFeatures(schema);
+        propagateProperties(schema);
         return schema;
     }
 
@@ -366,8 +367,13 @@
             }
             if (value) {
                 fSecurityManager = new SecurityManager();
-                fXMLSchemaLoader.setProperty(ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
-                fXMLSchemaLoader.setProperty(ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+
+                if (Constants.IS_JDK8_OR_ABOVE) {
+                    fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
+                            XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                    fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
+                            XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                }
             } else {
                 fSecurityManager = null;
             }
@@ -414,7 +420,13 @@
                     "property-not-supported", new Object [] {name}));
         }
         try {
-            fXMLSchemaLoader.setProperty(name, object);
+            int index = fSecurityPropertyMgr.getIndex(name);
+            if (index > -1) {
+                fSecurityPropertyMgr.setValue(index,
+                        XMLSecurityPropertyManager.State.APIPROPERTY, (String)object);
+            } else {
+                fXMLSchemaLoader.setProperty(name, object);
+            }
         }
         catch (XMLConfigurationException e) {
             String identifier = e.getIdentifier();
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java	Fri Jul 26 14:07:32 2013 -0700
@@ -42,6 +42,7 @@
 import com.sun.org.apache.xerces.internal.util.SecurityManager;
 import com.sun.org.apache.xerces.internal.util.Status;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
@@ -107,6 +108,10 @@
     private static final String SECURITY_MANAGER =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 
+    /** Property identifier: security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
+
     /** Property identifier: symbol table. */
     private static final String SYMBOL_TABLE =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
@@ -123,12 +128,6 @@
     private static final String LOCALE =
         Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
 
-    /** property identifier: access external dtd. */
-    private static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
-    /** Property identifier: access to external schema  */
-    private static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
-
     //
     // Data
     //
@@ -184,6 +183,9 @@
     /** Stores the initial security manager. */
     private final SecurityManager fInitSecurityManager;
 
+    /** Stores the initial security property manager. */
+    private final XMLSecurityPropertyManager fSecurityPropertyMgr;
+
     //
     // User Objects
     //
@@ -250,8 +252,9 @@
         fComponents.put(SECURITY_MANAGER, fInitSecurityManager);
 
         //pass on properties set on SchemaFactory
-        setProperty(ACCESS_EXTERNAL_DTD, grammarContainer.getProperty(ACCESS_EXTERNAL_DTD));
-        setProperty(ACCESS_EXTERNAL_SCHEMA, grammarContainer.getProperty(ACCESS_EXTERNAL_SCHEMA));
+        fSecurityPropertyMgr = (XMLSecurityPropertyManager)
+                grammarContainer.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER);
+        setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
     }
 
     /**
@@ -309,6 +312,15 @@
                 throw new XMLConfigurationException(Status.NOT_ALLOWED, XMLConstants.FEATURE_SECURE_PROCESSING);
             }
             setProperty(SECURITY_MANAGER, value ? new SecurityManager() : null);
+
+            if (value && Constants.IS_JDK8_OR_ABOVE) {
+                fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
+                        XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
+                        XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
+                setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
+            }
+
             return;
         }
         fConfigUpdated = true;
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,6 +29,7 @@
 import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
 import com.sun.org.apache.xerces.internal.util.Status;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.XNIException;
 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
@@ -74,6 +75,10 @@
     protected static final String REPORT_WHITESPACE =
             Constants.SUN_SCHEMA_FEATURE_PREFIX + Constants.SUN_REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE;
 
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
+
     // recognized features:
     private static final String[] RECOGNIZED_FEATURES = {
         REPORT_WHITESPACE
@@ -579,6 +584,13 @@
        }
 
         try {
+            XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
+                    fConfiguration.getProperty(XML_SECURITY_PROPERTY_MANAGER);
+            int index = spm.getIndex(propertyId);
+            if (index > -1) {
+                return spm.getValueByIndex(index);
+            }
+
             return fConfiguration.getProperty(propertyId);
         }
         catch (XMLConfigurationException e) {
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java	Fri Jul 26 14:07:32 2013 -0700
@@ -22,8 +22,11 @@
 
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
 
 /**
  * This is the main Xerces SAX parser class. It uses the abstract SAX
@@ -120,4 +123,24 @@
 
     } // <init>(SymbolTable,XMLGrammarPool)
 
+    /**
+     * Sets the particular property in the underlying implementation of
+     * org.xml.sax.XMLReader.
+     */
+    public void setProperty(String name, Object value)
+        throws SAXNotRecognizedException, SAXNotSupportedException {
+        XMLSecurityPropertyManager spm = new XMLSecurityPropertyManager();
+        int index = spm.getIndex(name);
+        if (index > -1) {
+            /**
+             * this is a direct call to this parser, not a subclass since
+             * internally the support of this property is done through
+             * XMLSecurityPropertyManager
+             */
+            spm.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
+            super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, spm);
+        } else {
+            super.setProperty(name, value);
+        }
+    }
 } // class SAXParser
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java	Fri Jul 26 14:07:32 2013 -0700
@@ -20,12 +20,10 @@
 
 package com.sun.org.apache.xerces.internal.parsers;
 
-import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Locale;
-import java.util.Properties;
 import javax.xml.XMLConstants;
 
 import com.sun.org.apache.xerces.internal.impl.Constants;
@@ -53,9 +51,8 @@
 import com.sun.org.apache.xerces.internal.util.FeatureState;
 import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
 import com.sun.org.apache.xerces.internal.util.PropertyState;
-import com.sun.org.apache.xerces.internal.util.Status;
 import com.sun.org.apache.xerces.internal.util.SymbolTable;
-import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
@@ -278,11 +275,10 @@
     protected static final String SCHEMA_DV_FACTORY =
         Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
 
-    /** Property identifier: access to external dtd */
-    protected static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
+    /** Property identifier: Security property manager. */
+    private static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
-    /** Property identifier: access to external schema */
-    protected static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
 
     // debugging
 
@@ -535,8 +531,7 @@
                 SCHEMA_NONS_LOCATION,
                 LOCALE,
                 SCHEMA_DV_FACTORY,
-                ACCESS_EXTERNAL_DTD,
-                ACCESS_EXTERNAL_SCHEMA
+                XML_SECURITY_PROPERTY_MANAGER
         };
         addRecognizedProperties(recognizedProperties);
 
@@ -584,14 +579,7 @@
 
         fVersionDetector = new XMLVersionDetector();
 
-        //FEATURE_SECURE_PROCESSING is true, see the feature above
-        String accessExternal =  SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT);
-        fProperties.put(ACCESS_EXTERNAL_DTD, accessExternal);
-
-        accessExternal =  SecuritySupport.getDefaultAccessProperty(
-                Constants.SP_ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT);
-        fProperties.put(ACCESS_EXTERNAL_SCHEMA, accessExternal);
+        fProperties.put(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager());
 
         // add message formatters
         if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
--- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java	Fri Jul 26 14:07:32 2013 -0700
@@ -223,7 +223,8 @@
      * @return the name of the protocol if rejected, null otherwise
      */
     public static String checkAccess(String systemId, String allowedProtocols, String accessAny) throws IOException {
-        if (systemId == null || allowedProtocols.equalsIgnoreCase(accessAny)) {
+        if (systemId == null || (allowedProtocols != null &&
+                allowedProtocols.equalsIgnoreCase(accessAny))) {
             return null;
         }
 
@@ -256,6 +257,9 @@
      * @return true if the protocol is in the list
      */
     private static boolean isProtocolAllowed(String protocol, String allowedProtocols) {
+         if (allowedProtocols == null) {
+             return false;
+         }
          String temp[] = allowedProtocols.split(",");
          for (String t : temp) {
              t = t.trim();
@@ -267,18 +271,16 @@
      }
 
     /**
-     * Read from $java.home/lib/jaxp.properties for the specified property
+     * Read JAXP system property in this order: system property,
+     * $java.home/lib/jaxp.properties if the system property is not specified
      *
      * @param propertyId the Id of the property
      * @return the value of the property
      */
-    public static String getDefaultAccessProperty(String sysPropertyId, String defaultVal) {
-        String accessExternal = SecuritySupport.getSystemProperty(sysPropertyId);
+    public static String getJAXPSystemProperty(String sysPropertyId) {
+        String accessExternal = getSystemProperty(sysPropertyId);
         if (accessExternal == null) {
             accessExternal = readJAXPProperty(sysPropertyId);
-            if (accessExternal == null) {
-                accessExternal = defaultVal;
-            }
         }
         return accessExternal;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.org.apache.xerces.internal.utils;
+
+import com.sun.org.apache.xerces.internal.impl.Constants;
+import javax.xml.XMLConstants;
+
+/**
+ * This class manages security related properties
+ *
+ */
+public final class XMLSecurityPropertyManager {
+
+    /**
+     * States of the settings of a property, in the order: default value, value
+     * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
+     * properties, and jaxp api properties
+     */
+    public static enum State {
+        //this order reflects the overriding order
+        DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
+    }
+
+    /**
+     * Limits managed by the security manager
+     */
+    public static enum Property {
+        ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD,
+                Constants.EXTERNAL_ACCESS_DEFAULT),
+        ACCESS_EXTERNAL_SCHEMA(XMLConstants.ACCESS_EXTERNAL_SCHEMA,
+                Constants.EXTERNAL_ACCESS_DEFAULT);
+
+        final String name;
+        final String defaultValue;
+
+        Property(String name, String value) {
+            this.name = name;
+            this.defaultValue = value;
+        }
+
+        public boolean equalsName(String propertyName) {
+            return (propertyName == null) ? false : name.equals(propertyName);
+        }
+
+        String defaultValue() {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Values of the properties as defined in enum Properties
+     */
+    private final String[] values;
+    /**
+     * States of the settings for each property in Properties above
+     */
+    private State[] states = {State.DEFAULT, State.DEFAULT};
+
+    /**
+     * Default constructor. Establishes default values
+     */
+    public XMLSecurityPropertyManager() {
+        values = new String[Property.values().length];
+        for (Property property : Property.values()) {
+            values[property.ordinal()] = property.defaultValue();
+        }
+        //read system properties or jaxp.properties
+        readSystemProperties();
+    }
+
+    /**
+     * Set the value for a specific property.
+     *
+     * @param property the property
+     * @param state the state of the property
+     * @param value the value of the property
+     */
+    public void setValue(Property property, State state, String value) {
+        //only update if it shall override
+        if (state.compareTo(states[property.ordinal()]) >= 0) {
+            values[property.ordinal()] = value;
+            states[property.ordinal()] = state;
+        }
+    }
+
+    /**
+     * Set the value of a property by its index
+     * @param index the index of the property
+     * @param state the state of the property
+     * @param value the value of the property
+     */
+    public void setValue(int index, State state, String value) {
+        //only update if it shall override
+        if (state.compareTo(states[index]) >= 0) {
+            values[index] = value;
+            states[index] = state;
+        }
+    }
+    /**
+     * Return the value of the specified property
+     *
+     * @param property the property
+     * @return the value of the property
+     */
+    public String getValue(Property property) {
+        return values[property.ordinal()];
+    }
+
+    /**
+     * Return the value of a property by its ordinal
+     * @param index the index of a property
+     * @return value of a property
+     */
+    public String getValueByIndex(int index) {
+        return values[index];
+    }
+
+    /**
+     * Get the index by property name
+     * @param propertyName property name
+     * @return the index of the property if found; return -1 if not
+     */
+    public int getIndex(String propertyName){
+        for (Property property : Property.values()) {
+            if (property.equalsName(propertyName)) {
+                //internally, ordinal is used as index
+                return property.ordinal();
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Read from system properties, or those in jaxp.properties
+     */
+    private void readSystemProperties() {
+        getSystemProperty(Property.ACCESS_EXTERNAL_DTD,
+                Constants.SP_ACCESS_EXTERNAL_DTD);
+        getSystemProperty(Property.ACCESS_EXTERNAL_SCHEMA,
+                Constants.SP_ACCESS_EXTERNAL_SCHEMA);
+    }
+
+    /**
+     * Read from system properties, or those in jaxp.properties
+     *
+     * @param property the property
+     * @param systemProperty the name of the system property
+     */
+    private void getSystemProperty(Property property, String systemProperty) {
+        try {
+            String value = SecuritySupport.getSystemProperty(systemProperty);
+            if (value != null) {
+                values[property.ordinal()] = value;
+                states[property.ordinal()] = State.SYSTEMPROPERTY;
+                return;
+            }
+
+            value = SecuritySupport.readJAXPProperty(systemProperty);
+            if (value != null) {
+                values[property.ordinal()] = value;
+                states[property.ordinal()] = State.JAXPDOTPROPERTIES;
+            }
+        } catch (NumberFormatException e) {
+            //invalid setting ignored
+        }
+    }
+}
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Fri Jul 26 14:07:32 2013 -0700
@@ -68,6 +68,7 @@
 import com.sun.org.apache.xerces.internal.xpointer.XPointerHandler;
 import com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor;
 import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
+import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
 import java.util.Objects;
 
 /**
@@ -231,13 +232,9 @@
     protected static final String PARSER_SETTINGS =
         Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS;
 
-    /** property identifier: access external dtd. */
-    protected static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
-
-    /** access external dtd: file protocol
-     *  For DOM/SAX, the secure feature is set to true by default
-     */
-    final static String EXTERNAL_ACCESS_DEFAULT = Constants.EXTERNAL_ACCESS_DEFAULT;
+    /** property identifier: XML security property manager. */
+    protected static final String XML_SECURITY_PROPERTY_MANAGER =
+            Constants.XML_SECURITY_PROPERTY_MANAGER;
 
     /** Recognized features. */
     private static final String[] RECOGNIZED_FEATURES =
@@ -293,12 +290,7 @@
     protected XMLErrorReporter fErrorReporter;
     protected XMLEntityResolver fEntityResolver;
     protected SecurityManager fSecurityManager;
-    /**
-     * comma-delimited list of protocols that are allowed for the purpose
-     * of accessing external dtd or entity references
-     */
-    protected String fAccessExternalDTD = EXTERNAL_ACCESS_DEFAULT;
-
+    protected XMLSecurityPropertyManager fSecurityPropertyMgr;
 
     // these are needed for text include processing
     protected XIncludeTextReader fXInclude10TextReader;
@@ -540,7 +532,8 @@
             fSecurityManager = null;
         }
 
-        fAccessExternalDTD = (String)componentManager.getProperty(ACCESS_EXTERNAL_DTD);
+        fSecurityPropertyMgr = (XMLSecurityPropertyManager)
+                componentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER);
 
         // Get buffer size.
         try {
@@ -687,11 +680,13 @@
             }
             return;
         }
-        if (propertyId.equals(ACCESS_EXTERNAL_DTD)) {
-            fAccessExternalDTD = (String)value;
+        if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER)) {
+            fSecurityPropertyMgr = (XMLSecurityPropertyManager)value;
+
             if (fChildConfig != null) {
-                fChildConfig.setProperty(propertyId, value);
+                fChildConfig.setProperty(XML_SECURITY_PROPERTY_MANAGER, value);
             }
+
             return;
         }
 
@@ -1652,7 +1647,7 @@
                 if (fErrorReporter != null) fChildConfig.setProperty(ERROR_REPORTER, fErrorReporter);
                 if (fEntityResolver != null) fChildConfig.setProperty(ENTITY_RESOLVER, fEntityResolver);
                 fChildConfig.setProperty(SECURITY_MANAGER, fSecurityManager);
-                fChildConfig.setProperty(ACCESS_EXTERNAL_DTD, fAccessExternalDTD);
+                fChildConfig.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
                 fChildConfig.setProperty(BUFFER_SIZE, new Integer(fBufferSize));
 
                 // features must be copied to child configuration
--- a/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java	Fri Jul 26 14:07:32 2013 -0700
@@ -140,12 +140,6 @@
                     // Try to carry on if we've got a parser that
                     // doesn't know about namespace prefixes.
                 }
-                try {
-                    reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
-                } catch (SAXException se) {
-                    System.err.println("Warning:  " + reader.getClass().getName() + ": "
-                                + se.getMessage());
-                }
             } catch (ParserConfigurationException ex) {
                 throw new SAXException(ex);
             } catch (FactoryConfigurationError ex1) {
@@ -162,6 +156,14 @@
             }
         }
 
+        try {
+            //reader is cached, but this property might have been reset
+            reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
+        } catch (SAXException se) {
+            System.err.println("Warning:  " + reader.getClass().getName() + ": "
+                        + se.getMessage());
+        }
+
         return reader;
     }
 
--- a/jaxws/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/jaxws/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -219,3 +219,6 @@
 1468c94135f978dd29d03bce2f7d7e952154d144 jdk8-b95
 690d34b326bc78a6f5f225522695b41c7f7f70e8 jdk8-b96
 dcde7f049111353ad23175f54985a4f6bfea720c jdk8-b97
+b1fb4612a2caea52b5661b87509e560fa044b194 jdk8-b98
+8ef83d4b23c933935e28f59b282cea920b1b1f5f jdk8-b99
+4fd722afae5c02f00bbd44c3a34425ee474afb1c jdk8-b100
--- a/jdk/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -220,3 +220,5 @@
 4a5d3cf2b3af1660db0237e8da324c140e534fa4 jdk8-b96
 978a95239044f26dcc8a6d59246be07ad6ca6be2 jdk8-b97
 c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98
+6a099a36589bd933957272ba63e5263bede29971 jdk8-b99
+5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100
--- a/jdk/src/macosx/classes/com/apple/eawt/FullScreenHandler.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/com/apple/eawt/FullScreenHandler.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,6 +32,7 @@
 import javax.swing.RootPaneContainer;
 
 import com.apple.eawt.AppEvent.FullScreenEvent;
+import sun.awt.SunToolkit;
 
 import java.lang.annotation.Native;
 
@@ -75,7 +76,7 @@
     static void handleFullScreenEventFromNative(final Window window, final int type) {
         if (!(window instanceof RootPaneContainer)) return; // handles null
 
-        EventQueue.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(window, new Runnable() {
             public void run() {
                 final FullScreenHandler handler = getHandlerFor((RootPaneContainer)window);
                 if (handler != null) handler.notifyListener(new FullScreenEvent(window), type);
--- a/jdk/src/macosx/classes/com/apple/eawt/_AppEventHandler.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/com/apple/eawt/_AppEventHandler.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,8 @@
 import java.net.*;
 import java.util.*;
 import java.util.List;
+import sun.awt.AppContext;
+import sun.awt.SunToolkit;
 
 import com.apple.eawt.AppEvent.*;
 
@@ -269,11 +271,9 @@
     }
 
     class _AppReOpenedDispatcher extends _AppEventMultiplexor<AppReOpenedListener> {
-        void performOnListeners(final List<AppReOpenedListener> listeners, final _NativeEvent event) {
+        void performOnListener(AppReOpenedListener listener, final _NativeEvent event) {
             final AppReOpenedEvent e = new AppReOpenedEvent();
-            for (final AppReOpenedListener listener : listeners) {
-                listener.appReOpened(e);
-            }
+            listener.appReOpened(e);
         }
     }
 
@@ -415,50 +415,67 @@
     }
 
     abstract class _AppEventMultiplexor<L> {
-        final List<L> _listeners = new ArrayList<L>(0);
+        private final Map<L, AppContext> listenerToAppContext =
+                new IdentityHashMap<L, AppContext>();
         boolean nativeListenerRegistered;
 
         // called from AppKit Thread-0
         void dispatch(final _NativeEvent event, final Object... args) {
-            // grab a local ref to the listeners
-            final List<L> localListeners;
+            // grab a local ref to the listeners and its contexts as an array of the map's entries
+            final ArrayList<Map.Entry<L, AppContext>> localEntries;
             synchronized (this) {
-                if (_listeners.size() == 0) return;
-                localListeners = new ArrayList<L>(_listeners);
+                if (listenerToAppContext.size() == 0) {
+                    return;
+                }
+                localEntries = new ArrayList<Map.Entry<L, AppContext>>(listenerToAppContext.size());
+                localEntries.addAll(listenerToAppContext.entrySet());
             }
 
-            EventQueue.invokeLater(new Runnable() {
-                public void run() {
-                    performOnListeners(localListeners, event);
-                }
-            });
+            for (final Map.Entry<L, AppContext> e : localEntries) {
+                final L listener = e.getKey();
+                final AppContext listenerContext = e.getValue();
+                SunToolkit.invokeLaterOnAppContext(listenerContext, new Runnable() {
+                    public void run() {
+                        performOnListener(listener, event);
+                    }
+                });
+            }
         }
 
         synchronized void addListener(final L listener) {
+            setListenerContext(listener, AppContext.getAppContext());
+
             if (!nativeListenerRegistered) {
                 registerNativeListener();
                 nativeListenerRegistered = true;
             }
-            _listeners.add(listener);
         }
 
         synchronized void removeListener(final L listener) {
-            _listeners.remove(listener);
+            listenerToAppContext.remove(listener);
         }
 
-        abstract void performOnListeners(final List<L> listeners, final _NativeEvent event);
+        abstract void performOnListener(L listener, final _NativeEvent event);
         void registerNativeListener() { }
+
+        private void setListenerContext(L listener, AppContext listenerContext) {
+            if (listenerContext == null) {
+                throw new RuntimeException(
+                        "Attempting to add a listener from a thread group without AppContext");
+            }
+            listenerToAppContext.put(listener, AppContext.getAppContext());
+        }
     }
 
     abstract class _BooleanAppEventMultiplexor<L, E> extends _AppEventMultiplexor<L> {
         @Override
-        void performOnListeners(final List<L> listeners, final _NativeEvent event) {
+        void performOnListener(L listener, final _NativeEvent event) {
             final boolean isTrue = Boolean.TRUE.equals(event.get(0));
             final E e = createEvent(isTrue);
             if (isTrue) {
-                for (final L listener : listeners) performTrueEventOn(listener, e);
+                performTrueEventOn(listener, e);
             } else {
-                for (final L listener : listeners) performFalseEventOn(listener, e);
+                performFalseEventOn(listener, e);
             }
         }
 
@@ -479,30 +496,34 @@
      */
     abstract class _AppEventDispatcher<H> {
         H _handler;
+        AppContext handlerContext;
 
         // called from AppKit Thread-0
         void dispatch(final _NativeEvent event) {
-            EventQueue.invokeLater(new Runnable() {
-                public void run() {
-                    // grab a local ref to the handler
-                    final H localHandler;
-                    synchronized (_AppEventDispatcher.this) {
-                        localHandler = _handler;
-                    }
+            // grab a local ref to the handler
+            final H localHandler;
+            final AppContext localHandlerContext;
+            synchronized (_AppEventDispatcher.this) {
+                localHandler = _handler;
+                localHandlerContext = handlerContext;
+            }
 
-                    // invoke the handler outside of the synchronized block
-                    if (localHandler == null) {
-                        performDefaultAction(event);
-                    } else {
+            if (localHandler == null) {
+                performDefaultAction(event);
+            } else {
+                SunToolkit.invokeLaterOnAppContext(localHandlerContext, new Runnable() {
+                    public void run() {
                         performUsing(localHandler, event);
                     }
-                }
-            });
+                });
+            }
         }
 
         synchronized void setHandler(final H handler) {
             this._handler = handler;
 
+            setHandlerContext(AppContext.getAppContext());
+
             // if a new handler is installed, block addition of legacy ApplicationListeners
             if (handler == legacyHandler) return;
             legacyHandler.blockLegacyAPI();
@@ -510,6 +531,15 @@
 
         void performDefaultAction(final _NativeEvent event) { } // by default, do nothing
         abstract void performUsing(final H handler, final _NativeEvent event);
+
+        protected void setHandlerContext(AppContext ctx) {
+            if (ctx == null) {
+                throw new RuntimeException(
+                        "Attempting to set a handler from a thread group without AppContext");
+            }
+
+            handlerContext = ctx;
+        }
     }
 
     abstract class _QueuingAppEventDispatcher<H> extends _AppEventDispatcher<H> {
@@ -531,6 +561,8 @@
         synchronized void setHandler(final H handler) {
             this._handler = handler;
 
+            setHandlerContext(AppContext.getAppContext());
+
             // dispatch any events in the queue
             if (queuedEvents != null) {
                 // grab a local ref to the queue, so the real one can be nulled out
--- a/jdk/src/macosx/classes/com/apple/eawt/event/GestureHandler.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/com/apple/eawt/event/GestureHandler.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,6 +25,8 @@
 
 package com.apple.eawt.event;
 
+import sun.awt.SunToolkit;
+
 import java.awt.*;
 import java.util.*;
 import java.util.List;
@@ -70,7 +72,7 @@
     static void handleGestureFromNative(final Window window, final int type, final double x, final double y, final double a, final double b) {
         if (window == null) return; // should never happen...
 
-        EventQueue.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(window, new Runnable() {
             public void run() {
                 final Component component = SwingUtilities.getDeepestComponentAt(window, (int)x, (int)y);
 
--- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
 
 import javax.swing.*;
 
+import sun.awt.SunToolkit;
 import sun.lwawt.LWToolkit;
 import sun.lwawt.macosx.*;
 
@@ -144,7 +145,7 @@
                     updateItems();
                     fItemBounds = new Rectangle[invoker.getMenuComponentCount()];
                 }
-            }, null);
+            }, invoker);
         } catch (final Exception e) {
             System.err.println(e);
             e.printStackTrace();
@@ -172,7 +173,7 @@
 
             fItemBounds = null;
     }
-            }, null);
+            }, invoker);
         } catch (final Exception e) {
             e.printStackTrace();
         }
@@ -200,7 +201,7 @@
         if (kind == 0) return;
         if (fItemBounds == null) return;
 
-        SwingUtilities.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(fInvoker, new Runnable() {
             @Override
             public void run() {
                 Component target = null;
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CCheckboxMenuItem.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
 
     public void handleAction(final boolean state) {
         final CheckboxMenuItem target = (CheckboxMenuItem)getTarget();
-        EventQueue.invokeLater(new Runnable() {
+        SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
             public void run() {
                 target.setState(state);
             }
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -107,10 +107,6 @@
             loc = rootComponent.getLocation();
         }
 
-        //It sure will be LWComponentPeer instance as rootComponent is a Window
-        PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow();
-        long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow);
-
         // If there isn't any drag image make one of default appearance:
         if (fDragImage == null)
             this.setDefaultDragImage(component);
@@ -137,6 +133,11 @@
         }
 
         try {
+            //It sure will be LWComponentPeer instance as rootComponent is a Window
+            PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow();
+            long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow);
+            if (nativeViewPtr == 0L) throw new InvalidDnDOperationException("Unsupported platform window implementation");
+
             // Create native dragging source:
             final long nativeDragSource = createNativeDragSource(component, nativeViewPtr, transferable, triggerEvent,
                 (int) (dragOrigin.getX()), (int) (dragOrigin.getY()), extModifiers,
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTarget.java	Fri Jul 26 14:07:32 2013 -0700
@@ -52,6 +52,8 @@
         fPeer = peer;
 
         long nativePeer = CPlatformWindow.getNativeViewPtr(((LWComponentPeer) peer).getPlatformWindow());
+        if (nativePeer == 0L) return; // Unsupported for a window without a native view (plugin)
+
         // Create native dragging destination:
         fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer);
         if (fNativeDropTarget == 0) {
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri Jul 26 14:07:32 2013 -0700
@@ -479,12 +479,14 @@
             deliverZoom(true);
 
             this.normalBounds = peer.getBounds();
-            long screen = CWrapper.NSWindow.screen(getNSWindowPtr());
-            Rectangle toBounds = CWrapper.NSScreen.visibleFrame(screen).getBounds();
-            // Flip the y coordinate
-            Rectangle frame = CWrapper.NSScreen.frame(screen).getBounds();
-            toBounds.y = frame.height - toBounds.y - toBounds.height;
-            setBounds(toBounds.x, toBounds.y, toBounds.width, toBounds.height);
+
+            GraphicsConfiguration config = getPeer().getGraphicsConfiguration();
+            Insets i = ((CGraphicsDevice)config.getDevice()).getScreenInsets();
+            Rectangle toBounds = config.getBounds();
+            setBounds(toBounds.x + i.left,
+                      toBounds.y + i.top,
+                      toBounds.width - i.left - i.right,
+                      toBounds.height - i.top - i.bottom);
         }
     }
 
@@ -751,13 +753,7 @@
         // the move/size notification from the underlying system comes
         // but it contains a bounds smaller than the whole screen
         // and therefore we need to create the synthetic notifications
-        Rectangle screenBounds;
-        final long screenPtr = CWrapper.NSWindow.screen(getNSWindowPtr());
-        try {
-            screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
-        } finally {
-            CWrapper.NSObject.release(screenPtr);
-        }
+        Rectangle screenBounds = getPeer().getGraphicsConfiguration().getBounds();
         peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width,
                            screenBounds.height);
     }
@@ -900,8 +896,6 @@
             nativePeer = ((CPlatformWindow) platformWindow).getContentView().getAWTView();
         } else if (platformWindow instanceof CViewPlatformEmbeddedFrame){
             nativePeer = ((CViewPlatformEmbeddedFrame) platformWindow).getNSViewPtr();
-        } else {
-            throw new IllegalArgumentException("Unsupported platformWindow implementation");
         }
         return nativePeer;
     }
@@ -932,25 +926,19 @@
 
         final Rectangle oldB = nativeBounds;
         nativeBounds = new Rectangle(x, y, width, height);
-        final GraphicsConfiguration oldGC = peer.getGraphicsConfiguration();
-
-        final GraphicsConfiguration newGC = peer.getGraphicsConfiguration();
-        // System-dependent appearance optimization.
         if (peer != null) {
             peer.notifyReshape(x, y, width, height);
-        }
-
-        if ((byUser && !oldB.getSize().equals(nativeBounds.getSize()))
-            || isFullScreenAnimationOn || !Objects.equals(newGC, oldGC)) {
-            flushBuffers();
+            // System-dependent appearance optimization.
+            if ((byUser && !oldB.getSize().equals(nativeBounds.getSize()))
+                    || isFullScreenAnimationOn) {
+                flushBuffers();
+            }
         }
     }
 
     private void deliverWindowClosingEvent() {
-        if (peer != null) {
-            if (peer.getBlocker() == null)  {
-                peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING));
-            }
+        if (peer != null && peer.getBlocker() == null) {
+            peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING));
         }
     }
 
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
                     validate();
                     setVisible(true);
                 }
-            }, null);
+            }, this);
         } catch (InterruptedException | InvocationTargetException ex) {}
     }
 }
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Fri Jul 26 14:07:32 2013 -0700
@@ -71,8 +71,6 @@
         public static native void zoom(long window);
 
         public static native void makeFirstResponder(long window, long responder);
-
-        public static native long screen(long window);
     }
 
     public static final class NSView {
@@ -95,12 +93,6 @@
         public static native void release(long object);
     }
 
-    public static final class NSScreen {
-        public static native Rectangle2D frame(long screen);
-        public static native Rectangle2D visibleFrame(long screen);
-        public static native long screenByDisplayId(int displayID);
-    }
-
     public static final class NSColor {
         public static native long clearColor();
     }
--- a/jdk/src/macosx/native/sun/awt/CMenuItem.m	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/native/sun/awt/CMenuItem.m	Fri Jul 26 14:07:32 2013 -0700
@@ -82,8 +82,13 @@
         // keys, so we need to do the same translation here that we do
         // for the regular key down events
         if ([eventKey length] == 1) {
-            unichar ch =  NsCharToJavaChar([eventKey characterAtIndex:0], 0);
-            eventKey = [NSString stringWithCharacters: &ch length: 1];
+            unichar origChar = [eventKey characterAtIndex:0];
+            unichar newChar =  NsCharToJavaChar(origChar, 0);
+            if (newChar == java_awt_event_KeyEvent_CHAR_UNDEFINED) {
+                newChar = origChar;
+            }
+
+            eventKey = [NSString stringWithCharacters: &newChar length: 1];
         }
 
         if ([menuKey isEqualToString:eventKey]) {
--- a/jdk/src/macosx/native/sun/awt/CWrapper.m	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/macosx/native/sun/awt/CWrapper.m	Fri Jul 26 14:07:32 2013 -0700
@@ -397,31 +397,6 @@
 }
 
 /*
- * Class:     sun_lwawt_macosx_CWrapper$NSWindow
- * Method:    screen
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL
-Java_sun_lwawt_macosx_CWrapper_00024NSWindow_screen
-(JNIEnv *env, jclass cls, jlong windowPtr)
-{
-    __block jlong screenPtr = 0L;
-
-JNF_COCOA_ENTER(env);
-
-    AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
-    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        const NSScreen *screen = [window screen];
-        CFRetain(screen); // GC
-        screenPtr = ptr_to_jlong(screen);
-    }];
-
-JNF_COCOA_EXIT(env);
-
-    return screenPtr;
-}
-
-/*
  * Method:    miniaturize
  * Signature: (J)V
  */
@@ -690,92 +665,6 @@
 JNF_COCOA_EXIT(env);
 }
 
-
-/*
- * Class:     sun_lwawt_macosx_CWrapper$NSScreen
- * Method:    frame
- * Signature: (J)Ljava/awt/Rectangle;
- */
-JNIEXPORT jobject JNICALL
-Java_sun_lwawt_macosx_CWrapper_00024NSScreen_frame
-(JNIEnv *env, jclass cls, jlong screenPtr)
-{
-    jobject jRect = NULL;
-
-JNF_COCOA_ENTER(env);
-
-    __block NSRect rect = NSZeroRect;
-
-    NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
-    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        rect = [screen frame];
-    }];
-
-    jRect = NSToJavaRect(env, rect);
-
-JNF_COCOA_EXIT(env);
-
-    return jRect;
-}
-
-/*
- * Class:     sun_lwawt_macosx_CWrapper_NSScreen
- * Method:    visibleFrame
- * Signature: (J)Ljava/awt/geom/Rectangle2D;
- */
-JNIEXPORT jobject JNICALL
-Java_sun_lwawt_macosx_CWrapper_00024NSScreen_visibleFrame
-(JNIEnv *env, jclass cls, jlong screenPtr)
-{
-    jobject jRect = NULL;
-
-JNF_COCOA_ENTER(env);
-
-    __block NSRect rect = NSZeroRect;
-
-    NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
-    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        rect = [screen visibleFrame];
-    }];
-
-    jRect = NSToJavaRect(env, rect);
-
-JNF_COCOA_EXIT(env);
-
-    return jRect;
-}
-
-/*
- * Class:     sun_lwawt_macosx_CWrapper_NSScreen
- * Method:    screenByDisplayId
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL
-Java_sun_lwawt_macosx_CWrapper_00024NSScreen_screenByDisplayId
-(JNIEnv *env, jclass cls, jint displayID)
-{
-    __block jlong screenPtr = 0L;
-
-JNF_COCOA_ENTER(env); 
-
-    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        NSArray *screens = [NSScreen screens];
-        for (NSScreen *screen in screens) {
-            NSDictionary *screenInfo = [screen deviceDescription];
-            NSNumber *screenID = [screenInfo objectForKey:@"NSScreenNumber"];
-            if ([screenID intValue] == displayID){
-                CFRetain(screen); // GC
-                screenPtr = ptr_to_jlong(screen);
-                break;
-            }
-        }
-    }];
-
-JNF_COCOA_EXIT(env);
-
-    return screenPtr;
-}
-
 /*
  * Class:     sun_lwawt_macosx_CWrapper$NSColor
  * Method:    clearColor
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=toggle expand
+toggleexpand=toggle expand
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=ein-/ausblenden
+toggleexpand=ein-/ausblenden
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=activar/desactivar ampliaci\u00F3n
+toggleexpand=activar/desactivar ampliaci\u00F3n
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=basculer le d\u00E9veloppement
+toggleexpand=basculer le d\u00E9veloppement
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=abilita/disabilita espansione
+toggleexpand=abilita/disabilita espansione
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\u5C55\u958B\u306E\u30C8\u30B0\u30EB
+toggleexpand=\u5C55\u958B\u306E\u30C8\u30B0\u30EB
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\uD1A0\uAE00 \uD655\uC7A5
+toggleexpand=\uD1A0\uAE00 \uD655\uC7A5
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=alternar expans\u00E3o
+toggleexpand=alternar expans\u00E3o
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=v\u00E4xla ut\u00F6ka
+toggleexpand=v\u00E4xla ut\u00F6ka
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\u5207\u6362\u5C55\u5F00
+toggleexpand=\u5207\u6362\u5C55\u5F00
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -102,7 +102,7 @@
 #
 # accessible actions
 #
-toggle expand=\u5207\u63DB\u64F4\u5C55
+toggleexpand=\u5207\u63DB\u64F4\u5C55
 
 # new relations, roles and states for J2SE 1.5.0
 
--- a/jdk/src/share/classes/java/awt/GraphicsDevice.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java	Fri Jul 26 14:07:32 2013 -0700
@@ -296,6 +296,12 @@
                                     bgColor.getBlue(), 255);
                 w.setBackground(bgColor);
             }
+            // Check if this window is in fullscreen mode on another device.
+            final GraphicsConfiguration gc = w.getGraphicsConfiguration();
+            if (gc != null && gc.getDevice() != this
+                    && gc.getDevice().getFullScreenWindow() == w) {
+                gc.getDevice().setFullScreenWindow(null);
+            }
         }
         if (fullScreenWindow != null && windowedModeBounds != null) {
             // if the window went into fs mode before it was realized it may
--- a/jdk/src/share/classes/java/beans/Introspector.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/java/beans/Introspector.java	Fri Jul 26 14:07:32 2013 -0700
@@ -652,11 +652,12 @@
                     }
                 } else {
                     if (pd.getReadMethod() != null) {
+                        String pdName = pd.getReadMethod().getName();
                         if (gpd != null) {
                             // Don't replace the existing read
                             // method if it starts with "is"
-                            Method method = gpd.getReadMethod();
-                            if (!method.getName().startsWith(IS_PREFIX)) {
+                            String gpdName = gpd.getReadMethod().getName();
+                            if (gpdName.equals(pdName) || !gpdName.startsWith(IS_PREFIX)) {
                                 gpd = new PropertyDescriptor(gpd, pd);
                             }
                         } else {
--- a/jdk/src/share/classes/javax/accessibility/AccessibleAction.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/javax/accessibility/AccessibleAction.java	Fri Jul 26 14:07:32 2013 -0700
@@ -54,7 +54,7 @@
      * @since 1.5
      */
     public static final String TOGGLE_EXPAND =
-        new String ("toggle expand");
+        new String ("toggleexpand");
 
     /**
      * An action which increments a value.
--- a/jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/ContentModel.java	Fri Jul 26 14:07:32 2013 -0700
@@ -170,8 +170,8 @@
           case '&': {
             Element e = (Element) token;
             if (valSet == null) {
-                valSet = new boolean[Element.maxIndex + 1];
-                val = new boolean[Element.maxIndex + 1];
+                valSet = new boolean[Element.getMaxIndex() + 1];
+                val = new boolean[valSet.length];
                 // All Element instances are created before this ever executes
             }
             if (valSet[e.index]) {
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Element.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,6 +28,7 @@
 import java.util.Hashtable;
 import java.util.BitSet;
 import java.io.*;
+import sun.awt.AppContext;
 
 /**
  * An element as described in a DTD using the ELEMENT construct.
@@ -51,8 +52,6 @@
     public ContentModel content;
     public AttributeList atts;
 
-    static int maxIndex = 0;
-
     /**
      * A field to store user data. Mostly used to store
      * style sheets.
@@ -68,7 +67,18 @@
     Element(String name, int index) {
         this.name = name;
         this.index = index;
-        maxIndex = Math.max(maxIndex, index);
+        if (index > getMaxIndex()) {
+            AppContext.getAppContext().put(MAX_INDEX_KEY, index);
+        }
+    }
+
+    private static final Object MAX_INDEX_KEY = new Object();
+
+    static int getMaxIndex() {
+        Integer value = (Integer) AppContext.getAppContext().get(MAX_INDEX_KEY);
+        return (value != null)
+                ? value.intValue()
+                : 0;
     }
 
     /**
--- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1795,20 +1795,10 @@
     }
 
     public Rectangle getClipBounds() {
-        Rectangle r;
         if (clipState == CLIP_DEVICE) {
-            r = null;
-        } else if (transformState <= TRANSFORM_INT_TRANSLATE) {
-            if (usrClip instanceof Rectangle) {
-                r = new Rectangle((Rectangle) usrClip);
-            } else {
-                r = usrClip.getBounds();
-            }
-            r.translate(-transX, -transY);
-        } else {
-            r = getClip().getBounds();
+            return null;
         }
-        return r;
+        return getClipBounds(new Rectangle());
     }
 
     public Rectangle getClipBounds(Rectangle r) {
@@ -1817,11 +1807,11 @@
                 if (usrClip instanceof Rectangle) {
                     r.setBounds((Rectangle) usrClip);
                 } else {
-                    r.setBounds(usrClip.getBounds());
+                    r.setFrame(usrClip.getBounds2D());
                 }
                 r.translate(-transX, -transY);
             } else {
-                r.setBounds(getClip().getBounds());
+                r.setFrame(getClip().getBounds2D());
             }
         } else if (r == null) {
             throw new NullPointerException("null rectangle parameter");
@@ -1996,10 +1986,10 @@
             matrix[2] = matrix[0] + rect.getWidth();
             matrix[3] = matrix[1] + rect.getHeight();
             tx.transform(matrix, 0, matrix, 0, 2);
-            rect = new Rectangle2D.Float();
-            rect.setFrameFromDiagonal(matrix[0], matrix[1],
-                                      matrix[2], matrix[3]);
-            return rect;
+            fixRectangleOrientation(matrix, rect);
+            return new Rectangle2D.Double(matrix[0], matrix[1],
+                                          matrix[2] - matrix[0],
+                                          matrix[3] - matrix[1]);
         }
 
         if (tx.isIdentity()) {
@@ -2009,6 +1999,22 @@
         return tx.createTransformedShape(clip);
     }
 
+    /**
+     * Sets orientation of the rectangle according to the clip.
+     */
+    private static void fixRectangleOrientation(double[] m, Rectangle2D clip) {
+        if (clip.getWidth() > 0 != (m[2] - m[0] > 0)) {
+            double t = m[0];
+            m[0] = m[2];
+            m[2] = t;
+        }
+        if (clip.getHeight() > 0 != (m[3] - m[1] > 0)) {
+            double t = m[1];
+            m[1] = m[3];
+            m[3] = t;
+        }
+    }
+
     public void clipRect(int x, int y, int w, int h) {
         clip(new Rectangle(x, y, w, h));
     }
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c	Fri Jul 26 14:07:32 2013 -0700
@@ -548,6 +548,10 @@
         for (i=0; i < nOuts; i++) {
 
             cmsToneCurve* InversePostLin = cmsReverseToneCurve(Curves[i]);
+            if (InversePostLin == NULL) {
+                WhiteOut[i] = 0;
+                continue;
+            }
             WhiteOut[i] = cmsEvalToneCurve16(InversePostLin, WhitePointOut[i]);
             cmsFreeToneCurve(InversePostLin);
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java	Fri Jul 26 14:07:32 2013 -0700
@@ -105,9 +105,15 @@
      * Unsets a current synthetic error handler. Must be called with the acquired AWT lock.
      */
     public static void RESTORE_XERROR_HANDLER() {
+        RESTORE_XERROR_HANDLER(true);
+    }
+
+    private static void RESTORE_XERROR_HANDLER(boolean doXSync) {
         // Wait until all requests are processed by the X server
         // and only then uninstall the error handler.
-        XSync();
+        if (doXSync) {
+            XSync();
+        }
         current_error_handler = null;
     }
 
--- a/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1029,7 +1029,16 @@
             // now supports collation and that most OS has a way
             // of setting it, it is a safe assumption to just always
             // include SheetCollate as supported attribute.
-            catList.add(SheetCollate.class);
+
+            /*
+               In Linux, we use Postscript for rendering but Linux still
+               has issues in propagating Postscript-embedded setpagedevice
+               setting like collation.  Therefore, we temporarily exclude
+               Linux.
+            */
+            if (!UnixPrintServiceLookup.isLinux()) {
+                catList.add(SheetCollate.class);
+            }
         }
 
         // With the assumption that  Chromaticity is equivalent to
--- a/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Fri Jul 26 14:07:32 2013 -0700
@@ -123,6 +123,10 @@
         return osname.equals("SunOS");
     }
 
+    static boolean isLinux() {
+        return (osname.equals("Linux"));
+    }
+
     static boolean isBSD() {
         return (osname.equals("Linux") ||
                 osname.contains("OS X"));
--- a/jdk/src/solaris/native/sun/awt/awt_util.h	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/solaris/native/sun/awt/awt_util.h	Fri Jul 26 14:07:32 2013 -0700
@@ -46,11 +46,11 @@
 
 /*
  * Expected types of arguments of the macro.
- * (JNIEnv*)
+ * (JNIEnv*, jboolean)
  */
-#define RESTORE_XERROR_HANDLER(env) do {                                                          \
+#define RESTORE_XERROR_HANDLER(env, doXSync) do {                                                 \
     JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil",                        \
-        "RESTORE_XERROR_HANDLER", "()V");                                                         \
+        "RESTORE_XERROR_HANDLER", "(Z)V", doXSync);                                               \
 } while (0)
 
 /*
@@ -64,8 +64,18 @@
     do {                                                                                          \
         code;                                                                                     \
     } while (0);                                                                                  \
-    RESTORE_XERROR_HANDLER(env);                                                                  \
+    RESTORE_XERROR_HANDLER(env, JNI_TRUE);                                                        \
     if (handlerHasFlag == JNI_TRUE) {                                                             \
+        GET_HANDLER_ERROR_OCCURRED_FLAG(env, handlerRef, errorOccurredFlag);                      \
+    }                                                                                             \
+} while (0)
+
+/*
+ * Expected types of arguments of the macro.
+ * (JNIEnv*, jobject, jboolean)
+ */
+#define GET_HANDLER_ERROR_OCCURRED_FLAG(env, handlerRef, errorOccurredFlag) do {                  \
+    if (handlerRef != NULL) {                                                                     \
         errorOccurredFlag = JNU_CallMethodByName(env, NULL, handlerRef, "getErrorOccurredFlag",   \
             "()Z").z;                                                                             \
     }                                                                                             \
--- a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c	Fri Jul 26 14:07:32 2013 -0700
@@ -392,10 +392,12 @@
     attrlist[3] = height;
 
     errorOccurredFlag = JNI_FALSE;
-    EXEC_WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$GLXBadAllocHandler",
-        "()Lsun/awt/X11/XErrorHandler$GLXBadAllocHandler;", JNI_TRUE,
-        errorHandlerRef, errorOccurredFlag,
-        pbuffer = j2d_glXCreatePbuffer(awt_display, glxinfo->fbconfig, attrlist));
+    WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$GLXBadAllocHandler",
+        "()Lsun/awt/X11/XErrorHandler$GLXBadAllocHandler;", JNI_TRUE, errorHandlerRef);
+    pbuffer = j2d_glXCreatePbuffer(awt_display, glxinfo->fbconfig, attrlist);
+    XSync(awt_display, False);
+    RESTORE_XERROR_HANDLER(env, JNI_FALSE);
+    GET_HANDLER_ERROR_OCCURRED_FLAG(env, errorHandlerRef, errorOccurredFlag);
 
     if ((pbuffer == 0) || errorOccurredFlag) {
         J2dRlsTraceLn(J2D_TRACE_ERROR,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Graphics2D/Test8004859/Test8004859.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.image.BufferedImage;
+
+import sun.java2d.SunGraphics2D;
+
+/**
+ * @test
+ * @bug 8004859
+ * @summary getClipBounds/getClip should return equivalent bounds.
+ * @author Sergey Bylokhov
+ */
+public final class Test8004859 {
+
+    private static Shape[] clips = {new Rectangle(0, 0, 1, 1), new Rectangle(
+            100, 100, -100, -100)};
+
+    private static boolean status = true;
+
+    public static void main(final String[] args)
+            throws NoninvertibleTransformException {
+        final BufferedImage bi = new BufferedImage(300, 300,
+                                                   BufferedImage.TYPE_INT_RGB);
+        final Graphics2D g = (Graphics2D) bi.getGraphics();
+        test(g);
+        g.translate(2.0, 2.0);
+        test(g);
+        g.translate(-4.0, -4.0);
+        test(g);
+        g.scale(2.0, 2.0);
+        test(g);
+        g.scale(-4.0, -4.0);
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.rotate(Math.toRadians(90));
+        test(g);
+        g.dispose();
+        if (!status) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    private static void test(final Graphics2D g) {
+        for (final Shape clip : clips) {
+            g.setClip(clip);
+            if (!g.getClip().equals(clip)) {
+                System.err.println("Expected clip: " + clip);
+                System.err.println("Actual clip: " + g.getClip());
+                System.err.println("bounds="+g.getClip().getBounds2D());
+                System.err.println("bounds="+g.getClip().getBounds());
+                status = false;
+            }
+            final Rectangle bounds = g.getClipBounds();
+            if (!clip.equals(bounds)) {
+                System.err.println("Expected getClipBounds(): " + clip);
+                System.err.println("Actual getClipBounds(): " + bounds);
+                status = false;
+            }
+            g.getClipBounds(bounds);
+            if (!clip.equals(bounds)) {
+                System.err.println("Expected getClipBounds(r): " + clip);
+                System.err.println("Actual getClipBounds(r): " + bounds);
+                status = false;
+            }
+            if (!clip.getBounds2D().isEmpty() && ((SunGraphics2D) g).clipRegion
+                    .isEmpty()) {
+                System.err.println("clipRegion should not be empty");
+                status = false;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/GraphicsDevice/IncorrectDisplayModeExitFullscreen.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+import java.awt.Color;
+import java.awt.DisplayMode;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
+
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @bug 8019587
+ * @author Sergey Bylokhov
+ */
+public class IncorrectDisplayModeExitFullscreen {
+
+    public static void main(final String[] args) {
+
+        final GraphicsDevice[] devices =
+                GraphicsEnvironment.getLocalGraphicsEnvironment()
+                                   .getScreenDevices();
+        if (devices.length < 2 || devices[0].getDisplayModes().length < 2
+                || !devices[0].isFullScreenSupported()
+                || !devices[1].isFullScreenSupported()) {
+            System.err.println("Testcase is not applicable");
+            return;
+        }
+        final DisplayMode defaultDM = devices[0].getDisplayMode();
+        final DisplayMode[] dms = devices[0].getDisplayModes();
+        DisplayMode nonDefaultDM = null;
+
+        for (final DisplayMode dm : dms) {
+            if (!dm.equals(defaultDM)) {
+                nonDefaultDM = dm;
+                break;
+            }
+        }
+        if (nonDefaultDM == null) {
+            System.err.println("Testcase is not applicable");
+            return;
+        }
+
+        final Frame frame = new Frame();
+        frame.setBackground(Color.GREEN);
+        frame.setUndecorated(true);
+        try {
+            devices[0].setFullScreenWindow(frame);
+            sleep();
+            devices[0].setDisplayMode(nonDefaultDM);
+            sleep();
+            devices[1].setFullScreenWindow(frame);
+            sleep();
+            if (!defaultDM.equals(devices[0].getDisplayMode())) {
+                throw new RuntimeException("DisplayMode is not restored");
+            }
+        } finally {
+            // cleaning up
+            devices[0].setFullScreenWindow(null);
+            devices[1].setFullScreenWindow(null);
+            frame.dispose();
+        }
+    }
+    private static void sleep() {
+        ((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
+        try {
+            Thread.sleep(1500);
+        } catch (InterruptedException ignored) {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test @summary JVM crash if the frame maximized from offscreen
+ * @author Petr Pchelko
+ * @library ../../regtesthelpers
+ * @build Util
+ * @compile MaximizeOffscreenTest.java
+ * @run main/othervm MaximizeOffscreenTest
+ */
+
+import test.java.awt.regtesthelpers.Util;
+
+import javax.swing.*;
+import java.awt.*;
+
+public class MaximizeOffscreenTest {
+
+    private static JFrame frame;
+
+    public static void main(String[] args) throws Throwable {
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                constructTestUI();
+            }
+        });
+
+        Util.waitForIdle(null);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                frame.setExtendedState(Frame.MAXIMIZED_BOTH);
+            }
+        });
+        Util.waitForIdle(null);
+    }
+
+    private static void constructTestUI() {
+        frame = new JFrame("Test frame");
+        frame.setUndecorated(true);
+        frame.setBounds(-1000, -1000, 100, 100);
+        frame.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/Test6707231.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.beans.PropertyDescriptor;
+
+/*
+ * @test
+ * @bug 6707231
+ * @summary Tests the boolean getter
+ * @author Sergey Malenkov
+ */
+
+public class Test6707231 {
+    public static void main(String[] args) throws Exception {
+        test(Bean.class, Bean.class);
+        test(Public.class, Public.class);
+        test(Private.class, Bean.class);
+    }
+
+    public static class Bean {
+        private boolean value;
+
+        public boolean isValue() {
+            return this.value;
+        }
+
+        public void setValue(boolean value) {
+            this.value = value;
+        }
+    }
+
+    public static class Public extends Bean {
+        public boolean isValue() {
+            return super.isValue();
+        }
+
+        public void setValue(boolean value) {
+            super.setValue(value);
+        }
+    }
+
+    private static class Private extends Bean {
+        public boolean isValue() {
+            return super.isValue();
+        }
+
+        public void setValue(boolean value) {
+            super.setValue(value);
+        }
+    }
+
+    private static void test(Class<?> actual, Class<?> expected) {
+        PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(actual, "value");
+        Class<?> getter = pd.getReadMethod().getDeclaringClass();
+        Class<?> setter = pd.getWriteMethod().getDeclaringClass();
+        if ((getter != expected) || (setter != expected)) {
+            throw new Error(actual.getName());
+        }
+    }
+}
--- a/jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -35,10 +35,11 @@
 import javax.swing.*;
 
 public class ActionListenerCalledTwiceTest {
-    static String menuItems[] = { "Item1", "Item2" };
+    static String menuItems[] = { "Item1", "Item2", "Item3" };
     static KeyStroke keyStrokes[] = {
         KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.META_MASK),
-        KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)
+        KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
+        KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
     };
 
     static volatile int listenerCallCounter = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/html/parser/Test8017492.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.Vector;
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.HTMLDocument;
+import javax.swing.text.html.HTMLEditorKit;
+import javax.swing.text.html.parser.DTD;
+import javax.swing.text.html.parser.Element;
+import sun.awt.SunToolkit;
+
+/*
+ * @test
+ * @bug 8017492
+ * @run main/othervm Test8017492
+ * @summary Tests for OutOfMemoryError/NegativeArraySizeException
+ * @author Sergey Malenkov
+ */
+
+public class Test8017492 {
+    public static void main(String[] args) throws Exception {
+        Runnable task = new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    SunToolkit.createNewAppContext();
+                    DTD dtd = DTD.getDTD("dtd");
+                    dtd.elements = new Vector<Element>() {
+                        @Override
+                        public synchronized int size() {
+                            return Integer.MAX_VALUE;
+                        }
+                    };
+                    dtd.getElement("element");
+                }
+                catch (Exception exception) {
+                    throw new Error("unexpected", exception);
+                }
+            }
+        };
+        // run task with different AppContext
+        Thread thread = new Thread(new ThreadGroup("$$$"), task);
+        thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+            @Override
+            public void uncaughtException(Thread thread, Throwable throwable) {
+                throwable.printStackTrace();
+                System.exit(1);
+            }
+        });
+        thread.start();
+        thread.join();
+        // add error handling
+        HTMLDocument document = new HTMLDocument() {
+            @Override
+            public HTMLEditorKit.ParserCallback getReader(int pos) {
+                return getReader(pos, 0, 0, null);
+            }
+
+            @Override
+            public HTMLEditorKit.ParserCallback getReader(int pos, int popDepth, int pushDepth, HTML.Tag insertTag) {
+                return new HTMLDocument.HTMLReader(pos, popDepth, pushDepth, insertTag) {
+                    @Override
+                    public void handleError(String error, int pos) {
+                        throw new Error(error);
+                    }
+                };
+            }
+        };
+        // run parser
+        new HTMLEditorKit().insertHTML(document, 0, "<html><body>text", 0, 0, null);
+    }
+}
--- a/jdk/test/sun/security/krb5/auto/NoneReplayCacheTest.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/jdk/test/sun/security/krb5/auto/NoneReplayCacheTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -16,10 +16,10 @@
  * 2 along with this work; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
+ * Please 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
--- a/langtools/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -219,3 +219,6 @@
 4cb1136231275a1f8af53f5bfdef0b488e4b5bab jdk8-b95
 988aef3a8c3adac482363293f65e77ec4c5ce98d jdk8-b96
 6a11a81a8824c17f6cd2ec8f8492e1229b694e96 jdk8-b97
+ce5a90df517bdceb2739d7dd3e6764b070def802 jdk8-b98
+6d85acab769eb79bc058f5640fa86a6ef096a583 jdk8-b99
+82f68da70e471ee5640016e3f38c014347a5c785 jdk8-b100
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Fri Jul 26 14:07:32 2013 -0700
@@ -467,7 +467,7 @@
                 nodeprecated = true;
             } else if (opt.equals("-sourcepath")) {
                 sourcepath = os[1];
-            } else if (opt.equals("-classpath") &&
+            } else if ((opt.equals("-classpath") || opt.equals("-cp")) &&
                        sourcepath.length() == 0) {
                 sourcepath = os[1];
             } else if (opt.equals("-excludedocfilessubdir")) {
--- a/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java	Fri Jul 26 14:07:32 2013 -0700
@@ -187,6 +187,8 @@
                 javacBootClassPath = splitPath(args[++i]);
             } else if (arg.equals("-classpath") && i + 1 < args.length) {
                 javacClassPath = splitPath(args[++i]);
+            } else if (arg.equals("-cp") && i + 1 < args.length) {
+                javacClassPath = splitPath(args[++i]);
             } else if (arg.equals("-sourcepath") && i + 1 < args.length) {
                 javacSourcePath = splitPath(args[++i]);
             } else if (arg.equals(XMSGS_OPTION)) {
@@ -326,6 +328,14 @@
         abstract void visitDecl(Tree tree, Name name);
 
         @Override
+        public Void visitCompilationUnit(CompilationUnitTree tree, Void ignore) {
+            if (tree.getPackageName() != null) {
+                visitDecl(tree, null);
+            }
+            return super.visitCompilationUnit(tree, ignore);
+        }
+
+        @Override
         public Void visitClass(ClassTree tree, Void ignore) {
             visitDecl(tree, tree.getSimpleName());
             return super.visitClass(tree, ignore);
--- a/langtools/src/share/classes/com/sun/tools/doclint/Env.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Env.java	Fri Jul 26 14:07:32 2013 -0700
@@ -142,7 +142,7 @@
         currElement = trees.getElement(currPath);
         currOverriddenMethods = ((JavacTypes) types).getOverriddenMethods(currElement);
 
-        AccessKind ak = null;
+        AccessKind ak = AccessKind.PUBLIC;
         for (TreePath p = path; p != null; p = p.getParentPath()) {
             Element e = trees.getElement(p);
             if (e != null && e.getKind() != ElementKind.PACKAGE) {
--- a/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -109,7 +109,7 @@
 \    Show this message.\n\
 \n\
 The following javac options are also supported\n\
-\  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns\n\
+\  -bootclasspath, -classpath, -cp, -sourcepath, -Xmaxerrs, -Xmaxwarns\n\
 \n\
 To run doclint on part of a project, put the compiled classes for your\n\
 project on the classpath (or bootclasspath), then specify the source files\n\
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Fri Jul 26 14:07:32 2013 -0700
@@ -261,6 +261,11 @@
      */
     public static final long SIGNATURE_POLYMORPHIC = 1L<<46;
 
+    /**
+     * Flag that marks inference variables used in a 'throws' clause
+     */
+    public static final long THROWS = 1L<<47;
+
     /** Modifier masks.
      */
     public static final int
@@ -365,7 +370,9 @@
         CLASH(Flags.CLASH),
         AUXILIARY(Flags.AUXILIARY),
         NOT_IN_PROFILE(Flags.NOT_IN_PROFILE),
-        BAD_OVERRIDE(Flags.BAD_OVERRIDE);
+        BAD_OVERRIDE(Flags.BAD_OVERRIDE),
+        SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC),
+        THROWS(Flags.THROWS);
 
         Flag(long flag) {
             this.value = flag;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -316,6 +316,7 @@
     public Entry lookup(Name name) {
         return lookup(name, noFilter);
     }
+
     public Entry lookup(Name name, Filter<Symbol> sf) {
         Entry e = table[getIndex(name)];
         if (e == null || e == sentinel)
@@ -361,6 +362,10 @@
         }
     }
 
+    public boolean anyMatch(Filter<Symbol> sf) {
+        return getElements(sf).iterator().hasNext();
+    }
+
     public Iterable<Symbol> getElements() {
         return getElements(noFilter);
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Fri Jul 26 14:07:32 2013 -0700
@@ -78,6 +78,9 @@
     /** Constant type: special type to be used during recovery of deferred expressions. */
     public static final JCNoType recoveryType = new JCNoType();
 
+    /** Constant type: special type to be used for marking stuck trees. */
+    public static final JCNoType stuckType = new JCNoType();
+
     /** If this switch is turned on, the names of type variables
      *  and anonymous classes are printed with hashcodes appended.
      */
@@ -1449,7 +1452,7 @@
         }
 
         /** inference variable bounds */
-        private Map<InferenceBound, List<Type>> bounds;
+        protected Map<InferenceBound, List<Type>> bounds;
 
         /** inference variable's inferred type (set from Infer.java) */
         public Type inst = null;
@@ -1511,8 +1514,17 @@
             return buf.toList();
         }
 
+        /** internal method used to override an undetvar bounds */
+        public void setBounds(InferenceBound ib, List<Type> newBounds) {
+            bounds.put(ib, newBounds);
+        }
+
         /** add a bound of a given kind - this might trigger listener notification */
-        public void addBound(InferenceBound ib, Type bound, Types types) {
+        public final void addBound(InferenceBound ib, Type bound, Types types) {
+            addBound(ib, bound, types, false);
+        }
+
+        protected void addBound(InferenceBound ib, Type bound, Types types, boolean update) {
             Type bound2 = toTypeVarMap.apply(bound);
             List<Type> prevBounds = bounds.get(ib);
             for (Type b : prevBounds) {
@@ -1529,7 +1541,7 @@
                 public Type apply(Type t) {
                     if (t.hasTag(UNDETVAR)) {
                         UndetVar uv = (UndetVar)t;
-                        return uv.qtype;
+                        return uv.inst != null ? uv.inst : uv.qtype;
                     } else {
                         return t.map(this);
                     }
@@ -1567,7 +1579,7 @@
                     bounds.put(ib, newBounds.toList());
                     //step 3 - for each dependency, add new replaced bound
                     for (Type dep : deps) {
-                        addBound(ib, types.subst(dep, from, to), types);
+                        addBound(ib, types.subst(dep, from, to), types, true);
                     }
                 }
             } finally {
@@ -1583,6 +1595,39 @@
                 listener.varChanged(this, ibs);
             }
         }
+
+        public boolean isCaptured() {
+            return false;
+        }
+    }
+
+    /**
+     * This class is used to represent synthetic captured inference variables
+     * that can be generated during nested generic method calls. The only difference
+     * between these inference variables and ordinary ones is that captured inference
+     * variables cannot get new bounds through incorporation.
+     */
+    public static class CapturedUndetVar extends UndetVar {
+
+        public CapturedUndetVar(CapturedType origin, Types types) {
+            super(origin, types);
+            if (!origin.lower.hasTag(BOT)) {
+                bounds.put(InferenceBound.LOWER, List.of(origin.lower));
+            }
+        }
+
+        @Override
+        public void addBound(InferenceBound ib, Type bound, Types types, boolean update) {
+            if (update) {
+                //only change bounds if request comes from substBounds
+                super.addBound(ib, bound, types, update);
+            }
+        }
+
+        @Override
+        public boolean isCaptured() {
+            return true;
+        }
     }
 
     /** Represents NONE.
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Jul 26 14:07:32 2013 -0700
@@ -33,10 +33,15 @@
 import java.util.Set;
 import java.util.WeakHashMap;
 
+import javax.tools.JavaFileObject;
+
 import com.sun.tools.javac.code.Attribute.RetentionPolicy;
 import com.sun.tools.javac.code.Lint.LintCategory;
 import com.sun.tools.javac.code.Type.UndetVar.InferenceBound;
+import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Check;
+import com.sun.tools.javac.comp.Enter;
+import com.sun.tools.javac.comp.Env;
 import com.sun.tools.javac.jvm.ClassReader;
 import com.sun.tools.javac.util.*;
 import static com.sun.tools.javac.code.BoundKind.*;
@@ -83,6 +88,7 @@
     final boolean allowDefaultMethods;
     final ClassReader reader;
     final Check chk;
+    final Enter enter;
     JCDiagnostic.Factory diags;
     List<Warner> warnStack = List.nil();
     final Name capturedName;
@@ -109,6 +115,7 @@
         allowDefaultMethods = source.allowDefaultMethods();
         reader = ClassReader.instance(context);
         chk = Check.instance(context);
+        enter = Enter.instance(context);
         capturedName = names.fromString("<captured wildcard>");
         messages = JavacMessages.instance(context);
         diags = JCDiagnostic.Factory.instance(context);
@@ -605,6 +612,84 @@
             return site;
         }
     }
+
+    /**
+     * Create a symbol for a class that implements a given functional interface
+     * and overrides its functional descriptor. This routine is used for two
+     * main purposes: (i) checking well-formedness of a functional interface;
+     * (ii) perform functional interface bridge calculation.
+     */
+    public ClassSymbol makeFunctionalInterfaceClass(Env<AttrContext> env, Name name, List<Type> targets, long cflags) {
+        Assert.check(targets.nonEmpty() && isFunctionalInterface(targets.head));
+        Symbol descSym = findDescriptorSymbol(targets.head.tsym);
+        Type descType = findDescriptorType(targets.head);
+        ClassSymbol csym = new ClassSymbol(cflags, name, env.enclClass.sym.outermostClass());
+        csym.completer = null;
+        csym.members_field = new Scope(csym);
+        MethodSymbol instDescSym = new MethodSymbol(descSym.flags(), descSym.name, descType, csym);
+        csym.members_field.enter(instDescSym);
+        Type.ClassType ctype = new Type.ClassType(Type.noType, List.<Type>nil(), csym);
+        ctype.supertype_field = syms.objectType;
+        ctype.interfaces_field = targets;
+        csym.type = ctype;
+        csym.sourcefile = ((ClassSymbol)csym.owner).sourcefile;
+        return csym;
+    }
+
+    /**
+     * Find the minimal set of methods that are overridden by the functional
+     * descriptor in 'origin'. All returned methods are assumed to have different
+     * erased signatures.
+     */
+    public List<Symbol> functionalInterfaceBridges(TypeSymbol origin) {
+        Assert.check(isFunctionalInterface(origin));
+        Symbol descSym = findDescriptorSymbol(origin);
+        CompoundScope members = membersClosure(origin.type, false);
+        ListBuffer<Symbol> overridden = ListBuffer.lb();
+        outer: for (Symbol m2 : members.getElementsByName(descSym.name, bridgeFilter)) {
+            if (m2 == descSym) continue;
+            else if (descSym.overrides(m2, origin, Types.this, false)) {
+                for (Symbol m3 : overridden) {
+                    if (isSameType(m3.erasure(Types.this), m2.erasure(Types.this)) ||
+                            (m3.overrides(m2, origin, Types.this, false) &&
+                            (pendingBridges((ClassSymbol)origin, m3.enclClass()) ||
+                            (((MethodSymbol)m2).binaryImplementation((ClassSymbol)m3.owner, Types.this) != null)))) {
+                        continue outer;
+                    }
+                }
+                overridden.add(m2);
+            }
+        }
+        return overridden.toList();
+    }
+    //where
+        private Filter<Symbol> bridgeFilter = new Filter<Symbol>() {
+            public boolean accepts(Symbol t) {
+                return t.kind == Kinds.MTH &&
+                        t.name != names.init &&
+                        t.name != names.clinit &&
+                        (t.flags() & SYNTHETIC) == 0;
+            }
+        };
+        private boolean pendingBridges(ClassSymbol origin, TypeSymbol s) {
+            //a symbol will be completed from a classfile if (a) symbol has
+            //an associated file object with CLASS kind and (b) the symbol has
+            //not been entered
+            if (origin.classfile != null &&
+                    origin.classfile.getKind() == JavaFileObject.Kind.CLASS &&
+                    enter.getEnv(origin) == null) {
+                return false;
+            }
+            if (origin == s) {
+                return true;
+            }
+            for (Type t : interfaces(origin.type)) {
+                if (pendingBridges((ClassSymbol)t.tsym, s)) {
+                    return true;
+                }
+            }
+            return false;
+        }
     // </editor-fold>
 
    /**
@@ -2245,7 +2330,7 @@
 
             @Override
             public Type visitErrorType(ErrorType t, Void ignored) {
-                return t;
+                return Type.noType;
             }
         };
     // </editor-fold>
@@ -2672,6 +2757,7 @@
                 public boolean accepts(Symbol s) {
                     return s.kind == Kinds.MTH &&
                             s.name == msym.name &&
+                            (s.flags() & SYNTHETIC) == 0 &&
                             s.isInheritedIn(site.tsym, Types.this) &&
                             overrideEquivalent(memberType(site, s), memberType(site, msym));
                 }
@@ -2864,7 +2950,7 @@
             if (elemtype == t.elemtype)
                 return t;
             else
-                return new ArrayType(upperBound(elemtype), t.tsym);
+                return new ArrayType(elemtype, t.tsym);
         }
 
         @Override
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Jul 26 14:07:32 2013 -0700
@@ -481,31 +481,7 @@
         static final long serialVersionUID = -6924771130405446405L;
         private Env<AttrContext> env;
         private BreakAttr(Env<AttrContext> env) {
-            this.env = copyEnv(env);
-        }
-
-        private Env<AttrContext> copyEnv(Env<AttrContext> env) {
-            Env<AttrContext> newEnv =
-                    env.dup(env.tree, env.info.dup(copyScope(env.info.scope)));
-            if (newEnv.outer != null) {
-                newEnv.outer = copyEnv(newEnv.outer);
-            }
-            return newEnv;
-        }
-
-        private Scope copyScope(Scope sc) {
-            Scope newScope = new Scope(sc.owner);
-            List<Symbol> elemsList = List.nil();
-            while (sc != null) {
-                for (Scope.Entry e = sc.elems ; e != null ; e = e.sibling) {
-                    elemsList = elemsList.prepend(e.sym);
-                }
-                sc = sc.next;
-            }
-            for (Symbol s : elemsList) {
-                newScope.enter(s);
-            }
-            return newScope;
+            this.env = env;
         }
     }
 
@@ -555,11 +531,6 @@
                 }
             });
         }
-
-        @Override
-        protected Type check(DiagnosticPosition pos, Type found) {
-            return chk.checkNonVoid(pos, super.check(pos, found));
-        }
     }
 
     final ResultInfo statInfo;
@@ -610,7 +581,7 @@
             tree.accept(this);
             if (tree == breakTree &&
                     resultInfo.checkContext.deferredAttrContext().mode == AttrMode.CHECK) {
-                throw new BreakAttr(env);
+                throw new BreakAttr(copyEnv(env));
             }
             return result;
         } catch (CompletionFailure ex) {
@@ -622,6 +593,30 @@
         }
     }
 
+    Env<AttrContext> copyEnv(Env<AttrContext> env) {
+        Env<AttrContext> newEnv =
+                env.dup(env.tree, env.info.dup(copyScope(env.info.scope)));
+        if (newEnv.outer != null) {
+            newEnv.outer = copyEnv(newEnv.outer);
+        }
+        return newEnv;
+    }
+
+    Scope copyScope(Scope sc) {
+        Scope newScope = new Scope(sc.owner);
+        List<Symbol> elemsList = List.nil();
+        while (sc != null) {
+            for (Scope.Entry e = sc.elems ; e != null ; e = e.sibling) {
+                elemsList = elemsList.prepend(e.sym);
+            }
+            sc = sc.next;
+        }
+        for (Symbol s : elemsList) {
+            newScope.enter(s);
+        }
+        return newScope;
+    }
+
     /** Derived visitor method: attribute an expression tree.
      */
     public Type attribExpr(JCTree tree, Env<AttrContext> env, Type pt) {
@@ -1697,7 +1692,8 @@
                               diags.fragment("unexpected.ret.val"));
                 }
                 attribTree(tree.expr, env, env.info.returnResult);
-            } else if (!env.info.returnResult.pt.hasTag(VOID)) {
+            } else if (!env.info.returnResult.pt.hasTag(VOID) &&
+                    !env.info.returnResult.pt.hasTag(NONE)) {
                 env.info.returnResult.checkContext.report(tree.pos(),
                               diags.fragment("missing.ret.val"));
             }
@@ -2334,13 +2330,12 @@
             if (pt() != Type.recoveryType) {
                 target = targetChecker.visit(target, that);
                 lambdaType = types.findDescriptorType(target);
-                chk.checkFunctionalInterface(that, target);
             } else {
                 target = Type.recoveryType;
                 lambdaType = fallbackDescriptorType(that);
             }
 
-            setFunctionalInfo(that, pt(), lambdaType, target, resultInfo.checkContext.inferenceContext());
+            setFunctionalInfo(localEnv, that, pt(), lambdaType, target, resultInfo.checkContext);
 
             if (lambdaType.hasTag(FORALL)) {
                 //lambda expression target desc cannot be a generic method
@@ -2396,7 +2391,7 @@
 
             ResultInfo bodyResultInfo = lambdaType.getReturnType() == Type.recoveryType ?
                 recoveryInfo :
-                new ResultInfo(VAL, lambdaType.getReturnType(), funcContext);
+                new LambdaResultInfo(lambdaType.getReturnType(), funcContext);
             localEnv.info.returnResult = bodyResultInfo;
 
             Log.DeferredDiagnosticHandler lambdaDeferredHandler = new Log.DeferredDiagnosticHandler(log);
@@ -2435,7 +2430,7 @@
             boolean isSpeculativeRound =
                     resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.SPECULATIVE;
 
-            postAttr(that);
+            preFlow(that);
             flow.analyzeLambda(env, that, make, isSpeculativeRound);
 
             checkLambdaCompatible(that, lambdaType, resultInfo.checkContext, isSpeculativeRound);
@@ -2457,6 +2452,21 @@
         }
     }
     //where
+        void preFlow(JCLambda tree) {
+            new PostAttrAnalyzer() {
+                @Override
+                public void scan(JCTree tree) {
+                    if (tree == null ||
+                            (tree.type != null &&
+                            tree.type == Type.stuckType)) {
+                        //don't touch stuck expressions!
+                        return;
+                    }
+                    super.scan(tree);
+                }
+            }.scan(tree);
+        }
+
         Types.MapVisitor<DiagnosticPosition> targetChecker = new Types.MapVisitor<DiagnosticPosition>() {
 
             @Override
@@ -2588,6 +2598,28 @@
             }
         }
 
+        class LambdaResultInfo extends ResultInfo {
+
+            LambdaResultInfo(Type pt, CheckContext checkContext) {
+                super(VAL, pt, checkContext);
+            }
+
+            @Override
+            protected Type check(DiagnosticPosition pos, Type found) {
+                return super.check(pos, found.baseType());
+            }
+
+            @Override
+            protected ResultInfo dup(CheckContext newContext) {
+                return new LambdaResultInfo(pt, newContext);
+            }
+
+            @Override
+            protected ResultInfo dup(Type newPt) {
+                return new LambdaResultInfo(newPt, checkContext);
+            }
+        }
+
         /**
         * Lambda compatibility. Check that given return types, thrown types, parameter types
         * are compatible with the expected functional interface descriptor. This means that:
@@ -2682,18 +2714,28 @@
             if (pt() != Type.recoveryType) {
                 target = targetChecker.visit(pt(), that);
                 desc = types.findDescriptorType(target);
-                chk.checkFunctionalInterface(that, target);
             } else {
                 target = Type.recoveryType;
                 desc = fallbackDescriptorType(that);
             }
 
-            setFunctionalInfo(that, pt(), desc, target, resultInfo.checkContext.inferenceContext());
+            setFunctionalInfo(localEnv, that, pt(), desc, target, resultInfo.checkContext);
             List<Type> argtypes = desc.getParameterTypes();
-
-            Pair<Symbol, Resolve.ReferenceLookupHelper> refResult =
-                    rs.resolveMemberReference(that.pos(), localEnv, that,
-                        that.expr.type, that.name, argtypes, typeargtypes, true, rs.resolveMethodCheck);
+            Resolve.MethodCheck referenceCheck = rs.resolveMethodCheck;
+
+            if (resultInfo.checkContext.inferenceContext().free(argtypes)) {
+                referenceCheck = rs.new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
+            }
+
+            Pair<Symbol, Resolve.ReferenceLookupHelper> refResult = null;
+            List<Type> saved_undet = resultInfo.checkContext.inferenceContext().save();
+            try {
+                refResult = rs.resolveMemberReference(that.pos(), localEnv, that, that.expr.type,
+                        that.name, argtypes, typeargtypes, true, referenceCheck,
+                        resultInfo.checkContext.inferenceContext());
+            } finally {
+                resultInfo.checkContext.inferenceContext().rollback(saved_undet);
+            }
 
             Symbol refSym = refResult.fst;
             Resolve.ReferenceLookupHelper lookupHelper = refResult.snd;
@@ -2805,17 +2847,24 @@
                 }
             }
 
-            that.sym = refSym.baseSymbol();
-            that.kind = lookupHelper.referenceKind(that.sym);
-
             ResultInfo checkInfo =
                     resultInfo.dup(newMethodTemplate(
                         desc.getReturnType().hasTag(VOID) ? Type.noType : desc.getReturnType(),
-                        lookupHelper.argtypes,
-                        typeargtypes));
+                        that.kind.isUnbound() ? argtypes.tail : argtypes, typeargtypes));
 
             Type refType = checkId(that, lookupHelper.site, refSym, localEnv, checkInfo);
 
+            if (that.kind.isUnbound() &&
+                    resultInfo.checkContext.inferenceContext().free(argtypes.head)) {
+                //re-generate inference constraints for unbound receiver
+                if (!types.isSubtype(resultInfo.checkContext.inferenceContext().asFree(argtypes.head), exprType)) {
+                    //cannot happen as this has already been checked - we just need
+                    //to regenerate the inference constraints, as that has been lost
+                    //as a result of the call to inferenceContext.save()
+                    Assert.error("Can't get here");
+                }
+            }
+
             if (!refType.isErroneous()) {
                 refType = types.createMethodTypeWithReturn(refType,
                         adjustMethodReturnType(lookupHelper.site, that.name, checkInfo.pt.getParameterTypes(), refType.getReturnType()));
@@ -2890,31 +2939,37 @@
      * might contain inference variables, we might need to register an hook in the
      * current inference context.
      */
-    private void setFunctionalInfo(final JCFunctionalExpression fExpr, final Type pt,
-            final Type descriptorType, final Type primaryTarget, InferenceContext inferenceContext) {
-        if (inferenceContext.free(descriptorType)) {
-            inferenceContext.addFreeTypeListener(List.of(pt, descriptorType), new FreeTypeListener() {
+    private void setFunctionalInfo(final Env<AttrContext> env, final JCFunctionalExpression fExpr,
+            final Type pt, final Type descriptorType, final Type primaryTarget, final CheckContext checkContext) {
+        if (checkContext.inferenceContext().free(descriptorType)) {
+            checkContext.inferenceContext().addFreeTypeListener(List.of(pt, descriptorType), new FreeTypeListener() {
                 public void typesInferred(InferenceContext inferenceContext) {
-                    setFunctionalInfo(fExpr, pt, inferenceContext.asInstType(descriptorType),
-                            inferenceContext.asInstType(primaryTarget), inferenceContext);
+                    setFunctionalInfo(env, fExpr, pt, inferenceContext.asInstType(descriptorType),
+                            inferenceContext.asInstType(primaryTarget), checkContext);
                 }
             });
         } else {
-            ListBuffer<TypeSymbol> targets = ListBuffer.lb();
+            ListBuffer<Type> targets = ListBuffer.lb();
             if (pt.hasTag(CLASS)) {
                 if (pt.isCompound()) {
-                    targets.append(primaryTarget.tsym); //this goes first
+                    targets.append(types.removeWildcards(primaryTarget)); //this goes first
                     for (Type t : ((IntersectionClassType)pt()).interfaces_field) {
                         if (t != primaryTarget) {
-                            targets.append(t.tsym);
+                            targets.append(types.removeWildcards(t));
                         }
                     }
                 } else {
-                    targets.append(pt.tsym);
+                    targets.append(types.removeWildcards(primaryTarget));
                 }
             }
             fExpr.targets = targets.toList();
-            fExpr.descriptorType = descriptorType;
+            if (checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK &&
+                    pt != Type.recoveryType) {
+                //check that functional interface class is well-formed
+                ClassSymbol csym = types.makeFunctionalInterfaceClass(env,
+                        names.empty, List.of(fExpr.targets.head), ABSTRACT);
+                chk.checkImplementations(env.tree, csym, csym);
+            }
         }
     }
 
@@ -4301,7 +4356,7 @@
         if (env.info.lint.isEnabled(LintCategory.SERIAL) &&
             isSerializable(c) &&
             (c.flags() & Flags.ENUM) == 0 &&
-            (c.flags() & ABSTRACT) == 0) {
+            checkForSerial(c)) {
             checkSerialVersionUID(tree, c);
         }
         if (allowTypeAnnos) {
@@ -4313,6 +4368,22 @@
         }
     }
         // where
+        boolean checkForSerial(ClassSymbol c) {
+            if ((c.flags() & ABSTRACT) == 0) {
+                return true;
+            } else {
+                return c.members().anyMatch(anyNonAbstractOrDefaultMethod);
+            }
+        }
+
+        public static final Filter<Symbol> anyNonAbstractOrDefaultMethod = new Filter<Symbol>() {
+            @Override
+            public boolean accepts(Symbol s) {
+                return s.kind == Kinds.MTH &&
+                       (s.flags() & (DEFAULT | ABSTRACT)) != ABSTRACT;
+            }
+        };
+
         /** get a diagnostic position for an attribute of Type t, or null if attribute missing */
         private DiagnosticPosition getDiagnosticPosition(JCClassDecl tree, Type t) {
             for(List<JCAnnotation> al = tree.mods.annotations; !al.isEmpty(); al = al.tail) {
@@ -4365,9 +4436,7 @@
         }
 
     private Type capture(Type type) {
-        //do not capture free types
-        return resultInfo.checkContext.inferenceContext().free(type) ?
-                type : types.capture(type);
+        return types.capture(type);
     }
 
     private void validateTypeAnnotations(JCTree tree) {
@@ -4579,9 +4648,6 @@
         @Override
         public void visitLambda(JCLambda that) {
             super.visitLambda(that);
-            if (that.descriptorType == null) {
-                that.descriptorType = syms.unknownType;
-            }
             if (that.targets == null) {
                 that.targets = List.nil();
             }
@@ -4593,9 +4659,6 @@
             if (that.sym == null) {
                 that.sym = new MethodSymbol(0, names.empty, syms.unknownType, syms.noSymbol);
             }
-            if (that.descriptorType == null) {
-                that.descriptorType = syms.unknownType;
-            }
             if (that.targets == null) {
                 that.targets = List.nil();
             }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Fri Jul 26 14:07:32 2013 -0700
@@ -897,7 +897,8 @@
                     assertConvertible(arg, arg.type, varArg, warn);
                     args = args.tail;
                 }
-            } else if ((sym.flags() & VARARGS) != 0 && allowVarargs) {
+            } else if ((sym.flags() & (VARARGS | SIGNATURE_POLYMORPHIC)) == VARARGS &&
+                    allowVarargs) {
                 // non-varargs call to varargs method
                 Type varParam = owntype.getParameterTypes().last();
                 Type lastArg = argtypes.last();
@@ -2275,24 +2276,6 @@
         c.flags_field |= ACYCLIC;
     }
 
-    /**
-     * Check that functional interface methods would make sense when seen
-     * from the perspective of the implementing class
-     */
-    void checkFunctionalInterface(JCTree tree, Type funcInterface) {
-        ClassType c = new ClassType(Type.noType, List.<Type>nil(), null);
-        ClassSymbol csym = new ClassSymbol(0, names.empty, c, syms.noSymbol);
-        c.interfaces_field = List.of(types.removeWildcards(funcInterface));
-        c.supertype_field = syms.objectType;
-        c.tsym = csym;
-        csym.members_field = new Scope(csym);
-        Symbol descSym = types.findDescriptorSymbol(funcInterface.tsym);
-        Type descType = types.findDescriptorType(funcInterface);
-        csym.members_field.enter(new MethodSymbol(PUBLIC, descSym.name, descType, csym));
-        csym.completer = null;
-        checkImplementations(tree, csym, csym);
-    }
-
     /** Check that all methods which implement some
      *  method conform to the method they implement.
      *  @param tree         The class definition whose members are checked.
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,15 +34,14 @@
 import com.sun.tools.javac.comp.Attr.ResultInfo;
 import com.sun.tools.javac.comp.Infer.InferenceContext;
 import com.sun.tools.javac.comp.Resolve.MethodResolutionPhase;
+import com.sun.tools.javac.comp.Resolve.ReferenceLookupHelper;
 import com.sun.tools.javac.tree.JCTree.*;
 
-import javax.tools.JavaFileObject;
 
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.LinkedHashSet;
 import java.util.Map;
-import java.util.Queue;
 import java.util.Set;
 import java.util.WeakHashMap;
 
@@ -95,7 +94,18 @@
         make = TreeMaker.instance(context);
         types = Types.instance(context);
         Names names = Names.instance(context);
-        stuckTree = make.Ident(names.empty).setType(Type.noType);
+        stuckTree = make.Ident(names.empty).setType(Type.stuckType);
+        emptyDeferredAttrContext =
+            new DeferredAttrContext(AttrMode.CHECK, null, MethodResolutionPhase.BOX, infer.emptyContext, null, null) {
+                @Override
+                void addDeferredAttrNode(DeferredType dt, ResultInfo ri, List<Type> stuckVars) {
+                    Assert.error("Empty deferred context!");
+                }
+                @Override
+                void complete() {
+                    Assert.error("Empty deferred context!");
+                }
+            };
     }
 
     /** shared tree for stuck expressions */
@@ -117,7 +127,7 @@
         DeferredType(JCExpression tree, Env<AttrContext> env) {
             super(null);
             this.tree = tree;
-            this.env = env.dup(tree, env.info.dup());
+            this.env = attr.copyEnv(env);
             this.speculativeCache = new SpeculativeCache();
         }
 
@@ -253,7 +263,7 @@
     DeferredTypeCompleter dummyCompleter = new DeferredTypeCompleter() {
         public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
             Assert.check(deferredAttrContext.mode == AttrMode.CHECK);
-            return dt.tree.type = Type.noType;
+            return dt.tree.type = Type.stuckType;
         }
     };
 
@@ -479,12 +489,10 @@
 
             ResultInfo resultInfo;
             InferenceContext inferenceContext;
-            Env<AttrContext> env;
 
             public Type complete(DeferredType dt, ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
                 this.resultInfo = resultInfo;
                 this.inferenceContext = deferredAttrContext.inferenceContext;
-                this.env = dt.env.dup(dt.tree, dt.env.info.dup());
                 dt.tree.accept(this);
                 dt.speculativeCache.put(deferredAttrContext.msym, stuckTree, deferredAttrContext.phase);
                 return Type.noType;
@@ -533,18 +541,7 @@
                     } catch (Types.FunctionDescriptorLookupError ex) {
                         checkContext.report(null, ex.getDiagnostic());
                     }
-                    JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), env,
-                            attr.memberReferenceQualifierResult(tree));
-                    ListBuffer<Type> argtypes = ListBuffer.lb();
-                    for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
-                        argtypes.append(Type.noType);
-                    }
-                    JCMemberReference mref2 = new TreeCopier<Void>(make).copy(tree);
-                    mref2.expr = exprTree;
-                    Pair<Symbol, ?> lookupRes =
-                            rs.resolveMemberReference(tree, env, mref2, exprTree.type,
-                                tree.name, argtypes.toList(), null, true, rs.arityMethodCheck);
-                    switch (lookupRes.fst.kind) {
+                    switch (tree.sym.kind) {
                         //note: as argtypes are erroneous types, type-errors must
                         //have been caused by arity mismatch
                         case Kinds.ABSENT_MTH:
@@ -560,17 +557,7 @@
     }
 
     /** an empty deferred attribution context - all methods throw exceptions */
-    final DeferredAttrContext emptyDeferredAttrContext =
-            new DeferredAttrContext(AttrMode.CHECK, null, MethodResolutionPhase.BOX, null, null, null) {
-                @Override
-                void addDeferredAttrNode(DeferredType dt, ResultInfo ri, List<Type> stuckVars) {
-                    Assert.error("Empty deferred context!");
-                }
-                @Override
-                void complete() {
-                    Assert.error("Empty deferred context!");
-                }
-            };
+    final DeferredAttrContext emptyDeferredAttrContext;
 
     /**
      * Map a list of types possibly containing one or more deferred types
@@ -649,7 +636,12 @@
          * a default expected type (j.l.Object).
          */
         private Type recover(DeferredType dt) {
-            dt.check(attr.new RecoveryInfo(deferredAttrContext));
+            dt.check(attr.new RecoveryInfo(deferredAttrContext) {
+                @Override
+                protected Type check(DiagnosticPosition pos, Type found) {
+                    return chk.checkNonVoid(pos, super.check(pos, found));
+                }
+            });
             return super.apply(dt);
         }
     }
@@ -663,12 +655,12 @@
                 if (resultInfo.pt.hasTag(NONE) || resultInfo.pt.isErroneous()) {
             return List.nil();
         } else {
-            return stuckVarsInternal(tree, resultInfo.pt, resultInfo.checkContext.inferenceContext());
+            return stuckVarsInternal(tree, resultInfo.pt, env, resultInfo.checkContext.inferenceContext());
         }
     }
     //where
-        private List<Type> stuckVarsInternal(JCTree tree, Type pt, Infer.InferenceContext inferenceContext) {
-            StuckChecker sc = new StuckChecker(pt, inferenceContext);
+        private List<Type> stuckVarsInternal(JCTree tree, Type pt, Env<AttrContext> env, Infer.InferenceContext inferenceContext) {
+            StuckChecker sc = new StuckChecker(pt, env, inferenceContext);
             sc.scan(tree);
             return List.from(sc.stuckVars);
         }
@@ -748,11 +740,13 @@
     class StuckChecker extends PolyScanner {
 
         Type pt;
+        Env<AttrContext> env;
         Infer.InferenceContext inferenceContext;
         Set<Type> stuckVars = new LinkedHashSet<Type>();
 
-        StuckChecker(Type pt, Infer.InferenceContext inferenceContext) {
+        StuckChecker(Type pt, Env<AttrContext> env, Infer.InferenceContext inferenceContext) {
             this.pt = pt;
+            this.env = env;
             this.inferenceContext = inferenceContext;
         }
 
@@ -786,18 +780,41 @@
 
             Type descType = types.findDescriptorType(pt);
             List<Type> freeArgVars = inferenceContext.freeVarsIn(descType.getParameterTypes());
-            stuckVars.addAll(freeArgVars);
+            Env<AttrContext> localEnv = env.dup(tree, env.info.dup());
+            if (freeArgVars.nonEmpty()) {
+                //perform arity-based check
+                JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
+                        attr.memberReferenceQualifierResult(tree));
+                ListBuffer<Type> argtypes = ListBuffer.lb();
+                for (Type t : descType.getParameterTypes()) {
+                    argtypes.append(Type.noType);
+                }
+                JCMemberReference mref2 = new TreeCopier<Void>(make).copy(tree);
+                mref2.expr = exprTree;
+                Pair<Symbol, ReferenceLookupHelper> lookupRes =
+                        rs.resolveMemberReference(tree, localEnv, mref2, exprTree.type,
+                            tree.name, argtypes.toList(), null, true, rs.arityMethodCheck,
+                            inferenceContext);
+                Symbol res = tree.sym = lookupRes.fst;
+                if (res.kind >= Kinds.ERRONEOUS ||
+                        res.type.hasTag(FORALL) ||
+                        (res.flags() & Flags.VARARGS) != 0 ||
+                        (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
+                        exprTree.type.isRaw())) {
+                    stuckVars.addAll(freeArgVars);
+                }
+            }
         }
 
         void scanLambdaBody(JCLambda lambda, final Type pt) {
             if (lambda.getBodyKind() == JCTree.JCLambda.BodyKind.EXPRESSION) {
-                stuckVars.addAll(stuckVarsInternal(lambda.body, pt, inferenceContext));
+                stuckVars.addAll(stuckVarsInternal(lambda.body, pt, env, inferenceContext));
             } else {
                 LambdaReturnScanner lambdaScanner = new LambdaReturnScanner() {
                     @Override
                     public void visitReturn(JCReturn tree) {
                         if (tree.expr != null) {
-                            stuckVars.addAll(stuckVarsInternal(tree.expr, pt, inferenceContext));
+                            stuckVars.addAll(stuckVarsInternal(tree.expr, pt, env, inferenceContext));
                         }
                     }
                 };
@@ -941,12 +958,13 @@
                     attribSpeculative(rec, env, attr.unknownTypeExprInfo).type :
                     env.enclClass.sym.type;
 
-            ListBuffer<Type> args = ListBuffer.lb();
-            for (int i = 0; i < tree.args.length(); i ++) {
-                args.append(Type.noType);
+            while (site.hasTag(TYPEVAR)) {
+                site = site.getUpperBound();
             }
 
-            Resolve.LookupHelper lh = rs.new LookupHelper(name, site, args.toList(), List.<Type>nil(), MethodResolutionPhase.VARARITY) {
+            List<Type> args = rs.dummyArgs(tree.args.length());
+
+            Resolve.LookupHelper lh = rs.new LookupHelper(name, site, args, List.<Type>nil(), MethodResolutionPhase.VARARITY) {
                 @Override
                 Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                     return rec == null ?
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Fri Jul 26 14:07:32 2013 -0700
@@ -373,6 +373,15 @@
         boolean resolveBreaks(JCTree tree, ListBuffer<P> oldPendingExits) {
             return resolveJump(tree, oldPendingExits, JumpKind.BREAK);
         }
+
+        @Override
+        public void scan(JCTree tree) {
+            if (tree != null && (
+                    tree.type == null ||
+                    tree.type != Type.stuckType)) {
+                super.scan(tree);
+            }
+        }
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -41,9 +41,11 @@
 import com.sun.tools.javac.comp.Resolve.InapplicableMethodException;
 import com.sun.tools.javac.comp.Resolve.VerboseResolutionMode;
 
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -149,7 +151,7 @@
         inferenceException.clear();
         try {
             DeferredAttr.DeferredAttrContext deferredAttrContext =
-                    resolveContext.deferredAttrContext(msym, inferenceContext, resultInfo, warn);
+                        resolveContext.deferredAttrContext(msym, inferenceContext, resultInfo, warn);
 
             resolveContext.methodCheck.argumentsAcceptable(env, deferredAttrContext,
                     argtypes, mt.getParameterTypes(), warn);
@@ -159,7 +161,8 @@
                     !warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
                 //inject return constraints earlier
                 checkWithinBounds(inferenceContext, warn); //propagation
-                generateReturnConstraints(resultInfo, mt, inferenceContext);
+                Type newRestype = generateReturnConstraints(resultInfo, mt, inferenceContext);
+                mt = (MethodType)types.createMethodTypeWithReturn(mt, newRestype);
                 //propagate outwards if needed
                 if (resultInfo.checkContext.inferenceContext().free(resultInfo.pt)) {
                     //propagate inference context outwards and exit
@@ -209,9 +212,20 @@
      * call occurs in a context where a type T is expected, use the expected
      * type to derive more constraints on the generic method inference variables.
      */
-    void generateReturnConstraints(Attr.ResultInfo resultInfo,
+    Type generateReturnConstraints(Attr.ResultInfo resultInfo,
             MethodType mt, InferenceContext inferenceContext) {
-        Type qtype1 = inferenceContext.asFree(mt.getReturnType());
+        Type from = mt.getReturnType();
+        if (mt.getReturnType().containsAny(inferenceContext.inferencevars) &&
+                resultInfo.checkContext.inferenceContext() != emptyContext) {
+            from = types.capture(from);
+            //add synthetic captured ivars
+            for (Type t : from.getTypeArguments()) {
+                if (t.hasTag(TYPEVAR) && ((TypeVar)t).isCaptured()) {
+                    inferenceContext.addVar((TypeVar)t);
+                }
+            }
+        }
+        Type qtype1 = inferenceContext.asFree(from);
         Type to = returnConstraintTarget(qtype1, resultInfo.pt);
         Assert.check(allowGraphInference || !resultInfo.checkContext.inferenceContext().free(to),
                 "legacy inference engine cannot handle constraints on both sides of a subtyping assertion");
@@ -224,33 +238,34 @@
                     .setMessage("infer.no.conforming.instance.exists",
                     inferenceContext.restvars(), mt.getReturnType(), to);
         }
+        return from;
     }
-    //where
-        private Type returnConstraintTarget(Type from, Type to) {
-            if (from.hasTag(VOID)) {
-                return syms.voidType;
-            } else if (to.hasTag(NONE)) {
-                return from.isPrimitive() ? from : syms.objectType;
-            } else if (from.hasTag(UNDETVAR) && to.isPrimitive()) {
-                if (!allowGraphInference) {
-                    //if legacy, just return boxed type
-                    return types.boxedClass(to).type;
+
+    Type returnConstraintTarget(Type from, Type to) {
+        if (from.hasTag(VOID)) {
+            return syms.voidType;
+        } else if (to.hasTag(NONE)) {
+            return from.isPrimitive() ? from : syms.objectType;
+        } else if (from.hasTag(UNDETVAR) && to.isPrimitive()) {
+            if (!allowGraphInference) {
+                //if legacy, just return boxed type
+                return types.boxedClass(to).type;
+            }
+            //if graph inference we need to skip conflicting boxed bounds...
+            UndetVar uv = (UndetVar)from;
+            for (Type t : uv.getBounds(InferenceBound.EQ, InferenceBound.LOWER)) {
+                Type boundAsPrimitive = types.unboxedType(t);
+                if (boundAsPrimitive == null) continue;
+                if (types.isConvertible(boundAsPrimitive, to)) {
+                    //effectively skip return-type constraint generation (compatibility)
+                    return syms.objectType;
                 }
-                //if graph inference we need to skip conflicting boxed bounds...
-                UndetVar uv = (UndetVar)from;
-                for (Type t : uv.getBounds(InferenceBound.EQ, InferenceBound.LOWER)) {
-                    Type boundAsPrimitive = types.unboxedType(t);
-                    if (boundAsPrimitive == null) continue;
-                    if (types.isConvertible(boundAsPrimitive, to)) {
-                        //effectively skip return-type constraint generation (compatibility)
-                        return syms.objectType;
-                    }
-                }
-                return types.boxedClass(to).type;
-            } else {
-                return to;
             }
+            return types.boxedClass(to).type;
+        } else {
+            return to;
         }
+    }
 
     /**
       * Infer cyclic inference variables as described in 15.12.2.8.
@@ -418,6 +433,7 @@
     void checkWithinBounds(InferenceContext inferenceContext,
                              Warner warn) throws InferenceException {
         MultiUndetVarListener mlistener = new MultiUndetVarListener(inferenceContext.undetvars);
+        List<Type> saved_undet = inferenceContext.save();
         try {
             while (true) {
                 mlistener.reset();
@@ -435,7 +451,9 @@
                     EnumSet<IncorporationStep> incorporationSteps = allowGraphInference ?
                             incorporationStepsGraph : incorporationStepsLegacy;
                     for (IncorporationStep is : incorporationSteps) {
-                        is.apply(uv, inferenceContext, warn);
+                        if (is.accepts(uv, inferenceContext)) {
+                            is.apply(uv, inferenceContext, warn);
+                        }
                     }
                 }
                 if (!mlistener.changed || !allowGraphInference) break;
@@ -443,6 +461,10 @@
         }
         finally {
             mlistener.detach();
+            if (incorporationCache.size() == MAX_INCORPORATION_STEPS) {
+                inferenceContext.rollback(saved_undet);
+            }
+            incorporationCache.clear();
         }
     }
     //where
@@ -454,7 +476,6 @@
          */
         class MultiUndetVarListener implements UndetVar.UndetVarListener {
 
-            int rounds;
             boolean changed;
             List<Type> undetvars;
 
@@ -468,13 +489,12 @@
 
             public void varChanged(UndetVar uv, Set<InferenceBound> ibs) {
                 //avoid non-termination
-                if (rounds < MAX_INCORPORATION_STEPS) {
+                if (incorporationCache.size() < MAX_INCORPORATION_STEPS) {
                     changed = true;
                 }
             }
 
             void reset() {
-                rounds++;
                 changed = false;
             }
 
@@ -507,22 +527,27 @@
                 if (uv.inst != null) {
                     Type inst = uv.inst;
                     for (Type u : uv.getBounds(InferenceBound.UPPER)) {
-                        if (!infer.types.isSubtypeUnchecked(inst, inferenceContext.asFree(u), warn)) {
+                        if (!isSubtype(inst, inferenceContext.asFree(u), warn, infer)) {
                             infer.reportBoundError(uv, BoundErrorKind.UPPER);
                         }
                     }
                     for (Type l : uv.getBounds(InferenceBound.LOWER)) {
-                        if (!infer.types.isSubtypeUnchecked(inferenceContext.asFree(l), inst, warn)) {
+                        if (!isSubtype(inferenceContext.asFree(l), inst, warn, infer)) {
                             infer.reportBoundError(uv, BoundErrorKind.LOWER);
                         }
                     }
                     for (Type e : uv.getBounds(InferenceBound.EQ)) {
-                        if (!infer.types.isSameType(inst, inferenceContext.asFree(e))) {
+                        if (!isSameType(inst, inferenceContext.asFree(e), infer)) {
                             infer.reportBoundError(uv, BoundErrorKind.EQ);
                         }
                     }
                 }
             }
+            @Override
+            boolean accepts(UndetVar uv, InferenceContext inferenceContext) {
+                //applies to all undetvars
+                return true;
+            }
         },
         /**
          * Check consistency of equality constraints. This is a slightly more aggressive
@@ -535,19 +560,19 @@
                 Type eq = null;
                 for (Type e : uv.getBounds(InferenceBound.EQ)) {
                     Assert.check(!inferenceContext.free(e));
-                    if (eq != null && !infer.types.isSameType(e, eq)) {
+                    if (eq != null && !isSameType(e, eq, infer)) {
                         infer.reportBoundError(uv, BoundErrorKind.EQ);
                     }
                     eq = e;
                     for (Type l : uv.getBounds(InferenceBound.LOWER)) {
                         Assert.check(!inferenceContext.free(l));
-                        if (!infer.types.isSubtypeUnchecked(l, e, warn)) {
+                        if (!isSubtype(l, e, warn, infer)) {
                             infer.reportBoundError(uv, BoundErrorKind.BAD_EQ_LOWER);
                         }
                     }
                     for (Type u : uv.getBounds(InferenceBound.UPPER)) {
                         if (inferenceContext.free(u)) continue;
-                        if (!infer.types.isSubtypeUnchecked(e, u, warn)) {
+                        if (!isSubtype(e, u, warn, infer)) {
                             infer.reportBoundError(uv, BoundErrorKind.BAD_EQ_UPPER);
                         }
                     }
@@ -563,12 +588,12 @@
                 for (Type e : uv.getBounds(InferenceBound.EQ)) {
                     if (e.containsAny(inferenceContext.inferenceVars())) continue;
                     for (Type u : uv.getBounds(InferenceBound.UPPER)) {
-                        if (!infer.types.isSubtypeUnchecked(e, inferenceContext.asFree(u), warn)) {
+                        if (!isSubtype(e, inferenceContext.asFree(u), warn, infer)) {
                             infer.reportBoundError(uv, BoundErrorKind.BAD_EQ_UPPER);
                         }
                     }
                     for (Type l : uv.getBounds(InferenceBound.LOWER)) {
-                        if (!infer.types.isSubtypeUnchecked(inferenceContext.asFree(l), e, warn)) {
+                        if (!isSubtype(inferenceContext.asFree(l), e, warn, infer)) {
                             infer.reportBoundError(uv, BoundErrorKind.BAD_EQ_LOWER);
                         }
                     }
@@ -584,7 +609,7 @@
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
                     for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
-                        infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
+                        isSubtype(inferenceContext.asFree(b2), inferenceContext.asFree(b1), warn , infer);
                     }
                 }
             }
@@ -598,7 +623,7 @@
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
                     for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
-                        infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
+                        isSubtype(inferenceContext.asFree(b2), inferenceContext.asFree(b1), warn, infer);
                     }
                 }
             }
@@ -612,7 +637,7 @@
                 Infer infer = inferenceContext.infer();
                 for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
                     for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
-                        infer.types.isSubtypeUnchecked(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
+                        isSubtype(inferenceContext.asFree(b2), inferenceContext.asFree(b1), warn, infer);
                     }
                 }
             }
@@ -627,7 +652,7 @@
                 for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
                     for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
                         if (b1 != b2) {
-                            infer.types.isSameType(inferenceContext.asFree(b2), inferenceContext.asFree(b1));
+                            isSameType(inferenceContext.asFree(b2), inferenceContext.asFree(b1), infer);
                         }
                     }
                 }
@@ -643,16 +668,17 @@
                 for (Type b : uv.getBounds(InferenceBound.UPPER)) {
                     if (inferenceContext.inferenceVars().contains(b)) {
                         UndetVar uv2 = (UndetVar)inferenceContext.asFree(b);
+                        if (uv2.isCaptured()) continue;
                         //alpha <: beta
                         //0. set beta :> alpha
-                        uv2.addBound(InferenceBound.LOWER, uv.qtype, infer.types);
+                        addBound(InferenceBound.LOWER, uv2, inferenceContext.asInstType(uv.qtype), infer);
                         //1. copy alpha's lower to beta's
                         for (Type l : uv.getBounds(InferenceBound.LOWER)) {
-                            uv2.addBound(InferenceBound.LOWER, inferenceContext.asInstType(l), infer.types);
+                            addBound(InferenceBound.LOWER, uv2, inferenceContext.asInstType(l), infer);
                         }
                         //2. copy beta's upper to alpha's
                         for (Type u : uv2.getBounds(InferenceBound.UPPER)) {
-                            uv.addBound(InferenceBound.UPPER, inferenceContext.asInstType(u), infer.types);
+                            addBound(InferenceBound.UPPER, uv, inferenceContext.asInstType(u), infer);
                         }
                     }
                 }
@@ -668,16 +694,17 @@
                 for (Type b : uv.getBounds(InferenceBound.LOWER)) {
                     if (inferenceContext.inferenceVars().contains(b)) {
                         UndetVar uv2 = (UndetVar)inferenceContext.asFree(b);
+                        if (uv2.isCaptured()) continue;
                         //alpha :> beta
                         //0. set beta <: alpha
-                        uv2.addBound(InferenceBound.UPPER, uv.qtype, infer.types);
+                        addBound(InferenceBound.UPPER, uv2, inferenceContext.asInstType(uv.qtype), infer);
                         //1. copy alpha's upper to beta's
                         for (Type u : uv.getBounds(InferenceBound.UPPER)) {
-                            uv2.addBound(InferenceBound.UPPER, inferenceContext.asInstType(u), infer.types);
+                            addBound(InferenceBound.UPPER, uv2, inferenceContext.asInstType(u), infer);
                         }
                         //2. copy beta's lower to alpha's
                         for (Type l : uv2.getBounds(InferenceBound.LOWER)) {
-                            uv.addBound(InferenceBound.LOWER, inferenceContext.asInstType(l), infer.types);
+                            addBound(InferenceBound.LOWER, uv, inferenceContext.asInstType(l), infer);
                         }
                     }
                 }
@@ -693,14 +720,15 @@
                 for (Type b : uv.getBounds(InferenceBound.EQ)) {
                     if (inferenceContext.inferenceVars().contains(b)) {
                         UndetVar uv2 = (UndetVar)inferenceContext.asFree(b);
+                        if (uv2.isCaptured()) continue;
                         //alpha == beta
                         //0. set beta == alpha
-                        uv2.addBound(InferenceBound.EQ, uv.qtype, infer.types);
+                        addBound(InferenceBound.EQ, uv2, inferenceContext.asInstType(uv.qtype), infer);
                         //1. copy all alpha's bounds to beta's
                         for (InferenceBound ib : InferenceBound.values()) {
                             for (Type b2 : uv.getBounds(ib)) {
                                 if (b2 != uv2) {
-                                    uv2.addBound(ib, inferenceContext.asInstType(b2), infer.types);
+                                    addBound(ib, uv2, inferenceContext.asInstType(b2), infer);
                                 }
                             }
                         }
@@ -708,7 +736,7 @@
                         for (InferenceBound ib : InferenceBound.values()) {
                             for (Type b2 : uv2.getBounds(ib)) {
                                 if (b2 != uv) {
-                                    uv.addBound(ib, inferenceContext.asInstType(b2), infer.types);
+                                    addBound(ib, uv, inferenceContext.asInstType(b2), infer);
                                 }
                             }
                         }
@@ -718,6 +746,45 @@
         };
 
         abstract void apply(UndetVar uv, InferenceContext inferenceContext, Warner warn);
+
+        boolean accepts(UndetVar uv, InferenceContext inferenceContext) {
+            return !uv.isCaptured();
+        }
+
+        boolean isSubtype(Type s, Type t, Warner warn, Infer infer) {
+            return doIncorporationOp(IncorporationBinaryOpKind.IS_SUBTYPE, s, t, warn, infer);
+        }
+
+        boolean isSameType(Type s, Type t, Infer infer) {
+            return doIncorporationOp(IncorporationBinaryOpKind.IS_SAME_TYPE, s, t, null, infer);
+        }
+
+        void addBound(InferenceBound ib, UndetVar uv, Type b, Infer infer) {
+            doIncorporationOp(opFor(ib), uv, b, null, infer);
+        }
+
+        IncorporationBinaryOpKind opFor(InferenceBound boundKind) {
+            switch (boundKind) {
+                case EQ:
+                    return IncorporationBinaryOpKind.ADD_EQ_BOUND;
+                case LOWER:
+                    return IncorporationBinaryOpKind.ADD_LOWER_BOUND;
+                case UPPER:
+                    return IncorporationBinaryOpKind.ADD_UPPER_BOUND;
+                default:
+                    Assert.error("Can't get here!");
+                    return null;
+            }
+        }
+
+        boolean doIncorporationOp(IncorporationBinaryOpKind opKind, Type op1, Type op2, Warner warn, Infer infer) {
+            IncorporationBinaryOp newOp = infer.new IncorporationBinaryOp(opKind, op1, op2);
+            Boolean res = infer.incorporationCache.get(newOp);
+            if (res == null) {
+                infer.incorporationCache.put(newOp, res = newOp.apply(warn));
+            }
+            return res;
+        }
     }
 
     /** incorporation steps to be executed when running in legacy mode */
@@ -728,6 +795,102 @@
             EnumSet.complementOf(EnumSet.of(IncorporationStep.EQ_CHECK_LEGACY));
 
     /**
+     * Three kinds of basic operation are supported as part of an incorporation step:
+     * (i) subtype check, (ii) same type check and (iii) bound addition (either
+     * upper/lower/eq bound).
+     */
+    enum IncorporationBinaryOpKind {
+        IS_SUBTYPE() {
+            @Override
+            boolean apply(Type op1, Type op2, Warner warn, Types types) {
+                return types.isSubtypeUnchecked(op1, op2, warn);
+            }
+        },
+        IS_SAME_TYPE() {
+            @Override
+            boolean apply(Type op1, Type op2, Warner warn, Types types) {
+                return types.isSameType(op1, op2);
+            }
+        },
+        ADD_UPPER_BOUND() {
+            @Override
+            boolean apply(Type op1, Type op2, Warner warn, Types types) {
+                UndetVar uv = (UndetVar)op1;
+                uv.addBound(InferenceBound.UPPER, op2, types);
+                return true;
+            }
+        },
+        ADD_LOWER_BOUND() {
+            @Override
+            boolean apply(Type op1, Type op2, Warner warn, Types types) {
+                UndetVar uv = (UndetVar)op1;
+                uv.addBound(InferenceBound.LOWER, op2, types);
+                return true;
+            }
+        },
+        ADD_EQ_BOUND() {
+            @Override
+            boolean apply(Type op1, Type op2, Warner warn, Types types) {
+                UndetVar uv = (UndetVar)op1;
+                uv.addBound(InferenceBound.EQ, op2, types);
+                return true;
+            }
+        };
+
+        abstract boolean apply(Type op1, Type op2, Warner warn, Types types);
+    }
+
+    /**
+     * This class encapsulates a basic incorporation operation; incorporation
+     * operations takes two type operands and a kind. Each operation performed
+     * during an incorporation round is stored in a cache, so that operations
+     * are not executed unnecessarily (which would potentially lead to adding
+     * same bounds over and over).
+     */
+    class IncorporationBinaryOp {
+
+        IncorporationBinaryOpKind opKind;
+        Type op1;
+        Type op2;
+
+        IncorporationBinaryOp(IncorporationBinaryOpKind opKind, Type op1, Type op2) {
+            this.opKind = opKind;
+            this.op1 = op1;
+            this.op2 = op2;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (!(o instanceof IncorporationBinaryOp)) {
+                return false;
+            } else {
+                IncorporationBinaryOp that = (IncorporationBinaryOp)o;
+                return opKind == that.opKind &&
+                        types.isSameType(op1, that.op1, true) &&
+                        types.isSameType(op2, that.op2, true);
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            int result = opKind.hashCode();
+            result *= 127;
+            result += types.hashCode(op1);
+            result *= 127;
+            result += types.hashCode(op2);
+            return result;
+        }
+
+        boolean apply(Warner warn) {
+            return opKind.apply(op1, op2, warn, types);
+        }
+    }
+
+    /** an incorporation cache keeps track of all executed incorporation-related operations */
+    Map<IncorporationBinaryOp, Boolean> incorporationCache =
+            new HashMap<IncorporationBinaryOp, Boolean>();
+
+    /**
      * Make sure that the upper bounds we got so far lead to a solvable inference
      * variable by making sure that a glb exists.
      */
@@ -862,6 +1025,41 @@
                         Assert.check(!g.nodes.isEmpty(), "No nodes to solve!");
             return g.nodes.get(0);
         }
+
+        boolean isSubtype(Type s, Type t, Warner warn, Infer infer) {
+            return doIncorporationOp(IncorporationBinaryOpKind.IS_SUBTYPE, s, t, warn, infer);
+        }
+
+        boolean isSameType(Type s, Type t, Infer infer) {
+            return doIncorporationOp(IncorporationBinaryOpKind.IS_SAME_TYPE, s, t, null, infer);
+        }
+
+        void addBound(InferenceBound ib, UndetVar uv, Type b, Infer infer) {
+            doIncorporationOp(opFor(ib), uv, b, null, infer);
+        }
+
+        IncorporationBinaryOpKind opFor(InferenceBound boundKind) {
+            switch (boundKind) {
+                case EQ:
+                    return IncorporationBinaryOpKind.ADD_EQ_BOUND;
+                case LOWER:
+                    return IncorporationBinaryOpKind.ADD_LOWER_BOUND;
+                case UPPER:
+                    return IncorporationBinaryOpKind.ADD_UPPER_BOUND;
+                default:
+                    Assert.error("Can't get here!");
+                    return null;
+            }
+        }
+
+        boolean doIncorporationOp(IncorporationBinaryOpKind opKind, Type op1, Type op2, Warner warn, Infer infer) {
+            IncorporationBinaryOp newOp = infer.new IncorporationBinaryOp(opKind, op1, op2);
+            Boolean res = infer.incorporationCache.get(newOp);
+            if (res == null) {
+                infer.incorporationCache.put(newOp, res = newOp.apply(warn));
+            }
+            return res;
+        }
     }
 
     /**
@@ -878,27 +1076,32 @@
         }
 
         /**
-         * Computes the cost associated with a given node; the cost is computed
-         * as the total number of type-variables that should be eagerly instantiated
-         * in order to get to some of the variables in {@code varsToSolve} from
-         * a given node
+         * Computes the minimum path that goes from a given node to any of the nodes
+         * containing a variable in {@code varsToSolve}. For any given path, the cost
+         * is computed as the total number of type-variables that should be eagerly
+         * instantiated across that path.
          */
-        void computeCostIfNeeded(Node n, Map<Node, Integer> costMap) {
-            if (costMap.containsKey(n)) {
-                return;
-            } else if (!Collections.disjoint(n.data, varsToSolve)) {
-                costMap.put(n, n.data.size());
+        int computeMinPath(InferenceGraph g, Node n) {
+            return computeMinPath(g, n, List.<Node>nil(), 0);
+        }
+
+        int computeMinPath(InferenceGraph g, Node n, List<Node> path, int cost) {
+            if (path.contains(n)) return Integer.MAX_VALUE;
+            List<Node> path2 = path.prepend(n);
+            int cost2 = cost + n.data.size();
+            if (!Collections.disjoint(n.data, varsToSolve)) {
+                return cost2;
             } else {
-                int subcost = Integer.MAX_VALUE;
-                costMap.put(n, subcost); //avoid loops
-                for (Node n2 : n.getDependencies()) {
-                    computeCostIfNeeded(n2, costMap);
-                    subcost = Math.min(costMap.get(n2), subcost);
+               int bestPath = Integer.MAX_VALUE;
+               for (Node n2 : g.nodes) {
+                   if (n2.deps.contains(n)) {
+                       int res = computeMinPath(g, n2, path2, cost2);
+                       if (res < bestPath) {
+                           bestPath = res;
+                       }
+                   }
                 }
-                //update cost map to reflect real cost
-                costMap.put(n, subcost == Integer.MAX_VALUE ?
-                        Integer.MAX_VALUE :
-                        n.data.size() + subcost);
+               return bestPath;
             }
         }
 
@@ -907,21 +1110,20 @@
          */
         @Override
         public Node pickNode(final InferenceGraph g) {
-            final Map<Node, Integer> costMap = new HashMap<Node, Integer>();
-            ArrayList<Node> leaves = new ArrayList<Node>();
+            final Map<Node, Integer> leavesMap = new HashMap<Node, Integer>();
             for (Node n : g.nodes) {
-                computeCostIfNeeded(n, costMap);
                 if (n.isLeaf(n)) {
-                    leaves.add(n);
+                    leavesMap.put(n, computeMinPath(g, n));
                 }
             }
-            Assert.check(!leaves.isEmpty(), "No nodes to solve!");
-            Collections.sort(leaves, new java.util.Comparator<Node>() {
+            Assert.check(!leavesMap.isEmpty(), "No nodes to solve!");
+            TreeSet<Node> orderedLeaves = new TreeSet<Node>(new Comparator<Node>() {
                 public int compare(Node n1, Node n2) {
-                    return costMap.get(n1) - costMap.get(n2);
+                    return leavesMap.get(n1) - leavesMap.get(n2);
                 }
             });
-            return leaves.get(0);
+            orderedLeaves.addAll(leavesMap.keySet());
+            return orderedLeaves.first();
         }
     }
 
@@ -964,6 +1166,39 @@
             }
         },
         /**
+         * Infer uninstantiated/unbound inference variables occurring in 'throws'
+         * clause as RuntimeException
+         */
+        THROWS(InferenceBound.UPPER) {
+            @Override
+            public boolean accepts(UndetVar t, InferenceContext inferenceContext) {
+                if ((t.qtype.tsym.flags() & Flags.THROWS) == 0) {
+                    //not a throws undet var
+                    return false;
+                }
+                if (t.getBounds(InferenceBound.EQ, InferenceBound.LOWER, InferenceBound.UPPER)
+                            .diff(t.getDeclaredBounds()).nonEmpty()) {
+                    //not an unbounded undet var
+                    return false;
+                }
+                Infer infer = inferenceContext.infer();
+                for (Type db : t.getDeclaredBounds()) {
+                    if (t.isInterface()) continue;
+                    if (infer.types.asSuper(infer.syms.runtimeExceptionType, db.tsym) != null) {
+                        //declared bound is a supertype of RuntimeException
+                        return true;
+                    }
+                }
+                //declared bound is more specific then RuntimeException - give up
+                return false;
+            }
+
+            @Override
+            Type solve(UndetVar uv, InferenceContext inferenceContext) {
+                return inferenceContext.infer().syms.runtimeExceptionType;
+            }
+        },
+        /**
          * Instantiate an inference variables using its (ground) upper bounds. Such
          * bounds are merged together using glb().
          */
@@ -990,13 +1225,36 @@
         UPPER_LEGACY(InferenceBound.UPPER) {
             @Override
             public boolean accepts(UndetVar t, InferenceContext inferenceContext) {
-                return !inferenceContext.free(t.getBounds(ib));
+                return !inferenceContext.free(t.getBounds(ib)) && !t.isCaptured();
             }
 
             @Override
             Type solve(UndetVar uv, InferenceContext inferenceContext) {
                 return UPPER.solve(uv, inferenceContext);
             }
+        },
+        /**
+         * Like the former; the only difference is that this step can only be applied
+         * if all upper/lower bounds are ground.
+         */
+        CAPTURED(InferenceBound.UPPER) {
+            @Override
+            public boolean accepts(UndetVar t, InferenceContext inferenceContext) {
+                return !inferenceContext.free(t.getBounds(InferenceBound.UPPER, InferenceBound.LOWER));
+            }
+
+            @Override
+            Type solve(UndetVar uv, InferenceContext inferenceContext) {
+                Infer infer = inferenceContext.infer();
+                Type upper = UPPER.filterBounds(uv, inferenceContext).nonEmpty() ?
+                        UPPER.solve(uv, inferenceContext) :
+                        infer.syms.objectType;
+                Type lower = LOWER.filterBounds(uv, inferenceContext).nonEmpty() ?
+                        LOWER.solve(uv, inferenceContext) :
+                        infer.syms.botType;
+                CapturedType prevCaptured = (CapturedType)uv.qtype;
+                return new CapturedType(prevCaptured.tsym.name, prevCaptured.tsym.owner, upper, lower, prevCaptured.wildcard);
+            }
         };
 
         final InferenceBound ib;
@@ -1015,7 +1273,7 @@
          * Can the inference variable be instantiated using this step?
          */
         public boolean accepts(UndetVar t, InferenceContext inferenceContext) {
-            return filterBounds(t, inferenceContext).nonEmpty();
+            return filterBounds(t, inferenceContext).nonEmpty() && !t.isCaptured();
         }
 
         /**
@@ -1052,7 +1310,7 @@
 
         EQ(EnumSet.of(InferenceStep.EQ)),
         EQ_LOWER(EnumSet.of(InferenceStep.EQ, InferenceStep.LOWER)),
-        EQ_LOWER_UPPER(EnumSet.of(InferenceStep.EQ, InferenceStep.LOWER, InferenceStep.UPPER));
+        EQ_LOWER_THROWS_UPPER_CAPTURED(EnumSet.of(InferenceStep.EQ, InferenceStep.LOWER, InferenceStep.UPPER, InferenceStep.THROWS, InferenceStep.CAPTURED));
 
         final EnumSet<InferenceStep> steps;
 
@@ -1090,7 +1348,7 @@
             while (!sstrategy.done()) {
                 InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
                 List<Type> varsToSolve = List.from(nodeToSolve.data);
-                inferenceContext.save();
+                List<Type> saved_undet = inferenceContext.save();
                 try {
                     //repeat until all variables are solved
                     outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
@@ -1107,7 +1365,7 @@
                 }
                 catch (InferenceException ex) {
                     //did we fail because of interdependent ivars?
-                    inferenceContext.rollback();
+                    inferenceContext.rollback(saved_undet);
                     instantiateAsUninferredVars(varsToSolve, inferenceContext);
                     checkWithinBounds(inferenceContext, warn);
                 }
@@ -1300,9 +1558,6 @@
         /** list of inference vars in this context */
         List<Type> inferencevars;
 
-        /** backed up inference variables */
-        List<Type> saved_undet;
-
         java.util.Map<FreeTypeListener, List<Type>> freeTypeListeners =
                 new java.util.HashMap<FreeTypeListener, List<Type>>();
 
@@ -1316,12 +1571,26 @@
             Mapping fromTypeVarFun = new Mapping("fromTypeVarFunWithBounds") {
                 // mapping that turns inference variables into undet vars
                 public Type apply(Type t) {
-                    if (t.hasTag(TYPEVAR)) return new UndetVar((TypeVar)t, types);
-                    else return t.map(this);
+                    if (t.hasTag(TYPEVAR)) {
+                        TypeVar tv = (TypeVar)t;
+                        return tv.isCaptured() ?
+                                new CapturedUndetVar((CapturedType)tv, types) :
+                                new UndetVar(tv, types);
+                    } else {
+                        return t.map(this);
+                    }
                 }
             };
 
         /**
+         * add a new inference var to this inference context
+         */
+        void addVar(TypeVar t) {
+            this.undetvars = this.undetvars.prepend(fromTypeVarFun.apply(t));
+            this.inferencevars = this.inferencevars.prepend(t);
+        }
+
+        /**
          * returns the list of free variables (as type-variables) in this
          * inference context
          */
@@ -1502,7 +1771,7 @@
         /**
          * Save the state of this inference context
          */
-        void save() {
+        List<Type> save() {
             ListBuffer<Type> buf = ListBuffer.lb();
             for (Type t : undetvars) {
                 UndetVar uv = (UndetVar)t;
@@ -1515,16 +1784,24 @@
                 uv2.inst = uv.inst;
                 buf.add(uv2);
             }
-            saved_undet = buf.toList();
+            return buf.toList();
         }
 
         /**
          * Restore the state of this inference context to the previous known checkpoint
          */
-        void rollback() {
-            Assert.check(saved_undet != null && saved_undet.length() == undetvars.length());
-            undetvars = saved_undet;
-            saved_undet = null;
+        void rollback(List<Type> saved_undet) {
+             Assert.check(saved_undet != null && saved_undet.length() == undetvars.length());
+            //restore bounds (note: we need to preserve the old instances)
+            for (Type t : undetvars) {
+                UndetVar uv = (UndetVar)t;
+                UndetVar uv_saved = (UndetVar)saved_undet.head;
+                for (InferenceBound ib : InferenceBound.values()) {
+                    uv.setBounds(ib, uv_saved.getBounds(ib));
+                }
+                uv.inst = uv_saved.inst;
+                saved_undet = saved_undet.tail;
+            }
         }
 
         /**
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -100,6 +100,9 @@
     /** Flag for alternate metafactories indicating the lambda object has multiple targets */
     public static final int FLAG_MARKERS = 1 << 1;
 
+    /** Flag for alternate metafactories indicating the lambda object requires multiple bridges */
+    public static final int FLAG_BRIDGES = 1 << 2;
+
     private class KlassInfo {
 
         /**
@@ -321,7 +324,7 @@
         int refKind = referenceKind(sym);
 
         //convert to an invokedynamic call
-        result = makeMetaFactoryIndyCall(tree, context.needsAltMetafactory(), context.isSerializable(), refKind, sym, indy_args);
+        result = makeMetafactoryIndyCall(context, refKind, sym, indy_args);
     }
 
     private JCIdent makeThis(Type type, Symbol owner) {
@@ -382,7 +385,7 @@
 
 
         //build a sam instance using an indy call to the meta-factory
-        result = makeMetaFactoryIndyCall(tree, localContext.needsAltMetafactory(), localContext.isSerializable(), localContext.referenceKind(), refSym, indy_args);
+        result = makeMetafactoryIndyCall(localContext, localContext.referenceKind(), refSym, indy_args);
     }
 
     /**
@@ -606,8 +609,8 @@
                 make.Return(makeIndyCall(
                     pos,
                     syms.lambdaMetafactory,
-                    names.altMetaFactory,
-                    staticArgs, indyType, serArgs.toList())),
+                    names.altMetafactory,
+                    staticArgs, indyType, serArgs.toList(), samSym.name)),
                 null);
         ListBuffer<JCStatement> stmts = kInfo.deserializeCases.get(implMethodName);
         if (stmts == null) {
@@ -905,22 +908,26 @@
         kInfo.addMethod(new MemberReferenceBridger(tree, localContext).bridge());
     }
 
+    private MethodType typeToMethodType(Type mt) {
+        Type type = types.erasure(mt);
+        return new MethodType(type.getParameterTypes(),
+                        type.getReturnType(),
+                        type.getThrownTypes(),
+                        syms.methodClass);
+    }
+
     /**
      * Generate an indy method call to the meta factory
      */
-    private JCExpression makeMetaFactoryIndyCall(JCFunctionalExpression tree, boolean needsAltMetafactory,
-            boolean isSerializable, int refKind, Symbol refSym, List<JCExpression> indy_args) {
+    private JCExpression makeMetafactoryIndyCall(TranslationContext<?> context,
+            int refKind, Symbol refSym, List<JCExpression> indy_args) {
+        JCFunctionalExpression tree = context.tree;
         //determine the static bsm args
-        Type mtype = types.erasure(tree.descriptorType);
         MethodSymbol samSym = (MethodSymbol) types.findDescriptorSymbol(tree.type.tsym);
         List<Object> staticArgs = List.<Object>of(
-                new Pool.MethodHandle(ClassFile.REF_invokeInterface,
-                    types.findDescriptorSymbol(tree.type.tsym), types),
+                typeToMethodType(samSym.type),
                 new Pool.MethodHandle(refKind, refSym, types),
-                new MethodType(mtype.getParameterTypes(),
-                        mtype.getReturnType(),
-                        mtype.getThrownTypes(),
-                        syms.methodClass));
+                typeToMethodType(tree.getDescriptorType(types)));
 
         //computed indy arg types
         ListBuffer<Type> indy_args_types = ListBuffer.lb();
@@ -934,31 +941,46 @@
                 List.<Type>nil(),
                 syms.methodClass);
 
-        Name metafactoryName = needsAltMetafactory ?
-                names.altMetaFactory : names.metaFactory;
+        Name metafactoryName = context.needsAltMetafactory() ?
+                names.altMetafactory : names.metafactory;
 
-        if (needsAltMetafactory) {
+        if (context.needsAltMetafactory()) {
             ListBuffer<Object> markers = ListBuffer.lb();
-            for (Symbol t : tree.targets.tail) {
-                if (t != syms.serializableType.tsym) {
-                    markers.append(t);
+            for (Type t : tree.targets.tail) {
+                if (t.tsym != syms.serializableType.tsym) {
+                    markers.append(t.tsym);
                 }
             }
-            int flags = isSerializable? FLAG_SERIALIZABLE : 0;
+            int flags = context.isSerializable() ? FLAG_SERIALIZABLE : 0;
             boolean hasMarkers = markers.nonEmpty();
-            flags |= hasMarkers ? FLAG_MARKERS : 0;
+            boolean hasBridges = context.bridges.nonEmpty();
+            if (hasMarkers) {
+                flags |= FLAG_MARKERS;
+            }
+            if (hasBridges) {
+                flags |= FLAG_BRIDGES;
+            }
             staticArgs = staticArgs.append(flags);
             if (hasMarkers) {
                 staticArgs = staticArgs.append(markers.length());
                 staticArgs = staticArgs.appendList(markers.toList());
             }
-            if (isSerializable) {
+            if (hasBridges) {
+                staticArgs = staticArgs.append(context.bridges.length() - 1);
+                for (Symbol s : context.bridges) {
+                    Type s_erasure = s.erasure(types);
+                    if (!types.isSameType(s_erasure, samSym.erasure(types))) {
+                        staticArgs = staticArgs.append(s.erasure(types));
+                    }
+                }
+            }
+            if (context.isSerializable()) {
                 addDeserializationCase(refKind, refSym, tree.type, samSym,
                         tree, staticArgs, indyType);
             }
         }
 
-        return makeIndyCall(tree, syms.lambdaMetafactory, metafactoryName, staticArgs, indyType, indy_args);
+        return makeIndyCall(tree, syms.lambdaMetafactory, metafactoryName, staticArgs, indyType, indy_args, samSym.name);
     }
 
     /**
@@ -966,7 +988,8 @@
      * arguments types
      */
     private JCExpression makeIndyCall(DiagnosticPosition pos, Type site, Name bsmName,
-            List<Object> staticArgs, MethodType indyType, List<JCExpression> indyArgs) {
+            List<Object> staticArgs, MethodType indyType, List<JCExpression> indyArgs,
+            Name methName) {
         int prevPos = make.pos;
         try {
             make.at(pos);
@@ -978,7 +1001,7 @@
                     bsmName, bsm_staticArgs, List.<Type>nil());
 
             DynamicMethodSymbol dynSym =
-                    new DynamicMethodSymbol(names.lambda,
+                    new DynamicMethodSymbol(methName,
                                             syms.noSymbol,
                                             bsm.isStatic() ?
                                                 ClassFile.REF_invokeStatic :
@@ -1299,7 +1322,6 @@
 
                 // Make lambda holding the new-class call
                 JCLambda slam = make.Lambda(params, nc);
-                slam.descriptorType = tree.descriptorType;
                 slam.targets = tree.targets;
                 slam.type = tree.type;
                 slam.pos = tree.pos;
@@ -1634,23 +1656,30 @@
             /** the enclosing translation context (set for nested lambdas/mref) */
             TranslationContext<?> prev;
 
+            /** list of methods to be bridged by the meta-factory */
+            List<Symbol> bridges;
+
             TranslationContext(T tree) {
                 this.tree = tree;
                 this.owner = owner();
                 this.depth = frameStack.size() - 1;
                 this.prev = context();
+                ClassSymbol csym =
+                        types.makeFunctionalInterfaceClass(attrEnv, names.empty, tree.targets, ABSTRACT | INTERFACE);
+                this.bridges = types.functionalInterfaceBridges(csym);
             }
 
             /** does this functional expression need to be created using alternate metafactory? */
             boolean needsAltMetafactory() {
-                return (tree.targets.length() > 1 ||
-                        isSerializable());
+                return tree.targets.length() > 1 ||
+                        isSerializable() ||
+                        bridges.length() > 1;
             }
 
             /** does this functional expression require serialization support? */
             boolean isSerializable() {
-                for (Symbol target : tree.targets) {
-                    if (types.asSuper(target.type, syms.serializableType.tsym) != null) {
+                for (Type target : tree.targets) {
+                    if (types.asSuper(target, syms.serializableType.tsym) != null) {
                         return true;
                     }
                 }
@@ -1833,7 +1862,7 @@
             }
 
             Type generatedLambdaSig() {
-                return types.erasure(tree.descriptorType);
+                return types.erasure(tree.getDescriptorType(types));
             }
         }
 
@@ -1909,7 +1938,7 @@
             }
 
             Type bridgedRefSig() {
-                return types.erasure(types.findDescriptorSymbol(tree.targets.head).type);
+                return types.erasure(types.findDescriptorSymbol(tree.targets.head.tsym).type);
             }
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -358,7 +358,8 @@
      *  @param thrown      The method's thrown exceptions.
      *  @param env             The method's (local) environment.
      */
-    Type signature(List<JCTypeParameter> typarams,
+    Type signature(MethodSymbol msym,
+                   List<JCTypeParameter> typarams,
                    List<JCVariableDecl> params,
                    JCTree res,
                    JCVariableDecl recvparam,
@@ -392,8 +393,12 @@
         ListBuffer<Type> thrownbuf = new ListBuffer<Type>();
         for (List<JCExpression> l = thrown; l.nonEmpty(); l = l.tail) {
             Type exc = attr.attribType(l.head, env);
-            if (!exc.hasTag(TYPEVAR))
+            if (!exc.hasTag(TYPEVAR)) {
                 exc = chk.checkClassType(l.head.pos(), exc);
+            } else if (exc.tsym.owner == msym) {
+                //mark inference variables in 'throws' clause
+                exc.tsym.flags_field |= THROWS;
+            }
             thrownbuf.append(exc);
         }
         MethodType mtype = new MethodType(argbuf.toList(),
@@ -503,11 +508,17 @@
         // process package annotations
         annotateLater(tree.packageAnnotations, env, tree.packge);
 
-        // Import-on-demand java.lang.
-        importAll(tree.pos, reader.enterPackage(names.java_lang), env);
+        DeferredLintHandler prevLintHandler = chk.setDeferredLintHandler(DeferredLintHandler.immediateHandler);
+
+        try {
+            // Import-on-demand java.lang.
+            importAll(tree.pos, reader.enterPackage(names.java_lang), env);
 
-        // Process all import clauses.
-        memberEnter(tree.defs, env);
+            // Process all import clauses.
+            memberEnter(tree.defs, env);
+        } finally {
+            chk.setDeferredLintHandler(prevLintHandler);
+        }
     }
 
     // process the non-static imports and the static imports of types.
@@ -557,7 +568,7 @@
                 chk.setDeferredLintHandler(deferredLintHandler.setPos(tree.pos()));
         try {
             // Compute the method type
-            m.type = signature(tree.typarams, tree.params,
+            m.type = signature(m, tree.typarams, tree.params,
                                tree.restype, tree.recvparam,
                                tree.thrown,
                                localEnv);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jul 26 14:07:32 2013 -0700
@@ -345,7 +345,7 @@
 
     boolean isAccessible(Env<AttrContext> env, Type t, boolean checkInner) {
         return (t.hasTag(ARRAY))
-            ? isAccessible(env, types.elemtype(t))
+            ? isAccessible(env, types.upperBound(types.elemtype(t)))
             : isAccessible(env, t.tsym, checkInner);
     }
 
@@ -584,6 +584,13 @@
         try {
             currentResolutionContext = new MethodResolutionContext();
             currentResolutionContext.attrMode = DeferredAttr.AttrMode.CHECK;
+            if (env.tree.hasTag(JCTree.Tag.REFERENCE)) {
+                //method/constructor references need special check class
+                //to handle inference variables in 'argtypes' (might happen
+                //during an unsticking round)
+                currentResolutionContext.methodCheck =
+                        new MethodReferenceCheck(resultInfo.checkContext.inferenceContext());
+            }
             MethodResolutionPhase step = currentResolutionContext.step = env.info.pendingResolutionPhase;
             return rawInstantiate(env, site, m, resultInfo, argtypes, typeargtypes,
                     step.isBoxingRequired(), step.isVarargsRequired(), warn);
@@ -773,6 +780,14 @@
         }
     };
 
+    List<Type> dummyArgs(int length) {
+        ListBuffer<Type> buf = ListBuffer.lb();
+        for (int i = 0 ; i < length ; i++) {
+            buf.append(Type.noType);
+        }
+        return buf.toList();
+    }
+
     /**
      * Main method applicability routine. Given a list of actual types A,
      * a list of formal types F, determines whether the types in A are
@@ -850,6 +865,47 @@
         }
     };
 
+    class MethodReferenceCheck extends AbstractMethodCheck {
+
+        InferenceContext pendingInferenceContext;
+
+        MethodReferenceCheck(InferenceContext pendingInferenceContext) {
+            this.pendingInferenceContext = pendingInferenceContext;
+        }
+
+        @Override
+        void checkArg(DiagnosticPosition pos, boolean varargs, Type actual, Type formal, DeferredAttrContext deferredAttrContext, Warner warn) {
+            ResultInfo mresult = methodCheckResult(varargs, formal, deferredAttrContext, warn);
+            mresult.check(pos, actual);
+        }
+
+        private ResultInfo methodCheckResult(final boolean varargsCheck, Type to,
+                final DeferredAttr.DeferredAttrContext deferredAttrContext, Warner rsWarner) {
+            CheckContext checkContext = new MethodCheckContext(!deferredAttrContext.phase.isBoxingRequired(), deferredAttrContext, rsWarner) {
+                MethodCheckDiag methodDiag = varargsCheck ?
+                                 MethodCheckDiag.VARARG_MISMATCH : MethodCheckDiag.ARG_MISMATCH;
+
+                @Override
+                public boolean compatible(Type found, Type req, Warner warn) {
+                    found = pendingInferenceContext.asFree(found);
+                    req = infer.returnConstraintTarget(found, req);
+                    return super.compatible(found, req, warn);
+                }
+
+                @Override
+                public void report(DiagnosticPosition pos, JCDiagnostic details) {
+                    reportMC(pos, methodDiag, deferredAttrContext.inferenceContext, details);
+                }
+            };
+            return new MethodResultInfo(to, checkContext);
+        }
+
+        @Override
+        public MethodCheck mostSpecificCheck(List<Type> actuals, boolean strict) {
+            return new MostSpecificCheck(strict, actuals);
+        }
+    };
+
     /**
      * Check context to be used during method applicability checks. A method check
      * context might contain inference variables.
@@ -905,10 +961,23 @@
                 DeferredType dt = (DeferredType)found;
                 return dt.check(this);
             } else {
-                return super.check(pos, chk.checkNonVoid(pos, types.capture(types.upperBound(found.baseType()))));
+                return super.check(pos, chk.checkNonVoid(pos, types.capture(U(found.baseType()))));
             }
         }
 
+        /**
+         * javac has a long-standing 'simplification' (see 6391995):
+         * given an actual argument type, the method check is performed
+         * on its upper bound. This leads to inconsistencies when an
+         * argument type is checked against itself. For example, given
+         * a type-variable T, it is not true that {@code U(T) <: T},
+         * so we need to guard against that.
+         */
+        private Type U(Type found) {
+            return found == pt ?
+                    found : types.upperBound(found);
+        }
+
         @Override
         protected MethodResultInfo dup(Type newPt) {
             return new MethodResultInfo(newPt, checkContext);
@@ -2421,7 +2490,7 @@
                     Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
                         if (sym.kind >= AMBIGUOUS) {
                             final JCDiagnostic details = sym.kind == WRONG_MTH ?
-                                            ((InapplicableSymbolError)sym).errCandidate().details :
+                                            ((InapplicableSymbolError)sym).errCandidate().snd :
                                             null;
                             sym = new InapplicableSymbolError(sym.kind, "diamondError", currentResolutionContext) {
                                 @Override
@@ -2576,7 +2645,8 @@
                                   Name name, List<Type> argtypes,
                                   List<Type> typeargtypes,
                                   boolean boxingAllowed,
-                                  MethodCheck methodCheck) {
+                                  MethodCheck methodCheck,
+                                  InferenceContext inferenceContext) {
         MethodResolutionPhase maxPhase = boxingAllowed ? VARARITY : BASIC;
 
         ReferenceLookupHelper boundLookupHelper;
@@ -2599,7 +2669,7 @@
         Symbol boundSym = lookupMethod(boundEnv, env.tree.pos(), site.tsym, methodCheck, boundLookupHelper);
 
         //step 2 - unbound lookup
-        ReferenceLookupHelper unboundLookupHelper = boundLookupHelper.unboundLookup();
+        ReferenceLookupHelper unboundLookupHelper = boundLookupHelper.unboundLookup(inferenceContext);
         Env<AttrContext> unboundEnv = env.dup(env.tree, env.info.dup());
         Symbol unboundSym = lookupMethod(unboundEnv, env.tree.pos(), site.tsym, methodCheck, unboundLookupHelper);
 
@@ -2739,11 +2809,11 @@
          * Returns an unbound version of this lookup helper. By default, this
          * method returns an dummy lookup helper.
          */
-        ReferenceLookupHelper unboundLookup() {
+        ReferenceLookupHelper unboundLookup(InferenceContext inferenceContext) {
             //dummy loopkup helper that always return 'methodNotFound'
             return new ReferenceLookupHelper(referenceTree, name, site, argtypes, typeargtypes, maxPhase) {
                 @Override
-                ReferenceLookupHelper unboundLookup() {
+                ReferenceLookupHelper unboundLookup(InferenceContext inferenceContext) {
                     return this;
                 }
                 @Override
@@ -2793,14 +2863,15 @@
         }
 
         @Override
-        ReferenceLookupHelper unboundLookup() {
+        ReferenceLookupHelper unboundLookup(InferenceContext inferenceContext) {
             if (TreeInfo.isStaticSelector(referenceTree.expr, names) &&
                     argtypes.nonEmpty() &&
-                    (argtypes.head.hasTag(NONE) || types.isSubtypeUnchecked(argtypes.head, site))) {
+                    (argtypes.head.hasTag(NONE) ||
+                    types.isSubtypeUnchecked(inferenceContext.asFree(argtypes.head), site))) {
                 return new UnboundMethodReferenceLookupHelper(referenceTree, name,
                         site, argtypes, typeargtypes, maxPhase);
             } else {
-                return super.unboundLookup();
+                return super.unboundLookup(inferenceContext);
             }
         }
 
@@ -2836,7 +2907,7 @@
         }
 
         @Override
-        ReferenceLookupHelper unboundLookup() {
+        ReferenceLookupHelper unboundLookup(InferenceContext inferenceContext) {
             return this;
         }
 
@@ -3371,20 +3442,20 @@
                         key, name, first, second);
             }
             else {
-                Candidate c = errCandidate();
+                Pair<Symbol, JCDiagnostic> c = errCandidate();
                 if (compactMethodDiags) {
                     for (Map.Entry<Template, DiagnosticRewriter> _entry :
                             MethodResolutionDiagHelper.rewriters.entrySet()) {
-                        if (_entry.getKey().matches(c.details)) {
+                        if (_entry.getKey().matches(c.snd)) {
                             JCDiagnostic simpleDiag =
                                     _entry.getValue().rewriteDiagnostic(diags, pos,
-                                        log.currentSource(), dkind, c.details);
+                                        log.currentSource(), dkind, c.snd);
                             simpleDiag.setFlag(DiagnosticFlag.COMPRESSED);
                             return simpleDiag;
                         }
                     }
                 }
-                Symbol ws = c.sym.asMemberOf(site, types);
+                Symbol ws = c.fst.asMemberOf(site, types);
                 return diags.create(dkind, log.currentSource(), pos,
                           "cant.apply.symbol",
                           kindName(ws),
@@ -3393,7 +3464,7 @@
                           methodArguments(argtypes),
                           kindName(ws.owner),
                           ws.owner.type,
-                          c.details);
+                          c.snd);
             }
         }
 
@@ -3402,14 +3473,14 @@
             return types.createErrorType(name, location, syms.errSymbol.type).tsym;
         }
 
-        private Candidate errCandidate() {
+        protected Pair<Symbol, JCDiagnostic> errCandidate() {
             Candidate bestSoFar = null;
             for (Candidate c : resolveContext.candidates) {
                 if (c.isApplicable()) continue;
                 bestSoFar = c;
             }
             Assert.checkNonNull(bestSoFar);
-            return bestSoFar;
+            return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details);
         }
     }
 
@@ -3452,7 +3523,15 @@
                         methodArguments(argtypes));
                 return new JCDiagnostic.MultilineDiagnostic(err, candidateDetails(filteredCandidates, site));
             } else if (filteredCandidates.size() == 1) {
-                JCDiagnostic d =  new InapplicableSymbolError(resolveContext).getDiagnostic(dkind, pos,
+                Map.Entry<Symbol, JCDiagnostic> _e =
+                                filteredCandidates.entrySet().iterator().next();
+                final Pair<Symbol, JCDiagnostic> p = new Pair<Symbol, JCDiagnostic>(_e.getKey(), _e.getValue());
+                JCDiagnostic d = new InapplicableSymbolError(resolveContext) {
+                    @Override
+                    protected Pair<Symbol, JCDiagnostic> errCandidate() {
+                        return p;
+                    }
+                }.getDiagnostic(dkind, pos,
                     location, site, name, argtypes, typeargtypes);
                 if (truncatedDiag) {
                     d.setFlag(DiagnosticFlag.COMPRESSED);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Fri Jul 26 14:07:32 2013 -0700
@@ -68,6 +68,7 @@
     private TreeMaker make;
     private Enter enter;
     private boolean allowEnums;
+    private boolean allowInterfaceBridges;
     private Types types;
     private final Resolve resolve;
 
@@ -91,6 +92,7 @@
         Source source = Source.instance(context);
         allowEnums = source.allowEnums();
         addBridges = source.addBridges();
+        allowInterfaceBridges = source.allowDefaultMethods();
         types = Types.instance(context);
         make = TreeMaker.instance(context);
         resolve = Resolve.instance(context);
@@ -252,7 +254,8 @@
 
         // Create a bridge method symbol and a bridge definition without a body.
         Type bridgeType = meth.erasure(types);
-        long flags = impl.flags() & AccessFlags | SYNTHETIC | BRIDGE;
+        long flags = impl.flags() & AccessFlags | SYNTHETIC | BRIDGE |
+                (origin.isInterface() ? DEFAULT : 0);
         if (hypothetical) flags |= HYPOTHETICAL;
         MethodSymbol bridge = new MethodSymbol(flags,
                                                meth.name,
@@ -387,11 +390,12 @@
         }
     }
     // where
-        Filter<Symbol> overrideBridgeFilter = new Filter<Symbol>() {
+        private Filter<Symbol> overrideBridgeFilter = new Filter<Symbol>() {
             public boolean accepts(Symbol s) {
                 return (s.flags() & (SYNTHETIC | OVERRIDE_BRIDGE)) != SYNTHETIC;
             }
         };
+
         /**
          * @param method The symbol for which a bridge might have to be added
          * @param impl The implementation of method
@@ -999,8 +1003,9 @@
                     ListBuffer<JCTree> bridges = new ListBuffer<JCTree>();
                     if (false) //see CR: 6996415
                         bridges.appendList(addOverrideBridgesIfNeeded(tree, c));
-                    if ((tree.sym.flags() & INTERFACE) == 0)
-                        addBridges(tree.pos(), tree.sym, bridges);
+                    if (allowInterfaceBridges || (tree.sym.flags() & INTERFACE) == 0) {
+                        addBridges(tree.pos(), c, bridges);
+                    }
                     tree.defs = bridges.toList().prependList(tree.defs);
                 }
                 tree.type = erasure(tree.type);
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Fri Jul 26 14:07:32 2013 -0700
@@ -641,10 +641,12 @@
             polyKind = PolyKind.POLY;
         }
 
-        /** target descriptor inferred for this functional expression. */
-        public Type descriptorType;
         /** list of target types inferred for this functional expression. */
-        public List<TypeSymbol> targets;
+        public List<Type> targets;
+
+        public Type getDescriptorType(Types types) {
+            return types.findDescriptorType(targets.head);
+        }
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Fri Jul 26 14:07:32 2013 -0700
@@ -174,8 +174,8 @@
 
     //lambda-related
     public final Name lambda;
-    public final Name metaFactory;
-    public final Name altMetaFactory;
+    public final Name metafactory;
+    public final Name altMetafactory;
 
     public final Name.Table table;
 
@@ -310,8 +310,8 @@
 
         //lambda-related
         lambda = fromString("lambda$");
-        metaFactory = fromString("metaFactory");
-        altMetaFactory = fromString("altMetaFactory");
+        metafactory = fromString("metafactory");
+        altMetafactory = fromString("altMetafactory");
     }
 
     protected Name.Table createTable(Options options) {
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -303,8 +303,9 @@
                     conflicts.contains(s))) {
                     List<Name> l = List.nil();
                     Symbol s2 = s;
-                    while (s2.type.getEnclosingType().hasTag(CLASS)
-                            && s2.owner.kind == Kinds.TYP) {
+                    while (s2.type.hasTag(CLASS) &&
+                            s2.type.getEnclosingType().hasTag(CLASS) &&
+                            s2.owner.kind == Kinds.TYP) {
                         l = l.prepend(s2.getSimpleName());
                         s2 = s2.owner;
                     }
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -46,6 +46,7 @@
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.code.Type.ClassType;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Env;
 import com.sun.tools.javac.tree.JCTree;
@@ -516,7 +517,7 @@
             return null;
         Type sup = env.types.supertype(type);
         return TypeMaker.getType(env,
-                                 (sup != type) ? sup : env.syms.objectType);
+                                 (sup.hasTag(TypeTag.NONE)) ? env.syms.objectType : sup);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,13 @@
         }
     },
 
+    CP("-cp", true) {
+        @Override
+        public void process(Helper helper, String arg) {
+            helper.setCompilerOpt(opt, arg);
+        }
+    },
+
     EXTDIRS("-extdirs", true) {
         @Override
         public void process(Helper helper, String arg) {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -39,6 +39,7 @@
 \  -docletpath <path>               Specify where to find doclet class files\n\
 \  -sourcepath <pathlist>           Specify where to find source files\n\
 \  -classpath <pathlist>            Specify where to find user class files\n\
+\  -cp <pathlist>                   Specify where to find user class files\n\
 \  -exclude <pkglist>               Specify a list of packages to exclude\n\
 \  -subpackages <subpkglist>        Specify subpackages to recursively load\n\
 \  -breakiterator                   Compute first sentence with BreakIterator\n\
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Fri Jul 26 14:07:32 2013 -0700
@@ -531,7 +531,7 @@
             String name = o.aliases[0].substring(1); // there must always be at least one name
             log.println(getMessage("main.opt." + name));
         }
-        String[] fmOptions = { "-classpath", "-bootclasspath" };
+        String[] fmOptions = { "-classpath", "-cp", "-bootclasspath" };
         for (String o: fmOptions) {
             if (fileManager.isSupportedOption(o) == -1)
                 continue;
--- a/langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -77,6 +77,7 @@
 \n\t\
 -help                 Print this help message and exit\n\t\
 -classpath <path>     Path from which to load classes\n\t\
+-cp <path>            Path from which to load classes\n\t\
 -bootclasspath <path> Path from which to load bootstrap classes\n\t\
 -d <dir>              Output directory\n\t\
 -o <file>             Output file (only one of -d or -o may be used)\n\t\
@@ -108,6 +109,8 @@
 \  -force                   Always write output files
 main.opt.classpath=\
 \  -classpath <path>        Path from which to load classes
+main.opt.cp=\
+\  -cp <path>               Path from which to load classes
 main.opt.bootclasspath=\
 \  -bootclasspath <path>    Path from which to load bootstrap classes
 main.usage.foot=\
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Fri Jul 26 14:07:32 2013 -0700
@@ -885,7 +885,7 @@
                 continue;
             log.println(getMessage("main.opt." + name));
         }
-        String[] fmOptions = { "-classpath", "-bootclasspath" };
+        String[] fmOptions = { "-classpath", "-cp", "-bootclasspath" };
         for (String o: fmOptions) {
             if (fileManager.isSupportedOption(o) == -1)
                 continue;
--- a/langtools/src/share/classes/com/sun/tools/javap/resources/javap.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javap/resources/javap.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -1,5 +1,5 @@
 
-err.prefix=Error: 
+err.prefix=Error:
 
 err.bad.constant.pool=error while reading constant pool for {0}: {1}
 err.class.not.found=class not found: {0}
@@ -73,6 +73,9 @@
 main.opt.classpath=\
 \  -classpath <path>        Specify where to find user class files
 
+main.opt.cp=\
+\  -cp <path>               Specify where to find user class files
+
 main.opt.bootclasspath=\
 \  -bootclasspath <path>    Override location of bootstrap class files
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/BadPackageCommentTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8020278
+ * @summary NPE in javadoc (bad handling of bad tag in package-info.java)
+ * @build DocLintTester
+ * @run main DocLintTester -ref BadPackageCommentTest.out BadPackageCommentTest.java
+ */
+
+/**
+ * abc.
+ * @@@
+ */
+package p;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/BadPackageCommentTest.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,10 @@
+BadPackageCommentTest.java:11: error: no tag name after @
+ * @@@
+   ^
+BadPackageCommentTest.java:11: error: no tag name after @
+ * @@@
+    ^
+BadPackageCommentTest.java:11: error: no tag name after @
+ * @@@
+     ^
+3 errors
--- a/langtools/test/tools/doclint/tool/HelpTest.out	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/doclint/tool/HelpTest.out	Fri Jul 26 14:07:32 2013 -0700
@@ -36,7 +36,7 @@
     Show this message.
 
 The following javac options are also supported
-  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns
+  -bootclasspath, -classpath, -cp, -sourcepath, -Xmaxerrs, -Xmaxwarns
 
 To run doclint on part of a project, put the compiled classes for your
 project on the classpath (or bootclasspath), then specify the source files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Diagnostics/compressed/T8020286.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,15 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug     8020286
+ * @summary Wrong diagnostic after compaction
+ * @compile/fail/ref=T8020286.out -XDrawDiagnostics -Xdiags:compact T8020286.java
+ */
+
+class T8020286 {
+   void m(String s) { }
+   void m(Integer i, String s) { }
+   void test() {
+       m(1, 1);
+       m(1);
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Diagnostics/compressed/T8020286.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,4 @@
+T8020286.java:12:13: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: int, java.lang.String)
+T8020286.java:13:10: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: int, java.lang.String)
+- compiler.note.compressed.diags
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6356530
+ * @summary -Xlint:serial does not flag abstract classes with concrete methods/members
+ * @compile/fail/ref=SerializableAbstractClassWithNonAbstractMethodsTest.out -XDrawDiagnostics -Werror -Xlint:serial SerializableAbstractClassWithNonAbstractMethodsTest.java
+ */
+
+abstract class SerializableAbstractClassWithNonAbstractMethodsTest implements java.io.Serializable {
+    void m1() {}
+    abstract void m2();
+
+    abstract class AWithUID implements java.io.Serializable {
+        private static final long serialVersionUID = 0;
+        void m(){}
+    }
+
+    interface IDefault extends java.io.Serializable {
+        default int m() { return 1; }
+    }
+
+    interface IDefaultAndUID extends java.io.Serializable {
+        static final long serialVersionUID = 0;
+        default int m() { return 1; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,5 @@
+SerializableAbstractClassWithNonAbstractMethodsTest.java:40:5: compiler.warn.missing.SVUID: SerializableAbstractClassWithNonAbstractMethodsTest.IDefault
+SerializableAbstractClassWithNonAbstractMethodsTest.java:31:10: compiler.warn.missing.SVUID: SerializableAbstractClassWithNonAbstractMethodsTest
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/conditional/T8016702.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8016702
+ * @summary use of ternary operator in lambda expression gives incorrect results
+ */
+import java.util.Arrays;
+import java.util.List;
+
+public class T8016702 {
+
+    static int assertionCount;
+
+    static void assertTrue(boolean b, String msg) {
+        assertionCount++;
+        if (!b) {
+            throw new AssertionError(msg);
+        }
+    }
+
+    interface IntFunction<Y> {
+        Y m(int x);
+    }
+
+    void test(List<Integer> li) {
+        map(i -> (i % 2 == 0) ? "" : "i="+i, li);
+    }
+
+
+    @SuppressWarnings("unchecked")
+    <R> void map(IntFunction<R> mapper, List<Integer> li) {
+        for (int i : li) {
+            String res = (String)mapper.m(i);
+            assertTrue((i % 2 == 0) ? res.isEmpty() : res.contains("" + i),
+                    "i = " + i + " res = " + res);
+        }
+    }
+
+    public static void main(String[] args) {
+        T8016702 tester = new T8016702();
+        tester.test(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
+        assertTrue(assertionCount == 10, "wrong assertion count: " + assertionCount);
+    }
+}
--- a/langtools/test/tools/javac/generics/6723444/T6723444.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/generics/6723444/T6723444.java	Fri Jul 26 14:07:32 2013 -0700
@@ -4,7 +4,8 @@
  *
  * @summary javac fails to substitute type variables into a constructor's throws clause
  * @author Mark Mahieu
- * @compile/fail/ref=T6723444.out -XDrawDiagnostics T6723444.java
+ * @compile/fail/ref=T6723444_1.out -Xlint:-options -source 7 -XDrawDiagnostics T6723444.java
+ * @compile/fail/ref=T6723444_2.out -XDrawDiagnostics T6723444.java
  *
  */
 public class T6723444 {
--- a/langtools/test/tools/javac/generics/6723444/T6723444.out	Fri Jul 26 10:12:14 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-T6723444.java:42:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:43:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:45:32: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:46:17: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:48:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:49:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:50:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:51:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:52:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:53:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:54:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-T6723444.java:55:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
-12 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6723444/T6723444_1.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,13 @@
+T6723444.java:43:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:44:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:46:32: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:47:17: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:49:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:50:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:51:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:52:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:53:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:54:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:55:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:56:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+12 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6723444/T6723444_2.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,11 @@
+T6723444.java:46:32: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:47:17: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:49:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:50:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:51:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:52:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:53:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:54:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:55:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+T6723444.java:56:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Throwable
+10 errors
--- a/langtools/test/tools/javac/generics/7015430/T7015430.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/generics/7015430/T7015430.java	Fri Jul 26 14:07:32 2013 -0700
@@ -4,7 +4,8 @@
  *
  * @summary  Incorrect thrown type determined for unchecked invocations
  * @author Daniel Smith
- * @compile/fail/ref=T7015430.out -Xlint:unchecked -XDrawDiagnostics T7015430.java
+ * @compile/fail/ref=T7015430_1.out -source 7 -Xlint:-options,unchecked -XDrawDiagnostics T7015430.java
+ * @compile/fail/ref=T7015430_2.out -Xlint:unchecked -XDrawDiagnostics T7015430.java
  *
  */
 
--- a/langtools/test/tools/javac/generics/7015430/T7015430.out	Fri Jul 26 10:12:14 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-T7015430.java:41:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
-T7015430.java:41:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.Exception>
-T7015430.java:50:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
-T7015430.java:50:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
-T7015430.java:68:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
-T7015430.java:68:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.Exception>
-T7015430.java:77:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
-T7015430.java:77:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
-T7015430.java:104:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
-T7015430.java:104:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
-T7015430.java:113:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
-T7015430.java:113:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.Exception>
-T7015430.java:41:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
-T7015430.java:68:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
-T7015430.java:95:15: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
-T7015430.java:113:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
-T7015430.java:129:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
-5 errors
-12 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/7015430/T7015430_1.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,19 @@
+T7015430.java:42:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:42:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E>
+T7015430.java:51:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:69:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:69:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E>
+T7015430.java:78:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:78:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:105:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:105:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:114:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:114:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E>
+T7015430.java:42:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+T7015430.java:69:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+T7015430.java:96:15: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+T7015430.java:114:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+T7015430.java:130:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+5 errors
+12 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/7015430/T7015430_2.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,15 @@
+T7015430.java:42:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:42:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:51:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:69:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:69:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:78:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:78:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:105:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:105:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:114:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
+T7015430.java:114:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
+T7015430.java:130:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+1 error
+12 warnings
--- a/langtools/test/tools/javac/generics/7034511/T7034511a.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/generics/7034511/T7034511a.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,13 +1,10 @@
 /*
  * @test /nodynamiccopyright/
- * @ignore 7041019 Bogus type-variable substitution with array types with dependencies on accessibility check
- * @bug     7034511 7040883
+ * @bug     7034511 7040883 7041019
  * @summary Loophole in typesafety
  * @compile/fail/ref=T7034511a.out -XDrawDiagnostics T7034511a.java
  */
 
-// backing out 7034511, see 7040883
-
 class T7034511a {
 
     interface A<T> {
--- a/langtools/test/tools/javac/generics/7034511/T7034511a.out	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/generics/7034511/T7034511a.out	Fri Jul 26 14:07:32 2013 -0700
@@ -1,2 +1,2 @@
-T7034511a.java:18:14: compiler.err.cant.apply.symbol: kindname.method, foo, compiler.misc.type.captureof: 1, ?[], java.lang.String[], kindname.interface, T7034511a.A<T>, (compiler.misc.no.conforming.assignment.exists: java.lang.String[], compiler.misc.type.captureof: 1, ?[])
+T7034511a.java:18:14: compiler.err.cant.apply.symbol: kindname.method, foo, compiler.misc.type.captureof: 1, ?[], java.lang.String[], kindname.interface, T7034511a.A<T>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String[], compiler.misc.type.captureof: 1, ?[]))
 1 error
--- a/langtools/test/tools/javac/generics/7034511/T7034511b.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/generics/7034511/T7034511b.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,13 +1,10 @@
 /*
  * @test /nodynamiccopyright/
- * @ignore 7041019 Bogus type-variable substitution with array types with dependencies on accessibility check
- * @bug     7034511 7040883
+ * @bug     7034511 7040883 7041019
  * @summary Loophole in typesafety
  * @compile/fail/ref=T7034511b.out -XDrawDiagnostics T7034511b.java
  */
 
-// backing out 7034511, see 7040883
-
 class T7034511b {
     static class MyList<E> {
         E toArray(E[] e) { return null; }
--- a/langtools/test/tools/javac/generics/7034511/T7034511b.out	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/generics/7034511/T7034511b.out	Fri Jul 26 14:07:32 2013 -0700
@@ -1,2 +1,2 @@
-T7034511b.java:14:11: compiler.err.cant.apply.symbol: kindname.method, toArray, compiler.misc.type.captureof: 1, ?[], java.lang.Object[], kindname.class, T7034511b.MyList<E>, (compiler.misc.no.conforming.assignment.exists: java.lang.Object[], compiler.misc.type.captureof: 1, ?[])
+T7034511b.java:14:11: compiler.err.cant.apply.symbol: kindname.method, toArray, compiler.misc.type.captureof: 1, ?[], java.lang.Object[], kindname.class, T7034511b.MyList<E>, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object[], compiler.misc.type.captureof: 1, ?[]))
 1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/7034511/T7041019.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7034511 7040883 7041019
+ * @summary Bogus type-variable substitution with array types with dependencies on accessibility check
+ *
+ * @compile T7041019.java
+ */
+import java.util.List;
+
+class T7041019 {
+   <E> List<E>[] m(List<E> l) { return null; }
+
+   void test(List<? extends String> ls) {
+      int i = m(ls).length;
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/8016640/T8016640.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,10 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     8016640
+ * @summary compiler hangs if the generics arity of a base class is wrong
+ * @compile/fail/ref=T8016640.out -XDrawDiagnostics T8016640.java
+ */
+class T8016640 {
+    static class Foo<X,Y> { }
+    static class BadFoo<T> extends Foo<T> { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/8016640/T8016640.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,2 @@
+T8016640.java:9:39: compiler.err.wrong.number.type.args: 2
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/Bridge.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.lang.annotation.Repeatable;
+
+@Repeatable(Bridges.class)
+@interface Bridge {
+    String value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/BridgeHarness.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8013789
+ * @summary Compiler should emit bridges in interfaces
+ * @library /tools/javac/lib
+ * @build JavacTestingAbstractProcessor BridgeHarness
+ * @run main BridgeHarness
+ */
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.classfile.AccessFlags;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPool;
+import com.sun.tools.classfile.ConstantPoolException;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.util.List;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import static javax.tools.StandardLocation.*;
+
+public class BridgeHarness {
+
+    /** number of errors found (must be zero for the test to pass) */
+    static int nerrors = 0;
+
+    /** the (shared) Java compiler used for compiling the tests */
+    static final JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
+
+    /** the (shared) file manager used by the compiler */
+    static final StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
+
+    public static void main(String[] args) throws Exception {
+        //set sourcepath
+        fm.setLocation(SOURCE_PATH,
+                Arrays.asList(new File(System.getProperty("test.src"), "tests")));
+        //set output (-d)
+        fm.setLocation(javax.tools.StandardLocation.CLASS_OUTPUT,
+                Arrays.asList(new File(System.getProperty("user.dir"))));
+        for (JavaFileObject jfo : fm.list(SOURCE_PATH, "", Collections.singleton(JavaFileObject.Kind.SOURCE), true)) {
+            //for each source, compile and check against annotations
+            new BridgeHarness(jfo).compileAndCheck();
+        }
+        //if there were errors, fail
+        if (nerrors > 0) {
+            throw new AssertionError("Errors were found");
+        }
+    }
+
+    /* utility methods */
+
+    /**
+     * Remove an element from a list
+     */
+    static <Z> List<Z> drop(List<Z> lz, Z z) {
+        if (lz.head == z) {
+            return drop(lz.tail, z);
+        } else if (lz.isEmpty()) {
+            return lz;
+        } else {
+            return drop(lz.tail, z).prepend(lz.head);
+        }
+    }
+
+    /**
+     * return a string representation of a bytecode method
+     */
+    static String descriptor(Method m, ConstantPool cp) throws ConstantPoolException {
+        return m.getName(cp) + m.descriptor.getValue(cp);
+    }
+
+    /* test harness */
+
+    /** Test file to be compiled */
+    JavaFileObject jfo;
+
+    /** Mapping between class name and list of bridges in class with that name */
+    Map<String, List<Bridge>> bridgesMap = new HashMap<String, List<Bridge>>();
+
+    protected BridgeHarness(JavaFileObject jfo) {
+        this.jfo = jfo;
+    }
+
+    /**
+     * Compile a test using a custom annotation processor and check the generated
+     * bytecode against discovered annotations.
+     */
+    protected void compileAndCheck() throws Exception {
+        JavacTask ct = (JavacTask)comp.getTask(null, fm, null, null, null, Arrays.asList(jfo));
+        ct.setProcessors(Collections.singleton(new BridgeFinder()));
+
+        for (JavaFileObject jfo : ct.generate()) {
+            checkBridges(jfo);
+        }
+    }
+
+    /**
+     * Check that every bridge in the generated classfile has a matching bridge
+     * annotation in the bridge map
+     */
+    protected void checkBridges(JavaFileObject jfo) {
+        try (InputStream is = jfo.openInputStream()) {
+            ClassFile cf = ClassFile.read(is);
+            System.err.println("checking: " + cf.getName());
+
+            List<Bridge> bridgeList = bridgesMap.get(cf.getName());
+            if (bridgeList == null) {
+                //no bridges - nothing to check;
+                bridgeList = List.nil();
+            }
+
+            for (Method m : cf.methods) {
+                if (m.access_flags.is(AccessFlags.ACC_SYNTHETIC | AccessFlags.ACC_BRIDGE)) {
+                    //this is a bridge - see if there's a match in the bridge list
+                    Bridge match = null;
+                    for (Bridge b : bridgeList) {
+                        if (b.value().equals(descriptor(m, cf.constant_pool))) {
+                            match = b;
+                            break;
+                        }
+                    }
+                    if (match == null) {
+                        error("No annotation for bridge method: " + descriptor(m, cf.constant_pool));
+                    } else {
+                        bridgeList = drop(bridgeList, match);
+                    }
+                }
+            }
+            if (bridgeList.nonEmpty()) {
+                error("Redundant bridge annotation found: " + bridgeList.head.value());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Error("error reading " + jfo.toUri() +": " + e);
+        }
+    }
+
+    /**
+     * Log an error
+     */
+    protected void error(String msg) {
+        nerrors++;
+        System.err.printf("Error occurred while checking file: %s\nreason: %s\n", jfo.getName(), msg);
+    }
+
+    /**
+     * This annotation processor is used to populate the bridge map with the
+     * contents of the annotations that are found on the tests being compiled
+     */
+    @SupportedAnnotationTypes({"Bridges","Bridge"})
+    class BridgeFinder extends JavacTestingAbstractProcessor {
+        @Override
+        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+            if (roundEnv.processingOver())
+                return true;
+
+            TypeElement bridgeAnno = elements.getTypeElement("Bridge");
+            TypeElement bridgesAnno = elements.getTypeElement("Bridges");
+
+            //see if there are repeated annos
+            for (Element elem: roundEnv.getElementsAnnotatedWith(bridgesAnno)) {
+                List<Bridge> bridgeList = List.nil();
+                Bridges bridges = elem.getAnnotation(Bridges.class);
+                for (Bridge bridge : bridges.value()) {
+                    bridgeList = bridgeList.prepend(bridge);
+                }
+                bridgesMap.put(((ClassSymbol)elem).flatname.toString(), bridgeList);
+            }
+
+            //see if there are non-repeated annos
+            for (Element elem: roundEnv.getElementsAnnotatedWith(bridgeAnno)) {
+                Bridge bridge = elem.getAnnotation(Bridge.class);
+                bridgesMap.put(((ClassSymbol)elem).flatname.toString(),
+                        List.of(bridge));
+            }
+
+            return true;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/Bridges.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+@interface Bridges {
+    Bridge[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/tests/TestBridgeWithDefault.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+class TestBridgeWithDefault {
+    interface A { Object m(int x); }
+
+    @Bridge("m(I)Ljava/lang/Object;")
+    interface B extends A {
+        String m(int x);
+        default Integer m(long x) { return null; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/tests/TestClassAndInterfaceBridgeIdentical01.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+class TestClassAndInterfaceBridgeIdentical01 {
+
+    interface A { Object m(); }
+    interface B { Number m(); }
+
+    @Bridge("m()Ljava/lang/Object;")
+    @Bridge("m()Ljava/lang/Number;")
+    interface C extends A, B {
+        Integer m();
+    }
+
+    @Bridge("m()Ljava/lang/Object;")
+    @Bridge("m()Ljava/lang/Number;")
+    static abstract class D implements A, B {
+        public abstract Integer m();
+    }
+
+    @Bridge("m()Ljava/lang/Object;")
+    @Bridge("m()Ljava/lang/Number;")
+    static class E implements A, B {
+        public Integer m() { return 1; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/tests/TestClassAndInterfaceBridgeIdentical02.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+class TestClassAndInterfaceBridgeIdentical02 {
+
+    interface A<X extends Object> { void m(X x); }
+    interface B<X extends Number> { void m(X x); }
+
+    @Bridge("m(Ljava/lang/Object;)V")
+    @Bridge("m(Ljava/lang/Number;)V")
+    interface C extends A<Integer>, B<Integer> {
+        void m(Integer i);
+    }
+
+    @Bridge("m(Ljava/lang/Object;)V")
+    @Bridge("m(Ljava/lang/Number;)V")
+    static abstract class D implements A<Integer>, B<Integer> {
+        public abstract void m(Integer i);
+    }
+
+    @Bridge("m(Ljava/lang/Object;)V")
+    @Bridge("m(Ljava/lang/Number;)V")
+    static class E implements A<Integer>, B<Integer> {
+        public void m(Integer i) { }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/tests/TestNoBridgeInSiblingsSuper.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+class TestNoBridgeInSiblingSuper {
+    interface A { Object m(); }
+    interface B { String m(); }
+    //no bridge here!
+    interface C extends A, B { }
+
+    @Bridge("m()Ljava/lang/Object;")
+    interface D extends C {
+        String m();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/tests/TestNoDuplicateBridges01.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+class TestNoDuplicateBridges01 {
+    interface A1 { Object m(); }
+    interface A2 { Object m(); }
+
+    @Bridge("m()Ljava/lang/Object;")
+    interface B extends A1, A2 { B m(); }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/bridges/tests/TestNoDuplicateBridges02.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+class TestNoDuplicateBridges02 {
+    interface A<T> {
+        A<T> get();
+    }
+
+    @Bridge("get()LTestNoDuplicateBridges02$A;")
+    interface B<T> extends A<T> {
+        B<T> get();
+    }
+
+    @Bridge("get()LTestNoDuplicateBridges02$A;")
+    @Bridge("get()LTestNoDuplicateBridges02$B;")
+    interface C<T> extends A<T>, B<T> {
+        C<T> get();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/8019824/T8019824.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,15 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug 8019824
+ * @summary very long error messages on inference error
+ * @compile/fail/ref=T8019824.out -XDrawDiagnostics T8019824.java
+ */
+class T8019824 {
+    void test(Class<? extends Foo<?, ?>> cls) {
+        Foo<?, ?> foo = make(cls);
+    }
+
+    <A, B, C extends Foo<A, B>> Foo<A, B> make(Class<C> cls) { return null; }
+
+    interface Foo<A, B> {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/8019824/T8019824.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,2 @@
+T8019824.java:9:25: compiler.err.cant.apply.symbol: kindname.method, make, java.lang.Class<C>, java.lang.Class<compiler.misc.type.captureof: 1, ? extends T8019824.Foo<?,?>>, kindname.class, T8019824, (compiler.misc.incompatible.eq.upper.bounds: C, compiler.misc.type.captureof: 1, ? extends T8019824.Foo<?,?>, T8019824.Foo<compiler.misc.type.captureof: 2, ?,B>)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/8020149/T8020149.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8020149
+ * @summary Graph inference: wrong logic for picking best variable to solve
+ * @compile T8020149.java
+ */
+class T8020149 {
+    static class TestData<X,Y> { }
+
+    interface Foo<X, Y extends Foo<X, Y>> { }
+
+    interface IntFoo extends Foo<Integer, IntFoo> { }
+
+    interface Function<X, Y> {
+        Y apply(X x);
+    }
+
+    void test(TestData<Integer, IntFoo> data) {
+       m1(data, s->s);
+       m2(data, s->s);
+    }
+
+    <E, E_OUT extends Foo<E, E_OUT>, W, W_IN extends Foo<W, W_IN>> void m1(TestData<W, W_IN> data, Function<W_IN, E_OUT> m) {  }
+    <W, W_IN extends Foo<W, W_IN>, E, E_OUT extends Foo<E, E_OUT>> void m2(TestData<W, W_IN> data, Function<W_IN, E_OUT> m) {  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8019480/T8019480.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,23 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8019480
+ * @summary Javac crashes when method is called on a type-variable receiver from lambda expression
+ * @author  Maurizio Cimadamore
+ * @compile/fail/ref=T8019480.out -XDrawDiagnostics T8019480.java
+ */
+import java.util.*;
+
+class T8019480<U> {
+    interface Predicate<T> {
+       void m(T t);
+    }
+
+    interface Stream<T> {
+       void forEach(Predicate<T> pt);
+    }
+
+    void test(U current, Stream<U> stream) {
+        List<U> list3 = new ArrayList<>();
+        stream.forEach(i -> list3.add(current.clone()));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8019480/T8019480.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+T8019480.java:21:46: compiler.err.report.access: clone(), protected, java.lang.Object
+T8019480.java:21:34: compiler.err.cant.apply.symbols: kindname.method, add, java.lang.Object,{(compiler.misc.inapplicable.method: kindname.method, java.util.Collection, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(int,U), (compiler.misc.arg.length.mismatch))}
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8020147/T8020147.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,19 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8020147
+ * @summary Spurious errors when compiling nested stuck lambdas
+ * @compile/fail/ref=T8020147.out -Werror -Xlint:cast -XDrawDiagnostics T8020147.java
+ */
+class T8020147 {
+    interface Function<X, Y> {
+        Y apply(X x);
+    }
+
+    <T> void g(Function<String, T> f) { }
+    <U> String m(U u, Function<U, U> fuu) { return null; }
+
+    void test() {
+        g(x->m("", i->(String)i));
+        g(x->m("", i->(String)x));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/8020147/T8020147.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,5 @@
+T8020147.java:16:23: compiler.warn.redundant.cast: java.lang.String
+T8020147.java:17:23: compiler.warn.redundant.cast: java.lang.String
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/BadNestedLambda.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,11 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8017618
+ * @summary NullPointerException in RichDiagnosticFormatter for bad input program
+ * @compile/fail/ref=BadNestedLambda.out -XDrawDiagnostics BadNestedLambda.java
+ */
+class BadNestedLambda {
+    void test() {
+        Runnable add = (int x) -> (int y) -> x + y;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/BadNestedLambda.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+BadNestedLambda.java:9:35: compiler.err.prob.found.req: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.not.a.functional.intf: void))
+BadNestedLambda.java:9:24: compiler.err.prob.found.req: (compiler.misc.incompatible.arg.types.in.lambda)
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference68.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,23 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8016175
+ * @summary Add bottom-up type-checking support for unambiguous method references
+ * @compile/fail/ref=MethodReference68.out -XDrawDiagnostics MethodReference68.java
+ */
+class MethodReference68 {
+    interface F<X> {
+       String m(X x);
+    }
+
+    static class Foo {
+        String getName() { return ""; }
+    }
+
+    @SuppressWarnings("unchecked")
+    <Z> void g(F<Z> fz, Z... zs) { }
+
+    void test() {
+         g(Foo::getName);
+         g(Foo::getName, 1); //incompatible constraints, Z <: Foo, Z :> Integer
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference68.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,2 @@
+MethodReference68.java:21:10: compiler.err.cant.apply.symbol: kindname.method, g, MethodReference68.F<Z>,Z[], @493,int, kindname.class, MethodReference68, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, MethodReference68.Foo,java.lang.Object)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference69.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8016175
+ * @summary Add bottom-up type-checking support for unambiguous method references
+ * @compile/fail/ref=MethodReference69.out -XDrawDiagnostics MethodReference69.java
+ */
+class MethodReference69 {
+    interface F<X> {
+        String m(Integer x1, X x2);
+    }
+
+    static class Foo {
+        String getNameAt(Integer i) { return ""; }
+    }
+
+    <Z> void g(F<Z> fz) { }
+
+    void test() {
+         g(Foo::getName);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference69.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,2 @@
+MethodReference69.java:19:12: compiler.err.invalid.mref: kindname.method, (compiler.misc.cant.resolve.location.args: kindname.method, getName, , , (compiler.misc.location: kindname.class, MethodReference69.Foo, null))
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference70.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,28 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8016175
+ * @summary Add bottom-up type-checking support for unambiguous method references
+ * @compile/fail/ref=MethodReference70.out -XDrawDiagnostics MethodReference70.java
+ */
+class MethodReference70 {
+    interface F<X> {
+        void m(X x);
+    }
+
+    interface G<X> {
+        Integer m(X x);
+    }
+
+    void m1(Integer i) { }
+
+    void m2(Integer i) { }
+    void m2(String i) { }
+
+    <Z> void g(F<Z> fz) { }
+    <Z> void g(G<Z> gz) { }
+
+    void test() {
+         g(this::m1); //ok
+         g(this::m2); //ambiguous (stuck!)
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference70.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+MethodReference70.java:26:10: compiler.err.ref.ambiguous: g, kindname.method, <Z>g(MethodReference70.F<Z>), MethodReference70, kindname.method, <Z>g(MethodReference70.G<Z>), MethodReference70
+MethodReference70.java:26:11: compiler.err.prob.found.req: (compiler.misc.cyclic.inference: Z)
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference71.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,26 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8016175
+ * @summary Add bottom-up type-checking support for unambiguous method references
+ * @compile/fail/ref=MethodReference71.out -XDrawDiagnostics MethodReference71.java
+ */
+class MethodReference71 {
+    interface F<X> {
+        void m(X x);
+    }
+
+    interface G<X> {
+        Integer m(X x);
+    }
+
+    void m1(Integer i) { }
+    void m2(Integer... i) { }
+
+    <Z> void g(F<Z> f) { }
+    <Z> void g(G<Z> g) { }
+
+    void test() {
+         g(this::m1); //ok
+         g(this::m2); //ambiguous (stuck!)
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference71.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+MethodReference71.java:24:10: compiler.err.ref.ambiguous: g, kindname.method, <Z>g(MethodReference71.F<Z>), MethodReference71, kindname.method, <Z>g(MethodReference71.G<Z>), MethodReference71
+MethodReference71.java:24:11: compiler.err.prob.found.req: (compiler.misc.cyclic.inference: Z)
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference72.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8016175
+ * @summary Add bottom-up type-checking support for unambiguous method references
+ * @compile/fail/ref=MethodReference72.out -XDrawDiagnostics MethodReference72.java
+ */
+class MethodReference72 {
+    interface F<X> {
+        @SuppressWarnings("unchecked")
+        void m(X... x);
+    }
+
+    void m1(Integer i) { }
+
+    <Z> void g(F<Z> f) { }
+
+    void test() {
+        g(this::m1); //?
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/MethodReference72.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,2 @@
+MethodReference72.java:18:9: compiler.err.cant.apply.symbol: kindname.method, g, MethodReference72.F<Z>, @420, kindname.class, MethodReference72, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.invalid.mref: kindname.method, (compiler.misc.cant.apply.symbol: kindname.method, m1, java.lang.Integer, Z[], kindname.class, MethodReference72, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: Z[], java.lang.Integer)))))
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/NestedCapture01.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8012238
+ * @summary Nested method capture and inference
+ * @compile NestedCapture01.java
+ */
+class NestedCapture01 {
+
+    void test(String s) {
+       g(m(s.getClass()));
+    }
+
+    <F extends String> F m(Class<F> cf) {
+       return null;
+    }
+
+    <P extends String> P g(P vo) {
+       return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/NestedCapture02.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8012238
+ * @summary Nested method capture and inference
+ * @compile NestedCapture02.java
+ */
+class NestedCapture02<S,T> {
+
+     <S,T> NestedCapture02<S,T> create(NestedCapture02<? super S,?> first,
+             NestedCapture02<? super S, T> second) {
+         return null;
+     }
+
+     <U> NestedCapture02<S, ? extends U> cast(Class<U> target) { return null; }
+
+     <U> NestedCapture02<S, ? extends U> test(Class<U> target,
+             NestedCapture02<? super S, ?> first, NestedCapture02<? super S, T> second) {
+        return create(first, second.cast(target));
+     }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/NestedCapture03.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8012238
+ * @summary Nested method capture and inference
+ * @compile NestedCapture03.java
+ */
+class NestedCapture03 {
+    <T extends String> T factory(Class<T> c) { return null; }
+
+    void test(Class<?> c) {
+        factory(c.asSubclass(String.class)).matches(null);
+    }
+}
--- a/langtools/test/tools/javac/lambda/TargetType36.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/lambda/TargetType36.java	Fri Jul 26 14:07:32 2013 -0700
@@ -23,11 +23,10 @@
 
 /*
  * @test
- * @ignore 8013404: Test awaits spec clarification
- * @bug 8003280
+ * @bug 8003280 8013404
  * @summary Add lambda tests
- *  check that target type of cast is propagated to conditional subexpressions
- * @compile TargetType36.java
+ *  check that target type of cast is not propagated to conditional subexpressions
+ * @compile/fail/ref=TargetType36.out -XDrawDiagnostics TargetType36.java
  */
 class TargetType36 { //awaits spec wording on cast vs. poly
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType36.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+TargetType36.java:40:30: compiler.err.unexpected.lambda
+TargetType36.java:40:43: compiler.err.unexpected.lambda
+2 errors
--- a/langtools/test/tools/javac/lambda/TargetType60.out	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/lambda/TargetType60.out	Fri Jul 26 14:07:32 2013 -0700
@@ -1,7 +1,7 @@
 TargetType60.java:54:21: compiler.err.ref.ambiguous: g, kindname.method, g(TargetType60.Sam0), TargetType60, kindname.method, <U>g(TargetType60.Sam1<U>), TargetType60
 TargetType60.java:55:21: compiler.err.ref.ambiguous: g, kindname.method, <U>g(TargetType60.Sam1<U>), TargetType60, kindname.method, <U>g(TargetType60.Sam2<U,java.lang.String>), TargetType60
 TargetType60.java:60:27: compiler.err.ref.ambiguous: u, kindname.method, <U>u(TargetType60.Sam1<U>), TargetType60, kindname.method, <U>u(TargetType60.Sam2<U,java.lang.String>), TargetType60
-TargetType60.java:60:28: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.invalid.mref: kindname.method, (compiler.misc.cant.apply.symbol: kindname.method, n1, java.lang.String, TargetType60, kindname.class, TargetType60, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: TargetType60, java.lang.String)))))
+TargetType60.java:60:29: compiler.err.invalid.mref: kindname.method, (compiler.misc.non-static.cant.be.ref: kindname.method, n1(java.lang.String))
 TargetType60.java:61:29: compiler.err.invalid.mref: kindname.method, (compiler.misc.non-static.cant.be.ref: kindname.method, n2(TargetType60,java.lang.String))
 TargetType60.java:62:27: compiler.err.ref.ambiguous: u, kindname.method, <U>u(TargetType60.Sam1<U>), TargetType60, kindname.method, <U>u(TargetType60.Sam2<U,java.lang.String>), TargetType60
 TargetType60.java:63:27: compiler.err.ref.ambiguous: u, kindname.method, <U>u(TargetType60.Sam1<U>), TargetType60, kindname.method, <U>u(TargetType60.Sam2<U,java.lang.String>), TargetType60
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType63.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,40 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary smoke test for inference of throws type variables
+ * @compile/fail/ref=TargetType63.out -XDrawDiagnostics TargetType63.java
+ */
+class TargetType63 {
+
+    interface F<T extends Throwable> {
+        void m() throws T;
+    }
+
+    void g1() { }
+    void g2() throws ClassNotFoundException { }
+    void g3() throws Exception { }
+
+    <Z extends Throwable> void m1(F<Z> fz) throws Z { }
+    <Z extends ClassNotFoundException> void m2(F<Z> fz) throws Z { }
+
+    void test1() {
+        m1(()->{ }); //ok (Z = RuntimeException)
+        m1(this::g1); //ok (Z = RuntimeException)
+    }
+
+    void test2() {
+        m2(()->{ }); //fail (Z = ClassNotFoundException)
+        m2(this::g1); //fail (Z = ClassNotFoundException)
+    }
+
+    void test3() {
+        m1(()->{ throw new ClassNotFoundException(); }); //fail (Z = ClassNotFoundException)
+        m1(this::g2); //fail (Z = ClassNotFoundException)
+        m2(()->{ throw new ClassNotFoundException(); }); //fail (Z = ClassNotFoundException)
+        m2(this::g2); //fail (Z = ClassNotFoundException)
+    }
+
+    void test4() {
+        m1(()->{ throw new Exception(); }); //fail (Z = Exception)
+        m1(this::g3); //fail (Z = Exception)
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType63.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,9 @@
+TargetType63.java:25:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.ClassNotFoundException
+TargetType63.java:26:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.ClassNotFoundException
+TargetType63.java:30:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.ClassNotFoundException
+TargetType63.java:31:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.ClassNotFoundException
+TargetType63.java:32:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.ClassNotFoundException
+TargetType63.java:33:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.ClassNotFoundException
+TargetType63.java:37:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+TargetType63.java:38:11: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
+8 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType75.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8016060 8016059
+ * @summary Lambda isn't compiled with return statement
+ * @compile TargetType75.java
+ */
+class TargetType75 {
+    interface P<X> {
+        void m(X x);
+    }
+
+    <Z> void m(P<Z> r, Z z) { }
+
+    void test() {
+        m(x->{ return; }, "");
+        m(x->System.out.println(""), "");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/TargetType76.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8016175
+ * @summary Add bottom-up type-checking support for unambiguous method references
+ * @compile TargetType76.java
+ */
+class TargetType76 {
+
+    interface Function<X, Y> {
+        Y m(X x);
+    }
+
+    interface OfRef<T> { }
+
+    interface Supplier<X> {
+        X make();
+    }
+
+    interface Stream<X> { }
+
+    interface Node<E> {
+        Spliterator<E> spliterator();
+    }
+
+    interface Spliterator<X> {
+        Spliterator<X> spliterator();
+    }
+
+    class RefTestData<T, I> implements OfRef<T> {
+        RefTestData(I state,
+                    Function<I, Stream<T>> streamFn,
+                    Function<I, Spliterator<T>> splitrFn) { }
+    }
+
+    <O> OfRef<O> ofCollection(Node<O> collection) {
+        return new RefTestData<>(collection,
+                                 x->stream(x::spliterator),
+                                 Node::spliterator);
+    }
+
+    <S> Stream<S> stream(Supplier<? extends Spliterator<S>> supplier) { return null; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/bridge/TestMetafactoryBridges.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8013789
+ * @summary Compiler should emit bridges in interfaces
+ */
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.api.ClientCodeWrapper.DiagnosticSourceUnwrapper;
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.util.JCDiagnostic;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.tools.Diagnostic;
+import javax.tools.Diagnostic.Kind;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class TestMetafactoryBridges {
+
+    static int checkCount = 0;
+
+    enum ClasspathKind {
+        NONE(),
+        B7(7, ClassKind.B),
+        A7(7, ClassKind.A),
+        B8(8, ClassKind.B),
+        A8(8, ClassKind.A);
+
+        int version;
+        ClassKind ck;
+
+        ClasspathKind() {
+            this(-1, null);
+        }
+
+        ClasspathKind(int version, ClassKind ck) {
+            this.version = version;
+            this.ck = ck;
+        }
+    }
+
+    enum PreferPolicy {
+        SOURCE("-Xprefer:source"),
+        NEWER("-Xprefer:newer");
+
+        String preferOpt;
+
+        PreferPolicy(String preferOpt) {
+            this.preferOpt = preferOpt;
+        }
+    }
+
+    enum SourcepathKind {
+        NONE,
+        A(ClassKind.A),
+        B(ClassKind.B),
+        C(ClassKind.C),
+        AB(ClassKind.A, ClassKind.B),
+        BC(ClassKind.B, ClassKind.C),
+        AC(ClassKind.A, ClassKind.C),
+        ABC(ClassKind.A, ClassKind.B, ClassKind.C);
+
+        List<ClassKind> sources;
+
+        SourcepathKind(ClassKind... sources) {
+            this.sources = Arrays.asList(sources);
+        }
+    }
+
+    enum SourceSet {
+        ALL() {
+            @Override
+            List<List<ClassKind>> permutations() {
+                return Arrays.asList(
+                    Arrays.asList(ClassKind.A, ClassKind.B, ClassKind.C),
+                    Arrays.asList(ClassKind.A, ClassKind.B, ClassKind.C),
+                    Arrays.asList(ClassKind.B, ClassKind.A, ClassKind.C),
+                    Arrays.asList(ClassKind.B, ClassKind.C, ClassKind.A),
+                    Arrays.asList(ClassKind.C, ClassKind.A, ClassKind.B),
+                    Arrays.asList(ClassKind.C, ClassKind.B, ClassKind.A)
+                );
+            }
+        },
+        AC() {
+            @Override
+            List<List<ClassKind>> permutations() {
+                return Arrays.asList(
+                    Arrays.asList(ClassKind.A, ClassKind.C),
+                    Arrays.asList(ClassKind.C, ClassKind.A)
+                );
+            }
+        },
+        C() {
+            @Override
+            List<List<ClassKind>> permutations() {
+                return Arrays.asList(Arrays.asList(ClassKind.C));
+            }
+        };
+
+        abstract List<List<ClassKind>> permutations();
+    }
+
+    enum ClassKind {
+        A("A", "interface A { Object m(); }"),
+        B("B", "interface B extends A { Integer m(); }", A),
+        C("C", "class C { B b = ()->42; }", A, B);
+
+        String name;
+        String source;
+        ClassKind[] deps;
+
+        ClassKind(String name, String source, ClassKind... deps) {
+            this.name = name;
+            this.source = source;
+            this.deps = deps;
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        String SCRATCH_DIR = System.getProperty("user.dir");
+        //create default shared JavaCompiler - reused across multiple compilations
+        JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
+
+        int n = 0;
+        for (SourceSet ss : SourceSet.values()) {
+            for (List<ClassKind> sources : ss.permutations()) {
+                for (SourcepathKind spKind : SourcepathKind.values()) {
+                    for (ClasspathKind cpKind : ClasspathKind.values()) {
+                        for (PreferPolicy pp : PreferPolicy.values()) {
+                            Set<ClassKind> deps = EnumSet.noneOf(ClassKind.class);
+                            if (cpKind.ck != null) {
+                                deps.add(cpKind.ck);
+                            }
+                            deps.addAll(sources);
+                            if (deps.size() < 3) continue;
+                            File testDir = new File(SCRATCH_DIR, "test" + n);
+                            testDir.mkdir();
+                            try (PrintWriter debugWriter = new PrintWriter(new File(testDir, "debug.txt"))) {
+                                new TestMetafactoryBridges(testDir, sources, spKind, cpKind, pp, debugWriter).run(comp);
+                                n++;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        System.out.println("Total check executed: " + checkCount);
+    }
+
+    File testDir;
+    List<ClassKind> sources;
+    SourcepathKind spKind;
+    ClasspathKind cpKind;
+    PreferPolicy pp;
+    PrintWriter debugWriter;
+    DiagnosticChecker diagChecker;
+
+    TestMetafactoryBridges(File testDir, List<ClassKind>sources, SourcepathKind spKind,
+            ClasspathKind cpKind, PreferPolicy pp, PrintWriter debugWriter) {
+        this.testDir = testDir;
+        this.sources = sources;
+        this.spKind = spKind;
+        this.cpKind = cpKind;
+        this.pp = pp;
+        this.debugWriter = debugWriter;
+        this.diagChecker = new DiagnosticChecker();
+    }
+
+    class JavaSource extends SimpleJavaFileObject {
+
+        final String source;
+
+        public JavaSource(ClassKind ck) {
+            super(URI.create(String.format("myfo:/%s.java", ck.name)), JavaFileObject.Kind.SOURCE);
+            this.source = ck.source;
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    void run(JavaCompiler tool) throws Exception {
+        File classesDir = new File(testDir, "classes");
+        File outDir = new File(testDir, "out");
+        File srcDir = new File(testDir, "src");
+        classesDir.mkdir();
+        outDir.mkdir();
+        srcDir.mkdir();
+
+        debugWriter.append(testDir.getName() + "\n");
+        debugWriter.append("sources = " + sources + "\n");
+        debugWriter.append("spKind = " + spKind  + "\n");
+        debugWriter.append("cpKind = " + cpKind + "\n");
+        debugWriter.append("preferPolicy = " + pp.preferOpt + "\n");
+
+        //step 1 - prepare sources (older!!)
+        debugWriter.append("Preparing sources\n");
+        for (ClassKind ck : spKind.sources) {
+            //skip sources explicitly provided on command line
+            if (!sources.contains(ck)) {
+                debugWriter.append("Copy " + ck.name + ".java to" + srcDir.getAbsolutePath() + "\n");
+                File dest = new File(srcDir, ck.name + ".java");
+                PrintWriter pw = new PrintWriter(dest);
+                pw.append(ck.source);
+                pw.close();
+            }
+        }
+
+        //step 2 - prepare classes
+        debugWriter.append("Preparing classes\n");
+        if (cpKind != ClasspathKind.NONE) {
+            List<JavaSource> sources = new ArrayList<>();
+            ClassKind toRemove = null;
+            sources.add(new JavaSource(cpKind.ck));
+            if (cpKind.ck.deps.length != 0) {
+                //at most only one dependency
+                toRemove = cpKind.ck.deps[0];
+                sources.add(new JavaSource(toRemove));
+            }
+            JavacTask ct = (JavacTask)tool.getTask(debugWriter, null, null,
+                    Arrays.asList("-d", classesDir.getAbsolutePath(), "-source", String.valueOf(cpKind.version)), null, sources);
+            try {
+                ct.generate();
+                if (toRemove != null) {
+                    debugWriter.append("Remove " + toRemove.name + ".class from" + classesDir.getAbsolutePath() + "\n");
+                    File fileToRemove = new File(classesDir, toRemove.name + ".class");
+                    fileToRemove.delete();
+                }
+            } catch (Throwable ex) {
+                throw new AssertionError("Error thrown when generating side-classes");
+            }
+        }
+
+        //step 3 - compile
+        debugWriter.append("Compiling test\n");
+        List<JavaSource> sourcefiles = new ArrayList<>();
+        for (ClassKind ck : sources) {
+            sourcefiles.add(new JavaSource(ck));
+        }
+        JavacTask ct = (JavacTask)tool.getTask(debugWriter, null, diagChecker,
+                    Arrays.asList("-XDdumpLambdaToMethodStats", "-d", outDir.getAbsolutePath(),
+                                  "-sourcepath", srcDir.getAbsolutePath(),
+                                  "-classpath", classesDir.getAbsolutePath(),
+                                  pp.preferOpt), null, sourcefiles);
+        try {
+            ct.generate();
+        } catch (Throwable ex) {
+            throw new AssertionError("Error thrown when compiling test case");
+        }
+        check();
+    }
+
+    void check() {
+        checkCount++;
+        if (diagChecker.errorFound) {
+            throw new AssertionError("Unexpected compilation failure");
+        }
+
+        boolean altMetafactory =
+                cpKind == ClasspathKind.B7 &&
+                !sources.contains(ClassKind.B) &&
+                (pp == PreferPolicy.NEWER || !spKind.sources.contains(ClassKind.B));
+
+        if (altMetafactory != diagChecker.altMetafactory) {
+            throw new AssertionError("Bad metafactory detected - expected altMetafactory: " + altMetafactory +
+                    "\ntest: " + testDir);
+        }
+    }
+
+    static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
+
+        boolean altMetafactory = false;
+        boolean errorFound = false;
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
+                errorFound = true;
+            } else if (statProcessor.matches(diagnostic)) {
+                statProcessor.process(diagnostic);
+            }
+        }
+
+        abstract class DiagnosticProcessor {
+
+            List<String> codes;
+            Diagnostic.Kind kind;
+
+            public DiagnosticProcessor(Kind kind, String... codes) {
+                this.codes = Arrays.asList(codes);
+                this.kind = kind;
+            }
+
+            abstract void process(Diagnostic<? extends JavaFileObject> diagnostic);
+
+            boolean matches(Diagnostic<? extends JavaFileObject> diagnostic) {
+                return (codes.isEmpty() || codes.contains(diagnostic.getCode())) &&
+                        diagnostic.getKind() == kind;
+            }
+
+            JCDiagnostic asJCDiagnostic(Diagnostic<? extends JavaFileObject> diagnostic) {
+                if (diagnostic instanceof JCDiagnostic) {
+                    return (JCDiagnostic)diagnostic;
+                } else if (diagnostic instanceof DiagnosticSourceUnwrapper) {
+                    return ((DiagnosticSourceUnwrapper)diagnostic).d;
+                } else {
+                    throw new AssertionError("Cannot convert diagnostic to JCDiagnostic: " + diagnostic.getClass().getName());
+                }
+            }
+        }
+
+        DiagnosticProcessor statProcessor = new DiagnosticProcessor(Kind.NOTE,
+                "compiler.note.lambda.stat",
+                "compiler.note.mref.stat",
+                "compiler.note.mref.stat.1") {
+            @Override
+            void process(Diagnostic<? extends JavaFileObject> diagnostic) {
+                JCDiagnostic diag = asJCDiagnostic(diagnostic);
+                if ((Boolean)diag.getArgs()[0]) {
+                    altMetafactory = true;
+                }
+            }
+        };
+    }
+}
--- a/langtools/test/tools/javac/lambda/lambdaExpression/LambdaTest6.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/lambda/lambdaExpression/LambdaTest6.java	Fri Jul 26 14:07:32 2013 -0700
@@ -105,7 +105,7 @@
             Class returnType = m.getReturnType();
             assertTrue(types.remove(returnType.getName()));
         }
-        assertTrue(types.isEmpty());
+        assertTrue(types.size() == 1); //there's a bridge
     }
 
 
--- a/langtools/test/tools/javac/lambda/methodReference/BridgeMethod.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/lambda/methodReference/BridgeMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -112,6 +112,6 @@
             Class<?> returnType = m.getReturnType();
             assertTrue(types.remove(returnType.getName()));
         }
-        assertTrue(types.isEmpty());
+        assertTrue(types.size() == 1); //there's a bridge
     }
 }
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -395,6 +395,7 @@
      * TEST: C c = new C(); c.m() == 88;
      * TEST: I i = new C(); i.m() == 88;
      */
+    @Test(enabled=false)
     public void testSelfFill() {
         // This test ensures that a concrete method overrides a default method
         // that matches at the language-level, but has a different method
@@ -484,6 +485,7 @@
      * TEST: J<String,String> j = new C(); j.m("A","B","C") == 88;
      * TEST: K<String> k = new C(); k.m("A","B","C") == 88;
      */
+    @Test(enabled=false)
     public void testBridges() {
         DefaultMethod dm = new DefaultMethod("int", stdMethodName, "return 99;",
             new MethodParameter("T", "t"), new MethodParameter("V", "v"),
@@ -672,6 +674,7 @@
      * class S { Object foo() { return (new D()).m(); } // link sig: ()LInteger;
      * TEST: S s = new S(); s.foo() == new Integer(99)
      */
+    @Test(enabled=false)
     public void testCovarBridge() {
         Interface I = new Interface("I", new DefaultMethod(
             "Integer", "m", "return new Integer(88);"));
@@ -754,6 +757,7 @@
      * Test that a erased-signature-matching method does not implement
      * non-language-level matching methods
      */
+    @Test(enabled=false)
     public void testNonConcreteFill() {
         AbstractMethod ipm = new AbstractMethod("int", "m",
             new MethodParameter("T", "t"),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/meth/VarargsWarn.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8019340
+ * @summary varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
+ *
+ * @compile/fail/ref=VarargsWarn.out -XDrawDiagnostics -Werror VarargsWarn.java
+ */
+
+import java.lang.invoke.*;
+
+class VarargsWarn {
+    void test(MethodHandle mh) throws Throwable {
+        mh.invokeExact((Integer[])null);
+        mh.invoke((Integer[])null);
+        mh.invokeWithArguments((Integer[])null); //not a sig poly method - warning here!
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/meth/VarargsWarn.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,4 @@
+VarargsWarn.java:15:32: compiler.warn.inexact.non-varargs.call: java.lang.Object, java.lang.Object[]
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/6594914/Auxiliary.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,5 @@
+import java.io.StringBufferInputStream;
+
+public class Auxiliary {
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/6594914/ExplicitCompilation.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,2 @@
+Auxiliary.java:1:15: compiler.warn.has.been.deprecated: java.io.StringBufferInputStream, java.io
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/6594914/ImplicitCompilation.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,13 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug 8020586
+ * @summary Warnings in the imports section should be attributed to the correct source file
+ * @clean Auxiliary ImplicitCompilation
+ * @compile/ref=ImplicitCompilation.out -XDrawDiagnostics -Xlint:deprecation -sourcepath . ImplicitCompilation.java
+ * @clean Auxiliary ImplicitCompilation
+ * @compile/ref=ExplicitCompilation.out -XDrawDiagnostics -Xlint:deprecation ImplicitCompilation.java Auxiliary.java
+ */
+
+public class ImplicitCompilation {
+    private Auxiliary a;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/6594914/ImplicitCompilation.out	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,2 @@
+Auxiliary.java:1:15: compiler.warn.has.been.deprecated: java.io.StringBufferInputStream, java.io
+1 warning
--- a/langtools/test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/langtools/test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -35,7 +35,7 @@
 public class JavapReturns0AfterClassNotFoundTest {
 
     static final String fileNotFoundErrorMsg =
-            "Error:  class not found: Unexisting.class";
+            "Error: class not found: Unexisting.class";
     static final String exitCodeClassNotFoundAssertionMsg =
             "Javap's exit code for class not found should be 1";
     static final String classNotFoundMsgAssertionMsg =
--- a/nashorn/.hgtags	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/.hgtags	Fri Jul 26 14:07:32 2013 -0700
@@ -207,3 +207,6 @@
 cbc9926f5b40a24025c1e15d8870157d651a9ff7 jdk8-b95
 d6bd440ac5b97bb1205b6c3274569c1cfe626723 jdk8-b96
 1bf1d6ce30427e1f9dc1ada18db409d1f14d99fe jdk8-b97
+542b7803f0389a91fab58608a0f46fac0e15d759 jdk8-b98
+10a1ab9e20a42d278aa1a89698f2a4cf5883d00d jdk8-b99
+598321c438b52d9408a2671fb3fc2b2947d0f654 jdk8-b100
--- a/nashorn/buildtools/nasgen/build.xml	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/buildtools/nasgen/build.xml	Fri Jul 26 14:07:32 2013 -0700
@@ -42,7 +42,8 @@
            destdir="${build.classes.dir}"
            classpath="${javac.classpath}"
            debug="${javac.debug}"
-           includeantruntime="false">
+           includeantruntime="false" fork="true">
+      <compilerarg value="-J-Djava.ext.dirs="/>
       <compilerarg value="-Xlint:unchecked"/>
       <compilerarg value="-Xlint:deprecation"/>
       <compilerarg value="-XDignore.symbol.file"/>
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,6 +25,7 @@
 
 package jdk.nashorn.internal.tools.nasgen;
 
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL;
 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PRIVATE;
 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
@@ -36,14 +37,24 @@
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.GET_CLASS_NAME;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.GET_CLASS_NAME_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.LOOKUP_NEWPROPERTY;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.LOOKUP_NEWPROPERTY_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.LOOKUP_TYPE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_FIELD_NAME;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_NEWMAP;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_NEWMAP_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_CREATE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_CREATE_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ACCESSORPROPERTY_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.LIST_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ARRAYLIST_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.ARRAYLIST_INIT_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_ADD;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTION_ADD_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTIONS_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.COLLECTIONS_EMPTY_LIST;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_FIELD_NAME;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_SETISSHARED;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_SETISSHARED_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_NEWMAP;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_NEWMAP_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTFUNCTIONIMPL_MAKEFUNCTION;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTFUNCTIONIMPL_MAKEFUNCTION_DESC;
@@ -160,18 +171,30 @@
         return new MethodGenerator(mv, access, name, desc);
     }
 
-    static void emitStaticInitPrefix(final MethodGenerator mi, final String className) {
+    static void emitStaticInitPrefix(final MethodGenerator mi, final String className, final int memberCount) {
         mi.visitCode();
-        mi.pushNull();
-        mi.putStatic(className, MAP_FIELD_NAME, MAP_DESC);
-        mi.loadClass(className);
-        mi.invokeStatic(MAP_TYPE, MAP_NEWMAP, MAP_NEWMAP_DESC);
-        // stack: PropertyMap
+        if (memberCount > 0) {
+            // new ArrayList(int)
+            mi.newObject(ARRAYLIST_TYPE);
+            mi.dup();
+            mi.push(memberCount);
+            mi.invokeSpecial(ARRAYLIST_TYPE, INIT, ARRAYLIST_INIT_DESC);
+            // stack: ArrayList
+        } else {
+            // java.util.Collections.EMPTY_LIST
+            mi.getStatic(COLLECTIONS_TYPE, COLLECTIONS_EMPTY_LIST, LIST_DESC);
+            // stack List
+        }
     }
 
     static void emitStaticInitSuffix(final MethodGenerator mi, final String className) {
-        // stack: PropertyMap
-        mi.putStatic(className, MAP_FIELD_NAME, MAP_DESC);
+        // stack: Collection
+        // pmap = PropertyMap.newMap(Collection<Property>);
+        mi.invokeStatic(PROPERTYMAP_TYPE, PROPERTYMAP_NEWMAP, PROPERTYMAP_NEWMAP_DESC);
+        // pmap.setIsShared();
+        mi.invokeVirtual(PROPERTYMAP_TYPE, PROPERTYMAP_SETISSHARED, PROPERTYMAP_SETISSHARED_DESC);
+        // $nasgenmap$ = pmap;
+        mi.putStatic(className, PROPERTYMAP_FIELD_NAME, PROPERTYMAP_DESC);
         mi.returnVoid();
         mi.computeMaxs();
         mi.visitEnd();
@@ -235,9 +258,9 @@
     }
 
     static void addMapField(final ClassVisitor cv) {
-        // add a MAP static field
-        final FieldVisitor fv = cv.visitField(ACC_PRIVATE | ACC_STATIC,
-            MAP_FIELD_NAME, MAP_DESC, null, null);
+        // add a PropertyMap static field
+        final FieldVisitor fv = cv.visitField(ACC_PRIVATE | ACC_STATIC | ACC_FINAL,
+            PROPERTYMAP_FIELD_NAME, PROPERTYMAP_DESC, null, null);
         if (fv != null) {
             fv.visitEnd();
         }
@@ -278,7 +301,11 @@
 
     static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo memInfo) {
         final String propertyName = memInfo.getName();
-        // stack: PropertyMap
+        // stack: Collection
+        // dup of Collection instance
+        mi.dup();
+
+        // property = AccessorProperty.create(key, flags, getter, setter);
         mi.loadLiteral(propertyName);
         // setup flags
         mi.push(memInfo.getAttributes());
@@ -292,13 +319,21 @@
             javaName = SETTER_PREFIX + memInfo.getJavaName();
             mi.visitLdcInsn(new Handle(H_INVOKEVIRTUAL, className, javaName, setterDesc(memInfo)));
         }
-        mi.invokeStatic(LOOKUP_TYPE, LOOKUP_NEWPROPERTY, LOOKUP_NEWPROPERTY_DESC);
-        // stack: PropertyMap
+        mi.invokeStatic(ACCESSORPROPERTY_TYPE, ACCESSORPROPERTY_CREATE, ACCESSORPROPERTY_CREATE_DESC);
+        // boolean Collection.add(property)
+        mi.invokeInterface(COLLECTION_TYPE, COLLECTION_ADD, COLLECTION_ADD_DESC);
+        // pop return value of Collection.add
+        mi.pop();
+        // stack: Collection
     }
 
     static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo getter, final MemberInfo setter) {
         final String propertyName = getter.getName();
-        // stack: PropertyMap
+        // stack: Collection
+        // dup of Collection instance
+        mi.dup();
+
+        // property = AccessorProperty.create(key, flags, getter, setter);
         mi.loadLiteral(propertyName);
         // setup flags
         mi.push(getter.getAttributes());
@@ -312,8 +347,12 @@
             mi.visitLdcInsn(new Handle(H_INVOKESTATIC, className,
                     setter.getJavaName(), setter.getJavaDesc()));
         }
-        mi.invokeStatic(LOOKUP_TYPE, LOOKUP_NEWPROPERTY, LOOKUP_NEWPROPERTY_DESC);
-        // stack: PropertyMap
+        mi.invokeStatic(ACCESSORPROPERTY_TYPE, ACCESSORPROPERTY_CREATE, ACCESSORPROPERTY_CREATE_DESC);
+        // boolean Collection.add(property)
+        mi.invokeInterface(COLLECTION_TYPE, COLLECTION_ADD, COLLECTION_ADD_DESC);
+        // pop return value of Collection.add
+        mi.pop();
+        // stack: Collection
     }
 
     static ScriptClassInfo getScriptClassInfo(final String fileName) throws IOException {
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,11 +32,11 @@
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.CONSTRUCTOR_SUFFIX;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.DEFAULT_INIT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DUPLICATE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DUPLICATE_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_FIELD_NAME;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DUPLICATE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DUPLICATE_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_FIELD_NAME;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPEOBJECT_SETCONSTRUCTOR;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPEOBJECT_SETCONSTRUCTOR_DESC;
@@ -129,7 +129,7 @@
 
     private void emitStaticInitializer() {
         final MethodGenerator mi = makeStaticInitializer();
-        emitStaticInitPrefix(mi, className);
+        emitStaticInitPrefix(mi, className, memberCount);
 
         for (final MemberInfo memInfo : scriptClassInfo.getMembers()) {
             if (memInfo.isConstructorFunction() || memInfo.isConstructorProperty()) {
@@ -170,10 +170,10 @@
 
     private void loadMap(final MethodGenerator mi) {
         if (memberCount > 0) {
-            mi.getStatic(className, MAP_FIELD_NAME, MAP_DESC);
+            mi.getStatic(className, PROPERTYMAP_FIELD_NAME, PROPERTYMAP_DESC);
             // make sure we use duplicated PropertyMap so that original map
-            // stays intact and so can be used for many globals in same context
-            mi.invokeVirtual(MAP_TYPE, MAP_DUPLICATE, MAP_DUPLICATE_DESC);
+            // stays intact and so can be used for many globals.
+            mi.invokeVirtual(PROPERTYMAP_TYPE, PROPERTYMAP_DUPLICATE, PROPERTYMAP_DUPLICATE_DESC);
         }
     }
 
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -57,6 +57,7 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.IASTORE;
 import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
 import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEINTERFACE;
 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC;
 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
@@ -347,6 +348,10 @@
     }
 
     // invokes, field get/sets
+    void invokeInterface(final String owner, final String method, final String desc) {
+        super.visitMethodInsn(INVOKEINTERFACE, owner, method, desc);
+    }
+
     void invokeVirtual(final String owner, final String method, final String desc) {
         super.visitMethodInsn(INVOKEVIRTUAL, owner, method, desc);
     }
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -30,11 +30,11 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.V1_7;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.DEFAULT_INIT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DUPLICATE;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DUPLICATE_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_FIELD_NAME;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_TYPE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DUPLICATE;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_DUPLICATE_DESC;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_FIELD_NAME;
+import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROPERTYMAP_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPEOBJECT_TYPE;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.PROTOTYPE_SUFFIX;
@@ -67,6 +67,7 @@
             // add <clinit>
             emitStaticInitializer();
         }
+
         // add <init>
         emitConstructor();
 
@@ -106,7 +107,7 @@
 
     private void emitStaticInitializer() {
         final MethodGenerator mi = makeStaticInitializer();
-        emitStaticInitPrefix(mi, className);
+        emitStaticInitPrefix(mi, className, memberCount);
         for (final MemberInfo memInfo : scriptClassInfo.getMembers()) {
             if (memInfo.isPrototypeFunction() || memInfo.isPrototypeProperty()) {
                 linkerAddGetterSetter(mi, className, memInfo);
@@ -124,10 +125,10 @@
         mi.loadThis();
         if (memberCount > 0) {
             // call "super(map$)"
-            mi.getStatic(className, MAP_FIELD_NAME, MAP_DESC);
+            mi.getStatic(className, PROPERTYMAP_FIELD_NAME, PROPERTYMAP_DESC);
             // make sure we use duplicated PropertyMap so that original map
-            // stays intact and so can be used for many globals in same context
-            mi.invokeVirtual(MAP_TYPE, MAP_DUPLICATE, MAP_DUPLICATE_DESC);
+            // stays intact and so can be used for many global.
+            mi.invokeVirtual(PROPERTYMAP_TYPE, PROPERTYMAP_DUPLICATE, PROPERTYMAP_DUPLICATE_DESC);
             mi.invokeSpecial(PROTOTYPEOBJECT_TYPE, INIT, SCRIPTOBJECT_INIT_DESC);
             // initialize Function type fields
             initFunctionFields(mi);
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -37,10 +37,7 @@
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.CLINIT;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.DEFAULT_INIT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.INIT;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.MAP_FIELD_NAME;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.OBJECT_DESC;
-import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTOBJECT_INIT_DESC;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.SCRIPTOBJECT_TYPE;
 
 import java.io.BufferedInputStream;
@@ -159,14 +156,7 @@
             public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc) {
                 if (isConstructor && opcode == INVOKESPECIAL &&
                         INIT.equals(name) && SCRIPTOBJECT_TYPE.equals(owner)) {
-
-                    // replace call to empty super-constructor with one passing PropertyMap argument
-                    if (DEFAULT_INIT_DESC.equals(desc)) {
-                        super.visitFieldInsn(GETSTATIC, scriptClassInfo.getJavaName(), MAP_FIELD_NAME, MAP_DESC);
-                        super.visitMethodInsn(INVOKESPECIAL, SCRIPTOBJECT_TYPE, INIT, SCRIPTOBJECT_INIT_DESC);
-                    } else {
-                        super.visitMethodInsn(opcode, owner, name, desc);
-                    }
+                    super.visitMethodInsn(opcode, owner, name, desc);
 
                     if (memberCount > 0) {
                         // initialize @Property fields if needed
@@ -256,7 +246,7 @@
         }
         // Now generate $clinit$
         final MethodGenerator mi = ClassGenerator.makeStaticInitializer(this, $CLINIT$);
-        ClassGenerator.emitStaticInitPrefix(mi, className);
+        ClassGenerator.emitStaticInitPrefix(mi, className, memberCount);
         if (memberCount > 0) {
             for (final MemberInfo memInfo : scriptClassInfo.getMembers()) {
                 if (memInfo.isInstanceProperty() || memInfo.isInstanceFunction()) {
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,10 +27,14 @@
 
 import java.lang.invoke.MethodHandle;
 import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import jdk.internal.org.objectweb.asm.Type;
-import jdk.nashorn.internal.lookup.Lookup;
 import jdk.nashorn.internal.objects.PrototypeObject;
 import jdk.nashorn.internal.objects.ScriptFunctionImpl;
+import jdk.nashorn.internal.runtime.AccessorProperty;
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
@@ -40,15 +44,41 @@
  */
 @SuppressWarnings("javadoc")
 public interface StringConstants {
+    // standard jdk types, methods
     static final Type TYPE_METHOD             = Type.getType(Method.class);
     static final Type TYPE_METHODHANDLE       = Type.getType(MethodHandle.class);
     static final Type TYPE_METHODHANDLE_ARRAY = Type.getType(MethodHandle[].class);
     static final Type TYPE_OBJECT             = Type.getType(Object.class);
     static final Type TYPE_CLASS              = Type.getType(Class.class);
     static final Type TYPE_STRING             = Type.getType(String.class);
+    static final Type TYPE_COLLECTION         = Type.getType(Collection.class);
+    static final Type TYPE_COLLECTIONS        = Type.getType(Collections.class);
+    static final Type TYPE_ARRAYLIST          = Type.getType(ArrayList.class);
+    static final Type TYPE_LIST               = Type.getType(List.class);
 
-    // Nashorn types
-    static final Type TYPE_LOOKUP             = Type.getType(Lookup.class);
+    static final String CLINIT = "<clinit>";
+    static final String INIT = "<init>";
+    static final String DEFAULT_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE);
+
+    static final String METHODHANDLE_TYPE = TYPE_METHODHANDLE.getInternalName();
+    static final String OBJECT_TYPE = TYPE_OBJECT.getInternalName();
+    static final String OBJECT_DESC = TYPE_OBJECT.getDescriptor();
+    static final String OBJECT_ARRAY_DESC = Type.getDescriptor(Object[].class);
+    static final String ARRAYLIST_TYPE = TYPE_ARRAYLIST.getInternalName();
+    static final String COLLECTION_TYPE = TYPE_COLLECTION.getInternalName();
+    static final String COLLECTIONS_TYPE = TYPE_COLLECTIONS.getInternalName();
+
+    // java.util.Collection.add(Object)
+    static final String COLLECTION_ADD = "add";
+    static final String COLLECTION_ADD_DESC = Type.getMethodDescriptor(Type.BOOLEAN_TYPE, TYPE_OBJECT);
+    // java.util.ArrayList.<init>(int)
+    static final String ARRAYLIST_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE);
+    // java.util.Collections.EMPTY_LIST
+    static final String COLLECTIONS_EMPTY_LIST = "EMPTY_LIST";
+    static final String LIST_DESC = TYPE_LIST.getDescriptor();
+
+    // Nashorn types, methods
+    static final Type TYPE_ACCESSORPROPERTY   = Type.getType(AccessorProperty.class);
     static final Type TYPE_PROPERTYMAP        = Type.getType(PropertyMap.class);
     static final Type TYPE_PROTOTYPEOBJECT    = Type.getType(PrototypeObject.class);
     static final Type TYPE_SCRIPTFUNCTION     = Type.getType(ScriptFunction.class);
@@ -57,54 +87,56 @@
 
     static final String PROTOTYPE_SUFFIX = "$Prototype";
     static final String CONSTRUCTOR_SUFFIX = "$Constructor";
+
     // This field name is known to Nashorn runtime (Context).
     // Synchronize the name change, if needed at all.
-    static final String MAP_FIELD_NAME = "$nasgenmap$";
+    static final String PROPERTYMAP_FIELD_NAME = "$nasgenmap$";
     static final String $CLINIT$ = "$clinit$";
-    static final String CLINIT = "<clinit>";
-    static final String INIT = "<init>";
-    static final String DEFAULT_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE);
 
-    static final String SCRIPTOBJECT_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_PROPERTYMAP);
+    // AccessorProperty
+    static final String ACCESSORPROPERTY_TYPE = TYPE_ACCESSORPROPERTY.getInternalName();
+    static final String ACCESSORPROPERTY_CREATE = "create";
+    static final String ACCESSORPROPERTY_CREATE_DESC =
+        Type.getMethodDescriptor(TYPE_ACCESSORPROPERTY, TYPE_STRING, Type.INT_TYPE, TYPE_METHODHANDLE, TYPE_METHODHANDLE);
 
-    static final String METHODHANDLE_TYPE = TYPE_METHODHANDLE.getInternalName();
+    // PropertyMap
+    static final String PROPERTYMAP_TYPE = TYPE_PROPERTYMAP.getInternalName();
+    static final String PROPERTYMAP_DESC = TYPE_PROPERTYMAP.getDescriptor();
+    static final String PROPERTYMAP_NEWMAP = "newMap";
+    static final String PROPERTYMAP_NEWMAP_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP, TYPE_COLLECTION);
+    static final String PROPERTYMAP_DUPLICATE = "duplicate";
+    static final String PROPERTYMAP_DUPLICATE_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP);
+    static final String PROPERTYMAP_SETISSHARED = "setIsShared";
+    static final String PROPERTYMAP_SETISSHARED_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP);
 
-    static final String OBJECT_TYPE = TYPE_OBJECT.getInternalName();
-    static final String OBJECT_DESC = TYPE_OBJECT.getDescriptor();
-    static final String OBJECT_ARRAY_DESC = Type.getDescriptor(Object[].class);
+    // PrototypeObject
+    static final String PROTOTYPEOBJECT_TYPE = TYPE_PROTOTYPEOBJECT.getInternalName();
+    static final String PROTOTYPEOBJECT_SETCONSTRUCTOR = "setConstructor";
+    static final String PROTOTYPEOBJECT_SETCONSTRUCTOR_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_OBJECT, TYPE_OBJECT);
 
+    // ScriptFunction
     static final String SCRIPTFUNCTION_TYPE = TYPE_SCRIPTFUNCTION.getInternalName();
+    static final String SCRIPTFUNCTION_SETARITY = "setArity";
+    static final String SCRIPTFUNCTION_SETARITY_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE);
+    static final String SCRIPTFUNCTION_SETPROTOTYPE = "setPrototype";
+    static final String SCRIPTFUNCTION_SETPROTOTYPE_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_OBJECT);
+
+    // ScriptFunctionImpl
     static final String SCRIPTFUNCTIONIMPL_TYPE = TYPE_SCRIPTFUNCTIONIMPL.getInternalName();
     static final String SCRIPTFUNCTIONIMPL_MAKEFUNCTION = "makeFunction";
     static final String SCRIPTFUNCTIONIMPL_MAKEFUNCTION_DESC =
         Type.getMethodDescriptor(TYPE_SCRIPTFUNCTION, TYPE_STRING, TYPE_METHODHANDLE);
     static final String SCRIPTFUNCTIONIMPL_MAKEFUNCTION_SPECS_DESC =
         Type.getMethodDescriptor(TYPE_SCRIPTFUNCTION, TYPE_STRING, TYPE_METHODHANDLE, TYPE_METHODHANDLE_ARRAY);
-
     static final String SCRIPTFUNCTIONIMPL_INIT_DESC3 =
         Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_STRING, TYPE_METHODHANDLE, TYPE_METHODHANDLE_ARRAY);
     static final String SCRIPTFUNCTIONIMPL_INIT_DESC4 =
         Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_STRING, TYPE_METHODHANDLE, TYPE_PROPERTYMAP, TYPE_METHODHANDLE_ARRAY);
-    static final String SCRIPTFUNCTION_SETARITY = "setArity";
-    static final String SCRIPTFUNCTION_SETARITY_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE);
-    static final String SCRIPTFUNCTION_SETPROTOTYPE = "setPrototype";
-    static final String SCRIPTFUNCTION_SETPROTOTYPE_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_OBJECT);
-    static final String PROTOTYPEOBJECT_TYPE = TYPE_PROTOTYPEOBJECT.getInternalName();
-    static final String PROTOTYPEOBJECT_SETCONSTRUCTOR = "setConstructor";
-    static final String PROTOTYPEOBJECT_SETCONSTRUCTOR_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_OBJECT, TYPE_OBJECT);
+
+    // ScriptObject
     static final String SCRIPTOBJECT_TYPE = TYPE_SCRIPTOBJECT.getInternalName();
-    static final String MAP_TYPE = TYPE_PROPERTYMAP.getInternalName();
-    static final String MAP_DESC = TYPE_PROPERTYMAP.getDescriptor();
-    static final String MAP_NEWMAP = "newMap";
-    static final String MAP_NEWMAP_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP, TYPE_CLASS);
-    static final String MAP_DUPLICATE = "duplicate";
-    static final String MAP_DUPLICATE_DESC = Type.getMethodDescriptor(TYPE_PROPERTYMAP);
-    static final String MAP_SETFLAGS = "setFlags";
-    static final String LOOKUP_TYPE = TYPE_LOOKUP.getInternalName();
-    static final String LOOKUP_GETMETHOD = "getMethod";
-    static final String LOOKUP_NEWPROPERTY = "newProperty";
-    static final String LOOKUP_NEWPROPERTY_DESC =
-        Type.getMethodDescriptor(TYPE_PROPERTYMAP, TYPE_PROPERTYMAP, TYPE_STRING, Type.INT_TYPE, TYPE_METHODHANDLE, TYPE_METHODHANDLE);
+    static final String SCRIPTOBJECT_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_PROPERTYMAP);
+
     static final String GETTER_PREFIX = "G$";
     static final String SETTER_PREFIX = "S$";
 
--- a/nashorn/docs/JavaScriptingProgrammersGuide.html	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/docs/JavaScriptingProgrammersGuide.html	Fri Jul 26 14:07:32 2013 -0700
@@ -501,14 +501,19 @@
  var anArrayListWithSize = new ArrayList(16)
 </code></pre> 
 
-In the special case of inner classes, you need to use the JVM fully qualified name, meaning using $ sign in the class name:
+In the special case of inner classes, you can either use the JVM fully qualified name, meaning using the dollar sign in the class name, or you can use the dot:
 
 <pre><code>
  var ftype = Java.type("java.awt.geom.Arc2D$Float")
 </code></pre> 
  
+and
+ 
+<pre><code>
+ var ftype = Java.type("java.awt.geom.Arc2D.Float")
+</code></pre> 
 
-However, once you retrieved the outer class, you can access the inner class as a property on it:
+both work. Note however that using the dollar sign is faster, as Java.type first tries to resolve the class name as it is originally specified, and the internal JVM names for inner classes use the dollar sign. If you use the dot, Java.type will internally get a ClassNotFoundException and subsequently retry by changing the last dot to dollar sign. As a matter of fact, it'll keep replacing dots with dollar signs until it either successfully loads the class or runs out of all dots in the name. This way it can correctly resolve and load even multiply nested inner classes with the dot notation. Again, this will be slower than using the dollar signs in the name. An alternative way to access the inner class is as a property of the outer class:
 
 <pre><code>
  var arctype = Java.type("java.awt.geom.Arc2D")
--- a/nashorn/make/build-nasgen.xml	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/make/build-nasgen.xml	Fri Jul 26 14:07:32 2013 -0700
@@ -42,11 +42,6 @@
             <arg value="jdk.nashorn.internal.objects"/>
             <arg value="${basedir}/build/classes"/>
         </java>
-
-        <move todir="${basedir}/build/classes/jdk/nashorn/internal/objects">
-            <fileset dir="${basedir}/build/classes/jdk/nashorn/internal/objects"/>
-            <mapper type="glob" from="*.class" to="*.clazz"/>
-        </move>
     </target>
 
     <target name="run-nasgen-eclipse">
@@ -66,7 +61,6 @@
             <fileset dir="${basedir}/build/eclipse/.nasgentmp/jdk/nashorn/internal/objects">
                 <include name="*.class"/>
             </fileset>
-            <mapper type="glob" from="*.class" to="*.clazz"/>
         </move>
 
         <delete includeemptydirs="true"><fileset dir="${basedir}/build/eclipse/.nasgentmp" includes="**"/></delete>
@@ -75,7 +69,6 @@
             <fileset dir="${basedir}/build/eclipse/jdk/nashorn/internal/objects">
                 <include name="**/*.class"/>
             </fileset>
-            <mapper type="glob" from="*.class" to="*.clazz"/>
         </copy>
     </target>
 
--- a/nashorn/make/build.xml	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/make/build.xml	Fri Jul 26 14:07:32 2013 -0700
@@ -100,7 +100,8 @@
            target="${javac.target}"
            debug="${javac.debug}"
            encoding="${javac.encoding}"
-           includeantruntime="false">
+           includeantruntime="false" fork="true">
+      <compilerarg value="-J-Djava.ext.dirs="/>
       <compilerarg value="-Xlint:unchecked"/>
       <compilerarg value="-Xlint:deprecation"/>
       <compilerarg value="-XDignore.symbol.file"/>
@@ -218,8 +219,10 @@
            target="${javac.target}"
            debug="${javac.debug}"
            encoding="${javac.encoding}"
-           includeantruntime="false">
-        <compilerarg line="-extdirs &quot;&quot;"/>
+           includeantruntime="false" fork="true">
+        <compilerarg value="-J-Djava.ext.dirs="/>
+        <compilerarg value="-Xlint:unchecked"/>
+        <compilerarg value="-Xlint:deprecation"/>
     </javac>
 
     <!-- tests that check nashorn internals and internal API -->
@@ -235,44 +238,31 @@
   </target>
 
   <target name="generate-policy-file" depends="prepare">
-    <!-- Generating nashorn.policy file -->
+    <echo file="${build.dir}/nashorn.policy">
 
-    <!-- nashorn internal tests jar requires AllPermission -->
-    <echo message="grant codeBase &quot;file:/${basedir}/${nashorn.internal.tests.jar}&quot; {" file="${build.dir}/nashorn.policy"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="    permission java.security.AllPermission;" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="};" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
+grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
+    permission java.security.AllPermission;
+};
 
-    <!-- TestNG framework jar needs AllPermission -->
-    <echo message="grant codeBase &quot;file:/${basedir}/${file.reference.testng.jar}&quot; {" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="    permission java.security.AllPermission;" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="};" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
+grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
+    permission java.security.AllPermission;
+};
 
-    <!-- AllPermission to test/script/trusted tests -->
-    <echo message="grant codeBase &quot;file:/${basedir}/test/script/trusted/*&quot; {" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="    permission java.security.AllPermission;" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="};" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
+grant codeBase "file:/${basedir}/test/script/trusted/*" {
+    permission java.security.AllPermission;
+};
 
-    <echo message="grant codeBase &quot;file:/${basedir}/test/script/basic/*&quot; {" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <!-- test/script/basic .js scripts load other script tests -->
-    <echo message="    permission java.io.FilePermission &quot;${basedir}/test/script/-&quot;, &quot;read&quot;;" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="    permission java.io.FilePermission &quot;user.dir&quot;, &quot;read&quot;;" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="    permission java.util.PropertyPermission &quot;user.dir&quot;, &quot;read&quot;;" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <!-- test/script/basic .js scripts can read nashorn.test.* properties -->
-    <echo message="    permission java.util.PropertyPermission &quot;nashorn.test.*&quot;, &quot;read&quot;;" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="};" file="${build.dir}/nashorn.policy" append="true"/>
-    <echo message="" file="${build.dir}/nashorn.policy" append="true"/>
+grant codeBase "file:/${basedir}/test/script/basic/*" {
+    permission java.io.FilePermission "${basedir}/test/script/-", "read";
+    permission java.io.FilePermission "$${user.dir}", "read";
+    permission java.util.PropertyPermission "user.dir", "read";
+    permission java.util.PropertyPermission "nashorn.test.*", "read";
+};
+
+grant codeBase "file:/${basedir}/test/script/basic/JDK-8010946-privileged.js" {
+    permission java.util.PropertyPermission "java.security.policy", "read";
+};
+    </echo>
 
     <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace>    <!--hack for Windows - to make URLs with normal path separators -->
     <replace file="${build.dir}/nashorn.policy"><replacetoken>//</replacetoken><replacevalue>/</replacevalue></replace>   <!--hack for Unix - to avoid leading // in URLs -->
--- a/nashorn/make/code_coverage.xml	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/make/code_coverage.xml	Fri Jul 26 14:07:32 2013 -0700
@@ -60,16 +60,8 @@
     <copy todir="${build.dir}/to_be_instrumented">
       <fileset dir="${build.classes.dir}">
         <include name="**/*.class"/>
-        <include name="**/*.clazz"/>
       </fileset>
     </copy>
-
-    <move todir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
-      <fileset dir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
-        <include name="**/*.clazz"/>
-      </fileset>
-      <mapper type="glob" from="*.clazz" to="*.class"/>
-    </move>
   </target>
 
   <target name="generate-cc-template" depends="prepare-to-be-instrumented" description="Generates code coverage template for dynamic CC" if="cc.generate.template">
--- a/nashorn/make/project.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/make/project.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -200,6 +200,9 @@
 
 # test262 test frameworks
 test262-test-sys-prop.test.js.framework=\
+    --class-cache-size=0 \
+    --no-java \
+    --no-typed-arrays \
     -timezone=PST \
     ${test.script.dir}/test262.js \
     ${test262.dir}/test/harness/framework.js \
--- a/nashorn/makefiles/BuildNashorn.gmk	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/makefiles/BuildNashorn.gmk	Fri Jul 26 14:07:32 2013 -0700
@@ -71,7 +71,6 @@
 $(BUILD_NASGEN): $(BUILD_NASHORN)
 
 # Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
-# Finally rename classes in jdk.nashorn.internal.objects package
 $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run: $(BUILD_NASGEN)
 	$(ECHO) Running nasgen
 	$(MKDIR) -p $(@D)
@@ -80,9 +79,6 @@
 	$(FIXPATH) $(JAVA) \
 		-cp "$(NASHORN_OUTPUTDIR)/nasgen_classes$(PATH_SEP)$(NASHORN_OUTPUTDIR)/nashorn_classes" \
 		jdk.nashorn.internal.tools.nasgen.Main $(@D) jdk.nashorn.internal.objects $(@D)
-	for f in `$(FIND) $(@D)/jdk/nashorn/internal/objects/ -name "*.class"`; do \
-	  mv "$$f" `$(ECHO) "$$f" | $(SED) "s/\.class$$/\.clazz/"`; \
-        done
 	$(TOUCH) $@
 
 # Version file needs to be processed with version numbers
@@ -104,7 +100,7 @@
     $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run \
     $(VERSION_FILE),\
     SRCS:=$(NASHORN_OUTPUTDIR)/classes,\
-    SUFFIXES:=.class .clazz .js .properties Factory,\
+    SUFFIXES:=.class .js .properties Factory,\
     MANIFEST:=$(NASHORN_TOPDIR)/src/META-INF/MANIFEST.MF,\
     EXTRA_MANIFEST_ATTR:=$(MANIFEST_ATTRIBUTES),\
     SKIP_METAINF:=true,\
--- a/nashorn/src/jdk/internal/dynalink/DynamicLinker.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/DynamicLinker.java	Fri Jul 26 14:07:32 2013 -0700
@@ -144,6 +144,9 @@
     private static final String CLASS_NAME = DynamicLinker.class.getName();
     private static final String RELINK_METHOD_NAME = "relink";
 
+    private static final String INITIAL_LINK_CLASS_NAME = "java.lang.invoke.MethodHandleNatives";
+    private static final String INITIAL_LINK_METHOD_NAME = "linkCallSite";
+
     private final LinkerServices linkerServices;
     private final int runtimeContextArgCount;
     private final boolean syncOnRelink;
@@ -262,20 +265,54 @@
     }
 
     /**
-     * Returns a stack trace element describing the location of the call site currently being relinked on the current
+     * Returns a stack trace element describing the location of the call site currently being linked on the current
      * thread. The operation internally creates a Throwable object and inspects its stack trace, so it's potentially
      * expensive. The recommended usage for it is in writing diagnostics code.
-     * @return a stack trace element describing the location of the call site currently being relinked, or null if it is
-     * not invoked while a call site is being relinked.
+     * @return a stack trace element describing the location of the call site currently being linked, or null if it is
+     * not invoked while a call site is being linked.
      */
-    public static StackTraceElement getRelinkedCallSiteLocation() {
+    public static StackTraceElement getLinkedCallSiteLocation() {
         final StackTraceElement[] trace = new Throwable().getStackTrace();
         for(int i = 0; i < trace.length - 1; ++i) {
             final StackTraceElement frame = trace[i];
-            if(RELINK_METHOD_NAME.equals(frame.getMethodName()) && CLASS_NAME.equals(frame.getClassName())) {
+            if(isRelinkFrame(frame) || isInitialLinkFrame(frame)) {
                 return trace[i + 1];
             }
         }
         return null;
     }
+
+    /**
+     * Deprecated because of not precise name.
+     * @deprecated Use {@link #getLinkedCallSiteLocation()} instead.
+     * @return see non-deprecated method
+     */
+    @Deprecated
+    public static StackTraceElement getRelinkedCallSiteLocation() {
+        return getLinkedCallSiteLocation();
+    }
+
+    /**
+     * Returns true if the frame represents {@code MethodHandleNatives.linkCallSite()}, the frame immediately on top of
+     * the call site frame when the call site is being linked for the first time.
+     * @param frame the frame
+     * @return true if this frame represents {@code MethodHandleNatives.linkCallSite()}
+     */
+    private static boolean isInitialLinkFrame(final StackTraceElement frame) {
+        return testFrame(frame, INITIAL_LINK_METHOD_NAME, INITIAL_LINK_CLASS_NAME);
+    }
+
+    /**
+     * Returns true if the frame represents {@code DynamicLinker.relink()}, the frame immediately on top of the call
+     * site frame when the call site is being relinked (linked for second and subsequent times).
+     * @param frame the frame
+     * @return true if this frame represents {@code DynamicLinker.relink()}
+     */
+    private static boolean isRelinkFrame(final StackTraceElement frame) {
+        return testFrame(frame, RELINK_METHOD_NAME, CLASS_NAME);
+    }
+
+    private static boolean testFrame(final StackTraceElement frame, final String methodName, final String className) {
+        return methodName.equals(frame.getMethodName()) && className.equals(frame.getClassName());
+    }
 }
--- a/nashorn/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Fri Jul 26 14:07:32 2013 -0700
@@ -86,9 +86,14 @@
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
+import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -109,10 +114,11 @@
  * @author Attila Szegedi
  */
 abstract class AbstractJavaLinker implements GuardingDynamicLinker {
+
     final Class<?> clazz;
     private final MethodHandle classGuard;
     private final MethodHandle assignableGuard;
-    private final Map<String, AnnotatedMethodHandle> propertyGetters = new HashMap<>();
+    private final Map<String, AnnotatedDynamicMethod> propertyGetters = new HashMap<>();
     private final Map<String, DynamicMethod> propertySetters = new HashMap<>();
     private final Map<String, DynamicMethod> methods = new HashMap<>();
 
@@ -129,22 +135,19 @@
         // Add methods and properties
         for(Method method: introspector.getMethods()) {
             final String name = method.getName();
-            final MethodHandle methodHandle = introspector.unreflect(method);
             // Add method
-            addMember(name, methodHandle, methods);
+            addMember(name, method, methods);
             // Add the method as a property getter and/or setter
             if(name.startsWith("get") && name.length() > 3 && method.getParameterTypes().length == 0) {
                 // Property getter
-                setPropertyGetter(decapitalize(name.substring(3)), introspector.unreflect(
-                        getMostGenericGetter(method)), ValidationType.INSTANCE_OF);
+                setPropertyGetter(method, 3);
             } else if(name.startsWith("is") && name.length() > 2 && method.getParameterTypes().length == 0 &&
                     method.getReturnType() == boolean.class) {
                 // Boolean property getter
-                setPropertyGetter(decapitalize(name.substring(2)), introspector.unreflect(
-                        getMostGenericGetter(method)), ValidationType.INSTANCE_OF);
+                setPropertyGetter(method, 2);
             } else if(name.startsWith("set") && name.length() > 3 && method.getParameterTypes().length == 1) {
                 // Property setter
-                addMember(decapitalize(name.substring(3)), methodHandle, propertySetters);
+                addMember(decapitalize(name.substring(3)), method, propertySetters);
             }
         }
 
@@ -156,7 +159,8 @@
                 setPropertyGetter(name, introspector.unreflectGetter(field), ValidationType.EXACT_CLASS);
             }
             if(!(Modifier.isFinal(field.getModifiers()) || propertySetters.containsKey(name))) {
-                addMember(name, introspector.unreflectSetter(field), propertySetters);
+                addMember(name, new SimpleDynamicMethod(introspector.unreflectSetter(field), clazz, name),
+                        propertySetters);
             }
         }
 
@@ -192,38 +196,135 @@
 
     abstract FacetIntrospector createFacetIntrospector();
 
-    void setPropertyGetter(String name, MethodHandle handle, ValidationType validationType) {
-        propertyGetters.put(name, new AnnotatedMethodHandle(handle, validationType));
+    Collection<String> getReadablePropertyNames() {
+        return getUnmodifiableKeys(propertyGetters);
+    }
+
+    Collection<String> getWritablePropertyNames() {
+        return getUnmodifiableKeys(propertySetters);
+    }
+
+    Collection<String> getMethodNames() {
+        return getUnmodifiableKeys(methods);
+    }
+
+    private static Collection<String> getUnmodifiableKeys(Map<String, ?> m) {
+        return Collections.unmodifiableCollection(m.keySet());
+    }
+
+    /**
+     * Sets the specified dynamic method to be the property getter for the specified property. Note that you can only
+     * use this when you're certain that the method handle does not belong to a caller-sensitive method. For properties
+     * that are caller-sensitive, you must use {@link #setPropertyGetter(String, SingleDynamicMethod, ValidationType)}
+     * instead.
+     * @param name name of the property
+     * @param handle the method handle that implements the property getter
+     * @param validationType the validation type for the property
+     */
+    private void setPropertyGetter(String name, SingleDynamicMethod handle, ValidationType validationType) {
+        propertyGetters.put(name, new AnnotatedDynamicMethod(handle, validationType));
     }
 
-    private void addMember(String name, MethodHandle mh, Map<String, DynamicMethod> methodMap) {
+    /**
+     * Sets the specified reflective method to be the property getter for the specified property.
+     * @param getter the getter method
+     * @param prefixLen the getter prefix in the method name; should be 3 for getter names starting with "get" and 2 for
+     * names starting with "is".
+     */
+    private void setPropertyGetter(Method getter, int prefixLen) {
+        setPropertyGetter(decapitalize(getter.getName().substring(prefixLen)), createDynamicMethod(
+                getMostGenericGetter(getter)), ValidationType.INSTANCE_OF);
+    }
+
+    /**
+     * Sets the specified method handle to be the property getter for the specified property. Note that you can only
+     * use this when you're certain that the method handle does not belong to a caller-sensitive method. For properties
+     * that are caller-sensitive, you must use {@link #setPropertyGetter(String, SingleDynamicMethod, ValidationType)}
+     * instead.
+     * @param name name of the property
+     * @param handle the method handle that implements the property getter
+     * @param validationType the validation type for the property
+     */
+    void setPropertyGetter(String name, MethodHandle handle, ValidationType validationType) {
+        setPropertyGetter(name, new SimpleDynamicMethod(handle, clazz, name), validationType);
+    }
+
+    private void addMember(String name, AccessibleObject ao, Map<String, DynamicMethod> methodMap) {
+        addMember(name, createDynamicMethod(ao), methodMap);
+    }
+
+    private void addMember(String name, SingleDynamicMethod method, Map<String, DynamicMethod> methodMap) {
         final DynamicMethod existingMethod = methodMap.get(name);
-        final DynamicMethod newMethod = addMember(mh, existingMethod, clazz, name);
+        final DynamicMethod newMethod = mergeMethods(method, existingMethod, clazz, name);
         if(newMethod != existingMethod) {
             methodMap.put(name, newMethod);
         }
     }
 
-    static DynamicMethod createDynamicMethod(Iterable<MethodHandle> methodHandles, Class<?> clazz, String name) {
+    /**
+     * Given one or more reflective methods or constructors, creates a dynamic method that represents them all. The
+     * methods should represent all overloads of the same name (or all constructors of the class).
+     * @param members the reflective members
+     * @param clazz the class declaring the reflective members
+     * @param name the common name of the reflective members.
+     * @return a dynamic method representing all the specified reflective members.
+     */
+    static DynamicMethod createDynamicMethod(Iterable<? extends AccessibleObject> members, Class<?> clazz, String name) {
         DynamicMethod dynMethod = null;
-        for(MethodHandle methodHandle: methodHandles) {
-            dynMethod = addMember(methodHandle, dynMethod, clazz, name);
+        for(AccessibleObject method: members) {
+            dynMethod = mergeMethods(createDynamicMethod(method), dynMethod, clazz, name);
         }
         return dynMethod;
     }
 
-    private static DynamicMethod addMember(MethodHandle mh, DynamicMethod existing, Class<?> clazz, String name) {
+    /**
+     * Given a reflective method or a constructor, creates a dynamic method that represents it. This method will
+     * distinguish between caller sensitive and ordinary methods/constructors, and create appropriate caller sensitive
+     * dynamic method when needed.
+     * @param m the reflective member
+     * @return the single dynamic method representing the reflective member
+     */
+    private static SingleDynamicMethod createDynamicMethod(AccessibleObject m) {
+        if(CallerSensitiveDetector.isCallerSensitive(m)) {
+            return new CallerSensitiveDynamicMethod(m);
+        }
+        final Member member = (Member)m;
+        return new SimpleDynamicMethod(unreflectSafely(m), member.getDeclaringClass(), member.getName());
+    }
+
+    /**
+     * Unreflects a method handle from a Method or a Constructor using safe (zero-privilege) unreflection. Should be
+     * only used for methods and constructors that are not caller sensitive. If a caller sensitive method were
+     * unreflected through this mechanism, it would not be a security issue, but would be bound to the zero-privilege
+     * unreflector as its caller, and thus completely useless.
+     * @param m the method or constructor
+     * @return the method handle
+     */
+    private static MethodHandle unreflectSafely(AccessibleObject m) {
+        if(m instanceof Method) {
+            final Method reflMethod = (Method)m;
+            final MethodHandle handle = SafeUnreflector.unreflect(reflMethod);
+            if(Modifier.isStatic(reflMethod.getModifiers())) {
+                return StaticClassIntrospector.editStaticMethodHandle(handle);
+            }
+            return handle;
+        }
+        return StaticClassIntrospector.editConstructorMethodHandle(SafeUnreflector.unreflectConstructor(
+                (Constructor<?>)m));
+    }
+
+    private static DynamicMethod mergeMethods(SingleDynamicMethod method, DynamicMethod existing, Class<?> clazz, String name) {
         if(existing == null) {
-            return new SimpleDynamicMethod(mh, clazz, name);
-        } else if(existing.contains(mh)) {
+            return method;
+        } else if(existing.contains(method)) {
             return existing;
-        } else if(existing instanceof SimpleDynamicMethod) {
+        } else if(existing instanceof SingleDynamicMethod) {
             final OverloadedDynamicMethod odm = new OverloadedDynamicMethod(clazz, name);
-            odm.addMethod(((SimpleDynamicMethod)existing));
-            odm.addMethod(mh);
+            odm.addMethod(((SingleDynamicMethod)existing));
+            odm.addMethod(method);
             return odm;
         } else if(existing instanceof OverloadedDynamicMethod) {
-            ((OverloadedDynamicMethod)existing).addMethod(mh);
+            ((OverloadedDynamicMethod)existing).addMethod(method);
             return existing;
         }
         throw new AssertionError();
@@ -296,7 +397,7 @@
     private GuardedInvocation getCallPropWithThis(CallSiteDescriptor callSiteDescriptor, LinkerServices linkerServices) {
         switch(callSiteDescriptor.getNameTokenCount()) {
             case 3: {
-                return createGuardedDynamicMethodInvocation(callSiteDescriptor.getMethodType(), linkerServices,
+                return createGuardedDynamicMethodInvocation(callSiteDescriptor, linkerServices,
                         callSiteDescriptor.getNameToken(CallSiteDescriptor.NAME_OPERAND), methods);
             }
             default: {
@@ -305,16 +406,16 @@
         }
     }
 
-    private GuardedInvocation createGuardedDynamicMethodInvocation(MethodType callSiteType,
+    private GuardedInvocation createGuardedDynamicMethodInvocation(CallSiteDescriptor callSiteDescriptor,
             LinkerServices linkerServices, String methodName, Map<String, DynamicMethod> methodMap){
-        final MethodHandle inv = getDynamicMethodInvocation(callSiteType, linkerServices, methodName, methodMap);
-        return inv == null ? null : new GuardedInvocation(inv, getClassGuard(callSiteType));
+        final MethodHandle inv = getDynamicMethodInvocation(callSiteDescriptor, linkerServices, methodName, methodMap);
+        return inv == null ? null : new GuardedInvocation(inv, getClassGuard(callSiteDescriptor.getMethodType()));
     }
 
-    private static MethodHandle getDynamicMethodInvocation(MethodType callSiteType, LinkerServices linkerServices,
-            String methodName, Map<String, DynamicMethod> methodMap) {
+    private static MethodHandle getDynamicMethodInvocation(CallSiteDescriptor callSiteDescriptor,
+            LinkerServices linkerServices, String methodName, Map<String, DynamicMethod> methodMap) {
         final DynamicMethod dynaMethod = getDynamicMethod(methodName, methodMap);
-        return dynaMethod != null ? dynaMethod.getInvocation(callSiteType, linkerServices) : null;
+        return dynaMethod != null ? dynaMethod.getInvocation(callSiteDescriptor, linkerServices) : null;
     }
 
     private static DynamicMethod getDynamicMethod(String methodName, Map<String, DynamicMethod> methodMap) {
@@ -322,13 +423,13 @@
         return dynaMethod != null ? dynaMethod : getExplicitSignatureDynamicMethod(methodName, methodMap);
     }
 
-    private static SimpleDynamicMethod getExplicitSignatureDynamicMethod(String methodName,
+    private static SingleDynamicMethod getExplicitSignatureDynamicMethod(String methodName,
             Map<String, DynamicMethod> methodsMap) {
         // What's below is meant to support the "name(type, type, ...)" syntax that programmers can use in a method name
         // to manually pin down an exact overloaded variant. This is not usually required, as the overloaded method
         // resolution works correctly in almost every situation. However, in presence of many language-specific
         // conversions with a radically dynamic language, most overloaded methods will end up being constantly selected
-        // at invocation time, so a programmer knowledgable of the situation might choose to pin down an exact overload
+        // at invocation time, so a programmer knowledgeable of the situation might choose to pin down an exact overload
         // for performance reasons.
 
         // Is the method name lexically of the form "name(types)"?
@@ -377,8 +478,8 @@
                 final MethodType setterType = type.dropParameterTypes(1, 2);
                 // Bind property setter handle to the expected setter type and linker services. Type is
                 // MethodHandle(Object, String, Object)
-                final MethodHandle boundGetter = MethodHandles.insertArguments(getPropertySetterHandle, 0, setterType,
-                        linkerServices);
+                final MethodHandle boundGetter = MethodHandles.insertArguments(getPropertySetterHandle, 0,
+                        CallSiteDescriptorFactory.dropParameterTypes(callSiteDescriptor, 1, 2), linkerServices);
 
                 // Cast getter to MethodHandle(O, N, V)
                 final MethodHandle typedGetter = linkerServices.asType(boundGetter, type.changeReturnType(
@@ -415,9 +516,8 @@
             case 3: {
                 // Must have two arguments: target object and property value
                 assertParameterCount(callSiteDescriptor, 2);
-                final GuardedInvocation gi = createGuardedDynamicMethodInvocation(callSiteDescriptor.getMethodType(),
-                        linkerServices, callSiteDescriptor.getNameToken(CallSiteDescriptor.NAME_OPERAND),
-                        propertySetters);
+                final GuardedInvocation gi = createGuardedDynamicMethodInvocation(callSiteDescriptor, linkerServices,
+                        callSiteDescriptor.getNameToken(CallSiteDescriptor.NAME_OPERAND), propertySetters);
                 // If we have a property setter with this name, this composite operation will always stop here
                 if(gi != null) {
                     return new GuardedInvocationComponent(gi, clazz, ValidationType.EXACT_CLASS);
@@ -435,14 +535,13 @@
 
     private static final Lookup privateLookup = new Lookup(MethodHandles.lookup());
 
-    private static final MethodHandle IS_ANNOTATED_HANDLE_NOT_NULL = Guards.isNotNull().asType(MethodType.methodType(
-            boolean.class, AnnotatedMethodHandle.class));
-    private static final MethodHandle CONSTANT_NULL_DROP_ANNOTATED_HANDLE = MethodHandles.dropArguments(
-            MethodHandles.constant(Object.class, null), 0, AnnotatedMethodHandle.class);
-    private static final MethodHandle GET_ANNOTATED_HANDLE = privateLookup.findGetter(AnnotatedMethodHandle.class,
-            "handle", MethodHandle.class);
-    private static final MethodHandle GENERIC_PROPERTY_GETTER_HANDLER_INVOKER = MethodHandles.filterArguments(
-            MethodHandles.invoker(MethodType.methodType(Object.class, Object.class)), 0, GET_ANNOTATED_HANDLE);
+    private static final MethodHandle IS_ANNOTATED_METHOD_NOT_NULL = Guards.isNotNull().asType(MethodType.methodType(
+            boolean.class, AnnotatedDynamicMethod.class));
+    private static final MethodHandle CONSTANT_NULL_DROP_ANNOTATED_METHOD = MethodHandles.dropArguments(
+            MethodHandles.constant(Object.class, null), 0, AnnotatedDynamicMethod.class);
+    private static final MethodHandle GET_ANNOTATED_METHOD = privateLookup.findVirtual(AnnotatedDynamicMethod.class,
+            "getTarget", MethodType.methodType(MethodHandle.class, MethodHandles.Lookup.class));
+    private static final MethodHandle GETTER_INVOKER = MethodHandles.invoker(MethodType.methodType(Object.class, Object.class));
 
     private GuardedInvocationComponent getPropertyGetter(CallSiteDescriptor callSiteDescriptor,
             LinkerServices linkerServices, List<String> ops) throws Exception {
@@ -455,16 +554,20 @@
                 // What's below is basically:
                 //   foldArguments(guardWithTest(isNotNull, invoke(get_handle), null|nextComponent.invocation), get_getter_handle)
                 // only with a bunch of method signature adjustments. Basically, retrieve method getter
-                // AnnotatedMethodHandle; if it is non-null, invoke its "handle" field, otherwise either return null,
+                // AnnotatedDynamicMethod; if it is non-null, invoke its "handle" field, otherwise either return null,
                 // or delegate to next component's invocation.
 
                 final MethodHandle typedGetter = linkerServices.asType(getPropertyGetterHandle, type.changeReturnType(
-                        AnnotatedMethodHandle.class));
-                // Object(AnnotatedMethodHandle, Object)->R(AnnotatedMethodHandle, T0)
-                final MethodHandle invokeHandleTyped = linkerServices.asType(GENERIC_PROPERTY_GETTER_HANDLER_INVOKER,
-                        MethodType.methodType(type.returnType(), AnnotatedMethodHandle.class, type.parameterType(0)));
+                        AnnotatedDynamicMethod.class));
+                final MethodHandle callSiteBoundMethodGetter = MethodHandles.insertArguments(
+                        GET_ANNOTATED_METHOD, 1, callSiteDescriptor.getLookup());
+                final MethodHandle callSiteBoundInvoker = MethodHandles.filterArguments(GETTER_INVOKER, 0,
+                        callSiteBoundMethodGetter);
+                // Object(AnnotatedDynamicMethod, Object)->R(AnnotatedDynamicMethod, T0)
+                final MethodHandle invokeHandleTyped = linkerServices.asType(callSiteBoundInvoker,
+                        MethodType.methodType(type.returnType(), AnnotatedDynamicMethod.class, type.parameterType(0)));
                 // Since it's in the target of a fold, drop the unnecessary second argument
-                // R(AnnotatedMethodHandle, T0)->R(AnnotatedMethodHandle, T0, T1)
+                // R(AnnotatedDynamicMethod, T0)->R(AnnotatedDynamicMethod, T0, T1)
                 final MethodHandle invokeHandleFolded = MethodHandles.dropArguments(invokeHandleTyped, 2,
                         type.parameterType(1));
                 final GuardedInvocationComponent nextComponent = getGuardedInvocationComponent(callSiteDescriptor,
@@ -472,19 +575,19 @@
 
                 final MethodHandle fallbackFolded;
                 if(nextComponent == null) {
-                    // Object(AnnotatedMethodHandle)->R(AnnotatedMethodHandle, T0, T1); returns constant null
-                    fallbackFolded = MethodHandles.dropArguments(CONSTANT_NULL_DROP_ANNOTATED_HANDLE, 1,
-                            type.parameterList()).asType(type.insertParameterTypes(0, AnnotatedMethodHandle.class));
+                    // Object(AnnotatedDynamicMethod)->R(AnnotatedDynamicMethod, T0, T1); returns constant null
+                    fallbackFolded = MethodHandles.dropArguments(CONSTANT_NULL_DROP_ANNOTATED_METHOD, 1,
+                            type.parameterList()).asType(type.insertParameterTypes(0, AnnotatedDynamicMethod.class));
                 } else {
-                    // R(T0, T1)->R(AnnotatedMethodHAndle, T0, T1); adapts the next component's invocation to drop the
+                    // R(T0, T1)->R(AnnotatedDynamicMethod, T0, T1); adapts the next component's invocation to drop the
                     // extra argument resulting from fold
                     fallbackFolded = MethodHandles.dropArguments(nextComponent.getGuardedInvocation().getInvocation(),
-                            0, AnnotatedMethodHandle.class);
+                            0, AnnotatedDynamicMethod.class);
                 }
 
-                // fold(R(AnnotatedMethodHandle, T0, T1), AnnotatedMethodHandle(T0, T1))
+                // fold(R(AnnotatedDynamicMethod, T0, T1), AnnotatedDynamicMethod(T0, T1))
                 final MethodHandle compositeGetter = MethodHandles.foldArguments(MethodHandles.guardWithTest(
-                            IS_ANNOTATED_HANDLE_NOT_NULL, invokeHandleFolded, fallbackFolded), typedGetter);
+                            IS_ANNOTATED_METHOD_NOT_NULL, invokeHandleFolded, fallbackFolded), typedGetter);
                 if(nextComponent == null) {
                     return getClassGuardedInvocationComponent(compositeGetter, type);
                 }
@@ -494,13 +597,13 @@
                 // Must have exactly one argument: receiver
                 assertParameterCount(callSiteDescriptor, 1);
                 // Fixed name
-                final AnnotatedMethodHandle annGetter = propertyGetters.get(callSiteDescriptor.getNameToken(
+                final AnnotatedDynamicMethod annGetter = propertyGetters.get(callSiteDescriptor.getNameToken(
                         CallSiteDescriptor.NAME_OPERAND));
                 if(annGetter == null) {
                     // We have no such property, always delegate to the next component operation
                     return getGuardedInvocationComponent(callSiteDescriptor, linkerServices, ops);
                 }
-                final MethodHandle getter = annGetter.handle;
+                final MethodHandle getter = annGetter.getInvocation(callSiteDescriptor, linkerServices);
                 // NOTE: since property getters (not field getters!) are no-arg, we don't have to worry about them being
                 // overloaded in a subclass. Therefore, we can discover the most abstract superclass that has the
                 // method, and use that as the guard with Guards.isInstance() for a more stably linked call site. If
@@ -508,6 +611,7 @@
                 // NOTE: No delegation to the next component operation if we have a property with this name, even if its
                 // value is null.
                 final ValidationType validationType = annGetter.validationType;
+                // TODO: we aren't using the type that declares the most generic getter here!
                 return new GuardedInvocationComponent(linkerServices.asType(getter, type), getGuard(validationType,
                         type), clazz, validationType);
             }
@@ -623,14 +727,15 @@
     // args are dropped; this makes handles with first three args conform to "Object, String, Object" though, which is
     // a typical property setter with variable name signature (target, name, value).
     private static final MethodHandle GET_PROPERTY_SETTER_HANDLE = MethodHandles.dropArguments(MethodHandles.dropArguments(
-            privateLookup.findOwnSpecial("getPropertySetterHandle", MethodHandle.class, MethodType.class,
+            privateLookup.findOwnSpecial("getPropertySetterHandle", MethodHandle.class, CallSiteDescriptor.class,
                     LinkerServices.class, Object.class), 3, Object.class), 5, Object.class);
     // Type is MethodHandle(MethodType, LinkerServices, Object, String, Object)
     private final MethodHandle getPropertySetterHandle = GET_PROPERTY_SETTER_HANDLE.bindTo(this);
 
     @SuppressWarnings("unused")
-    private MethodHandle getPropertySetterHandle(MethodType setterType, LinkerServices linkerServices, Object id) {
-        return getDynamicMethodInvocation(setterType, linkerServices, String.valueOf(id), propertySetters);
+    private MethodHandle getPropertySetterHandle(CallSiteDescriptor setterDescriptor, LinkerServices linkerServices,
+            Object id) {
+        return getDynamicMethodInvocation(setterDescriptor, linkerServices, String.valueOf(id), propertySetters);
     }
 
     private static MethodHandle GET_DYNAMIC_METHOD = MethodHandles.dropArguments(privateLookup.findOwnSpecial(
@@ -689,13 +794,24 @@
         return null;
     }
 
-    private static final class AnnotatedMethodHandle {
-        final MethodHandle handle;
+    private static final class AnnotatedDynamicMethod {
+        private final SingleDynamicMethod method;
         /*private*/ final ValidationType validationType;
 
-        AnnotatedMethodHandle(MethodHandle handle, ValidationType validationType) {
-            this.handle = handle;
+        AnnotatedDynamicMethod(SingleDynamicMethod method, ValidationType validationType) {
+            this.method = method;
             this.validationType = validationType;
         }
+
+        MethodHandle getInvocation(CallSiteDescriptor callSiteDescriptor, LinkerServices linkerServices) {
+            return method.getInvocation(callSiteDescriptor, linkerServices);
+        }
+
+        @SuppressWarnings("unused")
+        MethodHandle getTarget(MethodHandles.Lookup lookup) {
+            MethodHandle inv = method.getTarget(lookup);
+            assert inv != null;
+            return inv;
+        }
     }
 }
--- a/nashorn/src/jdk/internal/dynalink/beans/ApplicableOverloadedMethods.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/ApplicableOverloadedMethods.java	Fri Jul 26 14:07:32 2013 -0700
@@ -83,7 +83,6 @@
 
 package jdk.internal.dynalink.beans;
 
-import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodType;
 import java.util.LinkedList;
 import java.util.List;
@@ -95,7 +94,7 @@
  * @author Attila Szegedi
  */
 class ApplicableOverloadedMethods {
-    private final List<MethodHandle> methods;
+    private final List<SingleDynamicMethod> methods;
     private final boolean varArgs;
 
     /**
@@ -106,10 +105,10 @@
      * @param test applicability test. One of {@link #APPLICABLE_BY_SUBTYPING},
      * {@link #APPLICABLE_BY_METHOD_INVOCATION_CONVERSION}, or {@link #APPLICABLE_BY_VARIABLE_ARITY}.
      */
-    ApplicableOverloadedMethods(final List<MethodHandle> methods, final MethodType callSiteType,
+    ApplicableOverloadedMethods(final List<SingleDynamicMethod> methods, final MethodType callSiteType,
             final ApplicabilityTest test) {
         this.methods = new LinkedList<>();
-        for(MethodHandle m: methods) {
+        for(SingleDynamicMethod m: methods) {
             if(test.isApplicable(callSiteType, m)) {
                 this.methods.add(m);
             }
@@ -122,7 +121,7 @@
      *
      * @return list of all methods.
      */
-    List<MethodHandle> getMethods() {
+    List<SingleDynamicMethod> getMethods() {
         return methods;
     }
 
@@ -131,12 +130,12 @@
      *
      * @return a list of maximally specific methods.
      */
-    List<MethodHandle> findMaximallySpecificMethods() {
+    List<SingleDynamicMethod> findMaximallySpecificMethods() {
         return MaximallySpecific.getMaximallySpecificMethods(methods, varArgs);
     }
 
     abstract static class ApplicabilityTest {
-        abstract boolean isApplicable(MethodType callSiteType, MethodHandle method);
+        abstract boolean isApplicable(MethodType callSiteType, SingleDynamicMethod method);
     }
 
     /**
@@ -144,8 +143,8 @@
      */
     static final ApplicabilityTest APPLICABLE_BY_SUBTYPING = new ApplicabilityTest() {
         @Override
-        boolean isApplicable(MethodType callSiteType, MethodHandle method) {
-            final MethodType methodType = method.type();
+        boolean isApplicable(MethodType callSiteType, SingleDynamicMethod method) {
+            final MethodType methodType = method.getMethodType();
             final int methodArity = methodType.parameterCount();
             if(methodArity != callSiteType.parameterCount()) {
                 return false;
@@ -166,8 +165,8 @@
      */
     static final ApplicabilityTest APPLICABLE_BY_METHOD_INVOCATION_CONVERSION = new ApplicabilityTest() {
         @Override
-        boolean isApplicable(MethodType callSiteType, MethodHandle method) {
-            final MethodType methodType = method.type();
+        boolean isApplicable(MethodType callSiteType, SingleDynamicMethod method) {
+            final MethodType methodType = method.getMethodType();
             final int methodArity = methodType.parameterCount();
             if(methodArity != callSiteType.parameterCount()) {
                 return false;
@@ -189,11 +188,11 @@
      */
     static final ApplicabilityTest APPLICABLE_BY_VARIABLE_ARITY = new ApplicabilityTest() {
         @Override
-        boolean isApplicable(MethodType callSiteType, MethodHandle method) {
-            if(!method.isVarargsCollector()) {
+        boolean isApplicable(MethodType callSiteType, SingleDynamicMethod method) {
+            if(!method.isVarArgs()) {
                 return false;
             }
-            final MethodType methodType = method.type();
+            final MethodType methodType = method.getMethodType();
             final int methodArity = methodType.parameterCount();
             final int fixArity = methodArity - 1;
             final int callSiteArity = callSiteType.parameterCount();
--- a/nashorn/src/jdk/internal/dynalink/beans/BeansLinker.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/BeansLinker.java	Fri Jul 26 14:07:32 2013 -0700
@@ -84,6 +84,8 @@
 package jdk.internal.dynalink.beans;
 
 import java.lang.invoke.MethodHandles;
+import java.util.Collection;
+import java.util.Collections;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.DynamicLinkerFactory;
 import jdk.internal.dynalink.linker.GuardedInvocation;
@@ -166,6 +168,72 @@
         return obj instanceof DynamicMethod;
     }
 
+    /**
+     * Returns a collection of names of all readable instance properties of a class.
+     * @param clazz the class
+     * @return a collection of names of all readable instance properties of a class.
+     */
+    public static Collection<String> getReadableInstancePropertyNames(Class<?> clazz) {
+        TypeBasedGuardingDynamicLinker linker = getLinkerForClass(clazz);
+        if(linker instanceof BeanLinker) {
+            return ((BeanLinker)linker).getReadablePropertyNames();
+        }
+        return Collections.emptySet();
+    }
+
+    /**
+     * Returns a collection of names of all writable instance properties of a class.
+     * @param clazz the class
+     * @return a collection of names of all writable instance properties of a class.
+     */
+    public static Collection<String> getWritableInstancePropertyNames(Class<?> clazz) {
+        TypeBasedGuardingDynamicLinker linker = getLinkerForClass(clazz);
+        if(linker instanceof BeanLinker) {
+            return ((BeanLinker)linker).getWritablePropertyNames();
+        }
+        return Collections.emptySet();
+    }
+
+    /**
+     * Returns a collection of names of all instance methods of a class.
+     * @param clazz the class
+     * @return a collection of names of all instance methods of a class.
+     */
+    public static Collection<String> getInstanceMethodNames(Class<?> clazz) {
+        TypeBasedGuardingDynamicLinker linker = getLinkerForClass(clazz);
+        if(linker instanceof BeanLinker) {
+            return ((BeanLinker)linker).getMethodNames();
+        }
+        return Collections.emptySet();
+    }
+
+    /**
+     * Returns a collection of names of all readable static properties of a class.
+     * @param clazz the class
+     * @return a collection of names of all readable static properties of a class.
+     */
+    public static Collection<String> getReadableStaticPropertyNames(Class<?> clazz) {
+        return StaticClassLinker.getReadableStaticPropertyNames(clazz);
+    }
+
+    /**
+     * Returns a collection of names of all writable static properties of a class.
+     * @param clazz the class
+     * @return a collection of names of all writable static properties of a class.
+     */
+    public static Collection<String> getWritableStaticPropertyNames(Class<?> clazz) {
+        return StaticClassLinker.getWritableStaticPropertyNames(clazz);
+    }
+
+    /**
+     * Returns a collection of names of all static methods of a class.
+     * @param clazz the class
+     * @return a collection of names of all static methods of a class.
+     */
+    public static Collection<String> getStaticMethodNames(Class<?> clazz) {
+        return StaticClassLinker.getStaticMethodNames(clazz);
+    }
+
     @Override
     public GuardedInvocation getGuardedInvocation(LinkRequest request, final LinkerServices linkerServices)
             throws Exception {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/internal/dynalink/beans/CallerSensitiveDetector.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file, and Oracle licenses the original version of this file under the BSD
+ * license:
+ */
+/*
+   Copyright 2009-2013 Attila Szegedi
+
+   Licensed under both the Apache License, Version 2.0 (the "Apache License")
+   and the BSD License (the "BSD License"), with licensee being free to
+   choose either of the two at their discretion.
+
+   You may not use this file except in compliance with either the Apache
+   License or the BSD License.
+
+   If you choose to use this file in compliance with the Apache License, the
+   following notice applies to you:
+
+       You may obtain a copy of the Apache License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+       implied. See the License for the specific language governing
+       permissions and limitations under the License.
+
+   If you choose to use this file in compliance with the BSD License, the
+   following notice applies to you:
+
+       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 the copyright holder nor the names of
+         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 COPYRIGHT HOLDER
+       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.
+*/
+
+package jdk.internal.dynalink.beans;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AccessibleObject;
+import sun.reflect.CallerSensitive;
+
+/**
+ * Utility class that determines if a method or constructor is caller sensitive. It actually encapsulates two different
+ * strategies for determining caller sensitivity; a more robust one that works if Dynalink runs as code with access
+ * to {@code sun.reflect} package, and an unprivileged one that is used when Dynalink doesn't have access to that
+ * package. Note that even the unprivileged strategy is ordinarily robust, but it relies on the {@code toString} method
+ * of the annotation. If an attacker were to use a different annotation to spoof the string representation of the
+ * {@code CallerSensitive} annotation, they could designate their own methods as caller sensitive. This however does not
+ * escalate privileges, only causes Dynalink to never cache method handles for such methods, so all it would do would
+ * decrease the performance in linking such methods. In the opposite case when an attacker could trick Dynalink into not
+ * recognizing genuine {@code CallerSensitive} annotations, Dynalink would treat caller sensitive methods as ordinary
+ * methods, and would cache them bound to a zero-privilege delegate as the caller (just what Dynalink did before it
+ * could handle caller-sensitive methods). That would practically render caller-sensitive methods exposed through
+ * Dynalink unusable, but again, can not lead to any privilege escalations. Therefore, even the less robust unprivileged
+ * strategy is safe; the worst thing a successful attack against it can achieve is slight reduction in Dynalink-exposed
+ * functionality or performance.
+ */
+public class CallerSensitiveDetector {
+
+    private static final DetectionStrategy DETECTION_STRATEGY = getDetectionStrategy();
+
+    static boolean isCallerSensitive(AccessibleObject ao) {
+        return DETECTION_STRATEGY.isCallerSensitive(ao);
+    }
+
+    private static DetectionStrategy getDetectionStrategy() {
+        try {
+            return new PrivilegedDetectionStrategy();
+        } catch(Throwable t) {
+            return new UnprivilegedDetectionStrategy();
+        }
+    }
+
+    private abstract static class DetectionStrategy {
+        abstract boolean isCallerSensitive(AccessibleObject ao);
+    }
+
+    private static class PrivilegedDetectionStrategy extends DetectionStrategy {
+        private static final Class<? extends Annotation> CALLER_SENSITIVE_ANNOTATION_CLASS = CallerSensitive.class;
+
+        @Override
+        boolean isCallerSensitive(AccessibleObject ao) {
+            return ao.getAnnotation(CALLER_SENSITIVE_ANNOTATION_CLASS) != null;
+        }
+    }
+
+    private static class UnprivilegedDetectionStrategy extends DetectionStrategy {
+        private static final String CALLER_SENSITIVE_ANNOTATION_STRING = "@sun.reflect.CallerSensitive()";
+
+        @Override
+        boolean isCallerSensitive(AccessibleObject o) {
+            for(Annotation a: o.getAnnotations()) {
+                if(String.valueOf(a).equals(CALLER_SENSITIVE_ANNOTATION_STRING)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/internal/dynalink/beans/CallerSensitiveDynamicMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file, and Oracle licenses the original version of this file under the BSD
+ * license:
+ */
+/*
+   Copyright 2009-2013 Attila Szegedi
+
+   Licensed under both the Apache License, Version 2.0 (the "Apache License")
+   and the BSD License (the "BSD License"), with licensee being free to
+   choose either of the two at their discretion.
+
+   You may not use this file except in compliance with either the Apache
+   License or the BSD License.
+
+   If you choose to use this file in compliance with the Apache License, the
+   following notice applies to you:
+
+       You may obtain a copy of the Apache License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+       implied. See the License for the specific language governing
+       permissions and limitations under the License.
+
+   If you choose to use this file in compliance with the BSD License, the
+   following notice applies to you:
+
+       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 the copyright holder nor the names of
+         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 COPYRIGHT HOLDER
+       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.
+*/
+
+package jdk.internal.dynalink.beans;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import jdk.internal.dynalink.support.Lookup;
+
+/**
+ * A dynamic method bound to exactly one Java method or constructor that is caller sensitive. Since the target method is
+ * caller sensitive, it doesn't cache a method handle but rather uses the passed lookup object in
+ * {@link #getTarget(java.lang.invoke.MethodHandles.Lookup)} to unreflect a method handle from the reflective member on
+ * every request.
+ *
+ * @author Attila Szegedi
+ */
+class CallerSensitiveDynamicMethod extends SingleDynamicMethod {
+    // Typed as "AccessibleObject" as it can be either a method or a constructor.
+    // If we were Java8-only, we could use java.lang.reflect.Executable
+    private final AccessibleObject target;
+    private final MethodType type;
+
+    public CallerSensitiveDynamicMethod(AccessibleObject target) {
+        super(getName(target));
+        this.target = target;
+        this.type = getMethodType(target);
+    }
+
+    private static String getName(AccessibleObject target) {
+        final Member m = (Member)target;
+        return getMethodNameWithSignature(getMethodType(target), getClassAndMethodName(m.getDeclaringClass(),
+                m.getName()));
+    }
+
+    @Override
+    MethodType getMethodType() {
+        return type;
+    }
+
+    private static MethodType getMethodType(AccessibleObject ao) {
+        final boolean isMethod = ao instanceof Method;
+        final Class<?> rtype = isMethod ? ((Method)ao).getReturnType() : ((Constructor<?>)ao).getDeclaringClass();
+        final Class<?>[] ptypes = isMethod ? ((Method)ao).getParameterTypes() : ((Constructor<?>)ao).getParameterTypes();
+        final MethodType type = MethodType.methodType(rtype, ptypes);
+        final Member m = (Member)ao;
+        return type.insertParameterTypes(0,
+                isMethod ?
+                        Modifier.isStatic(m.getModifiers()) ?
+                                Object.class :
+                                m.getDeclaringClass() :
+                        StaticClass.class);
+    }
+
+    @Override
+    boolean isVarArgs() {
+        return target instanceof Method ? ((Method)target).isVarArgs() : ((Constructor<?>)target).isVarArgs();
+    }
+
+    @Override
+    MethodHandle getTarget(MethodHandles.Lookup lookup) {
+        if(target instanceof Method) {
+            final MethodHandle mh = Lookup.unreflect(lookup, (Method)target);
+            if(Modifier.isStatic(((Member)target).getModifiers())) {
+                return StaticClassIntrospector.editStaticMethodHandle(mh);
+            }
+            return mh;
+        }
+        return StaticClassIntrospector.editConstructorMethodHandle(Lookup.unreflectConstructor(lookup,
+                (Constructor<?>)target));
+    }
+}
--- a/nashorn/src/jdk/internal/dynalink/beans/ClassString.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/ClassString.java	Fri Jul 26 14:07:32 2013 -0700
@@ -155,8 +155,8 @@
     }
 
     List<MethodHandle> getMaximallySpecifics(List<MethodHandle> methods, LinkerServices linkerServices, boolean varArg) {
-        return MaximallySpecific.getMaximallySpecificMethods(getApplicables(methods, linkerServices, varArg), varArg,
-                classes, linkerServices);
+        return MaximallySpecific.getMaximallySpecificMethodHandles(getApplicables(methods, linkerServices, varArg),
+                varArg, classes, linkerServices);
     }
 
     /**
--- a/nashorn/src/jdk/internal/dynalink/beans/DynamicMethod.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/DynamicMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -84,8 +84,7 @@
 package jdk.internal.dynalink.beans;
 
 import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodType;
-import java.util.StringTokenizer;
+import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.LinkerServices;
 
 /**
@@ -116,45 +115,28 @@
      * is a variable arguments (vararg) method, it will pack the extra arguments in an array before the invocation of
      * the underlying method if it is not already done.
      *
-     * @param callSiteType the method type at a call site
+     * @param callSiteDescriptor the descriptor of the call site
      * @param linkerServices linker services. Used for language-specific type conversions.
      * @return an invocation suitable for calling the method from the specified call site.
      */
-    abstract MethodHandle getInvocation(MethodType callSiteType, LinkerServices linkerServices);
+    abstract MethodHandle getInvocation(CallSiteDescriptor callSiteDescriptor, LinkerServices linkerServices);
 
     /**
-     * Returns a simple dynamic method representing a single underlying Java method (possibly selected among several
+     * Returns a single dynamic method representing a single underlying Java method (possibly selected among several
      * overloads) with formal parameter types exactly matching the passed signature.
      * @param paramTypes the comma-separated list of requested parameter type names. The names will match both
      * qualified and unqualified type names.
-     * @return a simple dynamic method representing a single underlying Java method, or null if none of the Java methods
+     * @return a single dynamic method representing a single underlying Java method, or null if none of the Java methods
      * behind this dynamic method exactly match the requested parameter types.
      */
-    abstract SimpleDynamicMethod getMethodForExactParamTypes(String paramTypes);
+    abstract SingleDynamicMethod getMethodForExactParamTypes(String paramTypes);
 
     /**
-     * True if this dynamic method already contains a method handle with an identical signature as the passed in method
-     * handle.
-     * @param mh the method handle to check
-     * @return true if it already contains an equivalent method handle.
+     * True if this dynamic method already contains a method with an identical signature as the passed in method.
+     * @param method the method to check
+     * @return true if it already contains an equivalent method.
      */
-    abstract boolean contains(MethodHandle mh);
-
-    static boolean typeMatchesDescription(String paramTypes, MethodType type) {
-        final StringTokenizer tok = new StringTokenizer(paramTypes, ", ");
-        for(int i = 1; i < type.parameterCount(); ++i) { // i = 1 as we ignore the receiver
-            if(!(tok.hasMoreTokens() && typeNameMatches(tok.nextToken(), type.parameterType(i)))) {
-                return false;
-            }
-        }
-        return !tok.hasMoreTokens();
-    }
-
-    private static boolean typeNameMatches(String typeName, Class<?> type) {
-        final int lastDot = typeName.lastIndexOf('.');
-        final String fullTypeName = type.getCanonicalName();
-        return lastDot != -1 && fullTypeName.endsWith(typeName.substring(lastDot)) || typeName.equals(fullTypeName);
-    }
+    abstract boolean contains(SingleDynamicMethod method);
 
     static String getClassAndMethodName(Class<?> clazz, String name) {
         final String clazzName = clazz.getCanonicalName();
--- a/nashorn/src/jdk/internal/dynalink/beans/DynamicMethodLinker.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/DynamicMethodLinker.java	Fri Jul 26 14:07:32 2013 -0700
@@ -85,12 +85,12 @@
 
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.linker.LinkerServices;
 import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
+import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
 import jdk.internal.dynalink.support.Guards;
 
 /**
@@ -110,19 +110,18 @@
             return null;
         }
         final CallSiteDescriptor desc = linkRequest.getCallSiteDescriptor();
-        if(desc.getNameTokenCount() != 2 && desc.getNameToken(CallSiteDescriptor.SCHEME) != "dyn")  {
+        if(desc.getNameTokenCount() != 2 && desc.getNameToken(CallSiteDescriptor.SCHEME) != "dyn") {
             return null;
         }
         final String operator = desc.getNameToken(CallSiteDescriptor.OPERATOR);
         if(operator == "call") {
-            final MethodType type = desc.getMethodType();
-            final MethodHandle invocation = ((DynamicMethod)receiver).getInvocation(type.dropParameterTypes(0, 1),
-                    linkerServices);
+            final MethodHandle invocation = ((DynamicMethod)receiver).getInvocation(
+                    CallSiteDescriptorFactory.dropParameterTypes(desc, 0, 1), linkerServices);
             if(invocation == null) {
                 return null;
             }
-            return new GuardedInvocation(MethodHandles.dropArguments(invocation, 0, type.parameterType(0)),
-                    Guards.getIdentityGuard(receiver));
+            return new GuardedInvocation(MethodHandles.dropArguments(invocation, 0,
+                    desc.getMethodType().parameterType(0)), Guards.getIdentityGuard(receiver));
         }
         return null;
     }
--- a/nashorn/src/jdk/internal/dynalink/beans/FacetIntrospector.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/FacetIntrospector.java	Fri Jul 26 14:07:32 2013 -0700
@@ -167,10 +167,6 @@
         return editMethodHandle(SafeUnreflector.unreflectSetter(field));
     }
 
-    MethodHandle unreflect(Method method) {
-        return editMethodHandle(SafeUnreflector.unreflect(method));
-    }
-
     /**
      * Returns an edited method handle. A facet might need to edit an unreflected method handle before it is usable with
      * the facet. By default, returns the passed method handle unchanged. The class' static facet will introduce a
--- a/nashorn/src/jdk/internal/dynalink/beans/MaximallySpecific.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/MaximallySpecific.java	Fri Jul 26 14:07:32 2013 -0700
@@ -105,10 +105,58 @@
      * @param varArgs whether to assume the methods are varargs
      * @return the list of maximally specific methods.
      */
-    static List<MethodHandle> getMaximallySpecificMethods(List<MethodHandle> methods, boolean varArgs) {
-        return getMaximallySpecificMethods(methods, varArgs, null, null);
+    static List<SingleDynamicMethod> getMaximallySpecificMethods(List<SingleDynamicMethod> methods, boolean varArgs) {
+        return getMaximallySpecificSingleDynamicMethods(methods, varArgs, null, null);
+    }
+
+    private abstract static class MethodTypeGetter<T> {
+        abstract MethodType getMethodType(T t);
     }
 
+    private static final MethodTypeGetter<MethodHandle> METHOD_HANDLE_TYPE_GETTER =
+            new MethodTypeGetter<MethodHandle>() {
+        @Override
+        MethodType getMethodType(MethodHandle t) {
+            return t.type();
+        }
+    };
+
+    private static final MethodTypeGetter<SingleDynamicMethod> DYNAMIC_METHOD_TYPE_GETTER =
+            new MethodTypeGetter<SingleDynamicMethod>() {
+        @Override
+        MethodType getMethodType(SingleDynamicMethod t) {
+            return t.getMethodType();
+        }
+    };
+
+     /**
+      * Given a list of methods handles, returns a list of maximally specific methods, applying language-runtime
+      * specific conversion preferences.
+      *
+      * @param methods the list of method handles
+      * @param varArgs whether to assume the method handles are varargs
+      * @param argTypes concrete argument types for the invocation
+      * @return the list of maximally specific method handles.
+      */
+     static List<MethodHandle> getMaximallySpecificMethodHandles(List<MethodHandle> methods, boolean varArgs,
+             Class<?>[] argTypes, LinkerServices ls) {
+         return getMaximallySpecificMethods(methods, varArgs, argTypes, ls, METHOD_HANDLE_TYPE_GETTER);
+     }
+
+     /**
+      * Given a list of methods, returns a list of maximally specific methods, applying language-runtime specific
+      * conversion preferences.
+      *
+      * @param methods the list of methods
+      * @param varArgs whether to assume the methods are varargs
+      * @param argTypes concrete argument types for the invocation
+      * @return the list of maximally specific methods.
+      */
+     static List<SingleDynamicMethod> getMaximallySpecificSingleDynamicMethods(List<SingleDynamicMethod> methods,
+             boolean varArgs, Class<?>[] argTypes, LinkerServices ls) {
+         return getMaximallySpecificMethods(methods, varArgs, argTypes, ls, DYNAMIC_METHOD_TYPE_GETTER);
+     }
+
     /**
      * Given a list of methods, returns a list of maximally specific methods, applying language-runtime specific
      * conversion preferences.
@@ -118,18 +166,18 @@
      * @param argTypes concrete argument types for the invocation
      * @return the list of maximally specific methods.
      */
-    static List<MethodHandle> getMaximallySpecificMethods(List<MethodHandle> methods, boolean varArgs,
-            Class<?>[] argTypes, LinkerServices ls) {
+    private static <T> List<T> getMaximallySpecificMethods(List<T> methods, boolean varArgs,
+            Class<?>[] argTypes, LinkerServices ls, MethodTypeGetter<T> methodTypeGetter) {
         if(methods.size() < 2) {
             return methods;
         }
-        final LinkedList<MethodHandle> maximals = new LinkedList<>();
-        for(MethodHandle m: methods) {
-            final MethodType methodType = m.type();
+        final LinkedList<T> maximals = new LinkedList<>();
+        for(T m: methods) {
+            final MethodType methodType = methodTypeGetter.getMethodType(m);
             boolean lessSpecific = false;
-            for(Iterator<MethodHandle> maximal = maximals.iterator(); maximal.hasNext();) {
-                final MethodHandle max = maximal.next();
-                switch(isMoreSpecific(methodType, max.type(), varArgs, argTypes, ls)) {
+            for(Iterator<T> maximal = maximals.iterator(); maximal.hasNext();) {
+                final T max = maximal.next();
+                switch(isMoreSpecific(methodType, methodTypeGetter.getMethodType(max), varArgs, argTypes, ls)) {
                     case TYPE_1_BETTER: {
                         maximal.remove();
                         break;
--- a/nashorn/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -84,16 +84,21 @@
 package jdk.internal.dynalink.beans;
 
 import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.beans.ApplicableOverloadedMethods.ApplicabilityTest;
 import jdk.internal.dynalink.linker.LinkerServices;
 import jdk.internal.dynalink.support.TypeUtilities;
 
 /**
- * Represents an overloaded method.
+ * Represents a group of {@link SingleDynamicMethod} objects that represents all overloads of a particular name (or all
+ * constructors) for a particular class. Correctly handles overload resolution, variable arity methods, and caller
+ * sensitive methods within the overloads.
  *
  * @author Attila Szegedi
  */
@@ -101,7 +106,7 @@
     /**
      * Holds a list of all methods.
      */
-    private final LinkedList<MethodHandle> methods;
+    private final LinkedList<SingleDynamicMethod> methods;
     private final ClassLoader classLoader;
 
     /**
@@ -111,21 +116,22 @@
      * @param name the name of the method
      */
     OverloadedDynamicMethod(Class<?> clazz, String name) {
-        this(new LinkedList<MethodHandle>(), clazz.getClassLoader(), getClassAndMethodName(clazz, name));
+        this(new LinkedList<SingleDynamicMethod>(), clazz.getClassLoader(), getClassAndMethodName(clazz, name));
     }
 
-    private OverloadedDynamicMethod(LinkedList<MethodHandle> methods, ClassLoader classLoader, String name) {
+    private OverloadedDynamicMethod(LinkedList<SingleDynamicMethod> methods, ClassLoader classLoader, String name) {
         super(name);
         this.methods = methods;
         this.classLoader = classLoader;
     }
 
     @Override
-    SimpleDynamicMethod getMethodForExactParamTypes(String paramTypes) {
-        final LinkedList<MethodHandle> matchingMethods = new LinkedList<>();
-        for(MethodHandle method: methods) {
-            if(typeMatchesDescription(paramTypes, method.type())) {
-                matchingMethods.add(method);
+    SingleDynamicMethod getMethodForExactParamTypes(String paramTypes) {
+        final LinkedList<SingleDynamicMethod> matchingMethods = new LinkedList<>();
+        for(SingleDynamicMethod method: methods) {
+            final SingleDynamicMethod matchingMethod = method.getMethodForExactParamTypes(paramTypes);
+            if(matchingMethod != null) {
+                matchingMethods.add(matchingMethod);
             }
         }
         switch(matchingMethods.size()) {
@@ -133,8 +139,7 @@
                 return null;
             }
             case 1: {
-                final MethodHandle target = matchingMethods.get(0);
-                return new SimpleDynamicMethod(target, SimpleDynamicMethod.getMethodNameWithSignature(target, getName()));
+                return matchingMethods.getFirst();
             }
             default: {
                 throw new BootstrapMethodError("Can't choose among " + matchingMethods + " for argument types "
@@ -144,7 +149,8 @@
     }
 
     @Override
-    public MethodHandle getInvocation(final MethodType callSiteType, final LinkerServices linkerServices) {
+    public MethodHandle getInvocation(final CallSiteDescriptor callSiteDescriptor, final LinkerServices linkerServices) {
+        final MethodType callSiteType = callSiteDescriptor.getMethodType();
         // First, find all methods applicable to the call site by subtyping (JLS 15.12.2.2)
         final ApplicableOverloadedMethods subtypingApplicables = getApplicables(callSiteType,
                 ApplicableOverloadedMethods.APPLICABLE_BY_SUBTYPING);
@@ -156,7 +162,7 @@
                 ApplicableOverloadedMethods.APPLICABLE_BY_VARIABLE_ARITY);
 
         // Find the methods that are maximally specific based on the call site signature
-        List<MethodHandle> maximallySpecifics = subtypingApplicables.findMaximallySpecificMethods();
+        List<SingleDynamicMethod> maximallySpecifics = subtypingApplicables.findMaximallySpecificMethods();
         if(maximallySpecifics.isEmpty()) {
             maximallySpecifics = methodInvocationApplicables.findMaximallySpecificMethods();
             if(maximallySpecifics.isEmpty()) {
@@ -171,12 +177,12 @@
         // (Object, Object), and we have a method whose parameter types are (String, int). None of the JLS applicability
         // rules will trigger, but we must consider the method, as it can be the right match for a concrete invocation.
         @SuppressWarnings({ "unchecked", "rawtypes" })
-        final List<MethodHandle> invokables = (List)methods.clone();
+        final List<SingleDynamicMethod> invokables = (List)methods.clone();
         invokables.removeAll(subtypingApplicables.getMethods());
         invokables.removeAll(methodInvocationApplicables.getMethods());
         invokables.removeAll(variableArityApplicables.getMethods());
-        for(final Iterator<MethodHandle> it = invokables.iterator(); it.hasNext();) {
-            final MethodHandle m = it.next();
+        for(final Iterator<SingleDynamicMethod> it = invokables.iterator(); it.hasNext();) {
+            final SingleDynamicMethod m = it.next();
             if(!isApplicableDynamically(linkerServices, callSiteType, m)) {
                 it.remove();
             }
@@ -199,54 +205,45 @@
             }
             case 1: {
                 // Very lucky, we ended up with a single candidate method handle based on the call site signature; we
-                // can link it very simply by delegating to a SimpleDynamicMethod.
-                final MethodHandle mh = invokables.iterator().next();
-                return new SimpleDynamicMethod(mh).getInvocation(callSiteType, linkerServices);
+                // can link it very simply by delegating to the SingleDynamicMethod.
+                invokables.iterator().next().getInvocation(callSiteDescriptor, linkerServices);
             }
             default: {
                 // We have more than one candidate. We have no choice but to link to a method that resolves overloads on
                 // every invocation (alternatively, we could opportunistically link the one method that resolves for the
                 // current arguments, but we'd need to install a fairly complex guard for that and when it'd fail, we'd
-                // go back all the way to candidate selection.
-                // TODO: cache per call site type
-                return new OverloadedMethod(invokables, this, callSiteType, linkerServices).getInvoker();
+                // go back all the way to candidate selection. Note that we're resolving any potential caller sensitive
+                // methods here to their handles, as the OverloadedMethod instance is specific to a call site, so it
+                // has an already determined Lookup.
+                final List<MethodHandle> methodHandles = new ArrayList<>(invokables.size());
+                final MethodHandles.Lookup lookup = callSiteDescriptor.getLookup();
+                for(SingleDynamicMethod method: invokables) {
+                    methodHandles.add(method.getTarget(lookup));
+                }
+                return new OverloadedMethod(methodHandles, this, callSiteType, linkerServices).getInvoker();
             }
         }
 
     }
 
     @Override
-    public boolean contains(MethodHandle mh) {
-        final MethodType type = mh.type();
-        for(MethodHandle method: methods) {
-            if(typesEqualNoReceiver(type, method.type())) {
+    public boolean contains(SingleDynamicMethod m) {
+        for(SingleDynamicMethod method: methods) {
+            if(method.contains(m)) {
                 return true;
             }
         }
         return false;
     }
 
-    private static boolean typesEqualNoReceiver(MethodType type1, MethodType type2) {
-        final int pc = type1.parameterCount();
-        if(pc != type2.parameterCount()) {
-            return false;
-        }
-        for(int i = 1; i < pc; ++i) { // i = 1: ignore receiver
-            if(type1.parameterType(i) != type2.parameterType(i)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
     ClassLoader getClassLoader() {
         return classLoader;
     }
 
     private static boolean isApplicableDynamically(LinkerServices linkerServices, MethodType callSiteType,
-            MethodHandle m) {
-        final MethodType methodType = m.type();
-        final boolean varArgs = m.isVarargsCollector();
+            SingleDynamicMethod m) {
+        final MethodType methodType = m.getMethodType();
+        final boolean varArgs = m.isVarArgs();
         final int fixedArgLen = methodType.parameterCount() - (varArgs ? 1 : 0);
         final int callSiteArgLen = callSiteType.parameterCount();
 
@@ -301,20 +298,11 @@
     }
 
     /**
-     * Add a method identified by a {@link SimpleDynamicMethod} to this overloaded method's set.
-     *
-     * @param method the method to add.
-     */
-    void addMethod(SimpleDynamicMethod method) {
-        addMethod(method.getTarget());
-    }
-
-    /**
      * Add a method to this overloaded method's set.
      *
      * @param method a method to add
      */
-    public void addMethod(MethodHandle method) {
+    public void addMethod(SingleDynamicMethod method) {
         methods.add(method);
     }
 }
--- a/nashorn/src/jdk/internal/dynalink/beans/OverloadedMethod.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/OverloadedMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -135,7 +135,7 @@
         varArgMethods.trimToSize();
 
         final MethodHandle bound = SELECT_METHOD.bindTo(this);
-        final MethodHandle collecting = SimpleDynamicMethod.collectArguments(bound, argNum).asType(
+        final MethodHandle collecting = SingleDynamicMethod.collectArguments(bound, argNum).asType(
                 callSiteType.changeReturnType(MethodHandle.class));
         invoker = MethodHandles.foldArguments(MethodHandles.exactInvoker(callSiteType), collecting);
     }
@@ -167,7 +167,7 @@
                     break;
                 }
                 case 1: {
-                    method = new SimpleDynamicMethod(methods.get(0)).getInvocation(callSiteType, linkerServices);
+                    method = SingleDynamicMethod.getInvocation(methods.get(0), callSiteType, linkerServices);
                     break;
                 }
                 default: {
--- a/nashorn/src/jdk/internal/dynalink/beans/SimpleDynamicMethod.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/SimpleDynamicMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -84,29 +84,22 @@
 package jdk.internal.dynalink.beans;
 
 import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
 import java.lang.invoke.MethodType;
-import java.lang.reflect.Array;
-import jdk.internal.dynalink.linker.LinkerServices;
-import jdk.internal.dynalink.support.Guards;
 
 /**
- * A dynamic method bound to exactly one, non-overloaded Java method. Handles varargs.
+ * A dynamic method bound to exactly one Java method or constructor that is not caller sensitive. Since its target is
+ * not caller sensitive, this class pre-caches its method handle and always returns it from the call to
+ * {@link #getTarget(Lookup)}. Can be used in general to represents dynamic methods bound to a single method handle,
+ * even if that handle is not mapped to a Java method, i.e. as a wrapper around field getters/setters, array element
+ * getters/setters, etc.
  *
  * @author Attila Szegedi
  */
-class SimpleDynamicMethod extends DynamicMethod {
+class SimpleDynamicMethod extends SingleDynamicMethod {
     private final MethodHandle target;
 
     /**
-     * Creates a simple dynamic method with no name.
-     * @param target the target method handle
-     */
-    SimpleDynamicMethod(MethodHandle target) {
-        this(target, null);
-    }
-
-    /**
      * Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle
      * signature.
      *
@@ -115,125 +108,26 @@
      * @param name the simple name of the method
      */
     SimpleDynamicMethod(MethodHandle target, Class<?> clazz, String name) {
-        this(target, getName(target, clazz, name));
-    }
-
-    SimpleDynamicMethod(MethodHandle target, String name) {
-        super(name);
+        super(getName(target, clazz, name));
         this.target = target;
     }
 
     private static String getName(MethodHandle target, Class<?> clazz, String name) {
-        return getMethodNameWithSignature(target, getClassAndMethodName(clazz, name));
-    }
-
-    static String getMethodNameWithSignature(MethodHandle target, String methodName) {
-        final String typeStr = target.type().toString();
-        final int retTypeIndex = typeStr.lastIndexOf(')') + 1;
-        int secondParamIndex = typeStr.indexOf(',') + 1;
-        if(secondParamIndex == 0) {
-            secondParamIndex = retTypeIndex - 1;
-        }
-        return typeStr.substring(retTypeIndex) + " " + methodName + "(" + typeStr.substring(secondParamIndex, retTypeIndex);
-    }
-
-    /**
-     * Returns the target of this dynamic method
-     *
-     * @return the target of this dynamic method
-     */
-    MethodHandle getTarget() {
-        return target;
+        return getMethodNameWithSignature(target.type(), getClassAndMethodName(clazz, name));
     }
 
     @Override
-    SimpleDynamicMethod getMethodForExactParamTypes(String paramTypes) {
-        return typeMatchesDescription(paramTypes, target.type()) ? this : null;
+    boolean isVarArgs() {
+        return target.isVarargsCollector();
     }
 
     @Override
-    MethodHandle getInvocation(MethodType callSiteType, LinkerServices linkerServices) {
-        final MethodType methodType = target.type();
-        final int paramsLen = methodType.parameterCount();
-        final boolean varArgs = target.isVarargsCollector();
-        final MethodHandle fixTarget = varArgs ? target.asFixedArity() : target;
-        final int fixParamsLen = varArgs ? paramsLen - 1 : paramsLen;
-        final int argsLen = callSiteType.parameterCount();
-        if(argsLen < fixParamsLen) {
-            // Less actual arguments than number of fixed declared arguments; can't invoke.
-            return null;
-        }
-        // Method handle has the same number of fixed arguments as the call site type
-        if(argsLen == fixParamsLen) {
-            // Method handle that matches the number of actual arguments as the number of fixed arguments
-            final MethodHandle matchedMethod;
-            if(varArgs) {
-                // If vararg, add a zero-length array of the expected type as the last argument to signify no variable
-                // arguments.
-                matchedMethod = MethodHandles.insertArguments(fixTarget, fixParamsLen, Array.newInstance(
-                        methodType.parameterType(fixParamsLen).getComponentType(), 0));
-            } else {
-                // Otherwise, just use the method
-                matchedMethod = fixTarget;
-            }
-            return createConvertingInvocation(matchedMethod, linkerServices, callSiteType);
-        }
-
-        // What's below only works for varargs
-        if(!varArgs) {
-            return null;
-        }
-
-        final Class<?> varArgType = methodType.parameterType(fixParamsLen);
-        // Handle a somewhat sinister corner case: caller passes exactly one argument in the vararg position, and we
-        // must handle both a prepacked vararg array as well as a genuine 1-long vararg sequence.
-        if(argsLen == paramsLen) {
-            final Class<?> callSiteLastArgType = callSiteType.parameterType(fixParamsLen);
-            if(varArgType.isAssignableFrom(callSiteLastArgType)) {
-                // Call site signature guarantees we'll always be passed a single compatible array; just link directly
-                // to the method.
-                return createConvertingInvocation(fixTarget, linkerServices, callSiteType);
-            }
-            if(!linkerServices.canConvert(callSiteLastArgType, varArgType)) {
-                // Call site signature guarantees the argument can definitely not be an array (i.e. it is primitive);
-                // link immediately to a vararg-packing method handle.
-                return createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType);
-            }
-            // Call site signature makes no guarantees that the single argument in the vararg position will be
-            // compatible across all invocations. Need to insert an appropriate guard and fall back to generic vararg
-            // method when it is not.
-            return MethodHandles.guardWithTest(Guards.isInstance(varArgType, fixParamsLen, callSiteType),
-                    createConvertingInvocation(fixTarget, linkerServices, callSiteType),
-                    createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType));
-        }
-
-        // Remaining case: more than one vararg.
-        return createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType);
+    MethodType getMethodType() {
+        return target.type();
     }
 
     @Override
-    public boolean contains(MethodHandle mh) {
-        return target.type().parameterList().equals(mh.type().parameterList());
-    }
-
-    /**
-     * Creates a method handle out of the original target that will collect the varargs for the exact component type of
-     * the varArg array. Note that this will nicely trigger language-specific type converters for exactly those varargs
-     * for which it is necessary when later passed to linkerServices.convertArguments().
-     *
-     * @param target the original method handle
-     * @param parameterCount the total number of arguments in the new method handle
-     * @return a collecting method handle
-     */
-    static MethodHandle collectArguments(MethodHandle target, final int parameterCount) {
-        final MethodType methodType = target.type();
-        final int fixParamsLen = methodType.parameterCount() - 1;
-        final Class<?> arrayType = methodType.parameterType(fixParamsLen);
-        return target.asCollector(arrayType, parameterCount - fixParamsLen);
-    }
-
-    private static MethodHandle createConvertingInvocation(final MethodHandle sizedMethod,
-            final LinkerServices linkerServices, final MethodType callSiteType) {
-        return linkerServices.asType(sizedMethod, callSiteType);
+    MethodHandle getTarget(Lookup lookup) {
+        return target;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/internal/dynalink/beans/SingleDynamicMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file, and Oracle licenses the original version of this file under the BSD
+ * license:
+ */
+/*
+   Copyright 2009-2013 Attila Szegedi
+
+   Licensed under both the Apache License, Version 2.0 (the "Apache License")
+   and the BSD License (the "BSD License"), with licensee being free to
+   choose either of the two at their discretion.
+
+   You may not use this file except in compliance with either the Apache
+   License or the BSD License.
+
+   If you choose to use this file in compliance with the Apache License, the
+   following notice applies to you:
+
+       You may obtain a copy of the Apache License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing, software
+       distributed under the License is distributed on an "AS IS" BASIS,
+       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+       implied. See the License for the specific language governing
+       permissions and limitations under the License.
+
+   If you choose to use this file in compliance with the BSD License, the
+   following notice applies to you:
+
+       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 the copyright holder nor the names of
+         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 COPYRIGHT HOLDER
+       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.
+*/
+
+package jdk.internal.dynalink.beans;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Array;
+import java.util.StringTokenizer;
+import jdk.internal.dynalink.CallSiteDescriptor;
+import jdk.internal.dynalink.linker.LinkerServices;
+import jdk.internal.dynalink.support.Guards;
+
+/**
+ * Base class for dynamic methods that dispatch to a single target Java method or constructor. Handles adaptation of the
+ * target method to a call site type (including mapping variable arity methods to a call site signature with different
+ * arity).
+ * @author Attila Szegedi
+ * @version $Id: $
+ */
+abstract class SingleDynamicMethod extends DynamicMethod {
+    SingleDynamicMethod(String name) {
+        super(name);
+    }
+
+    /**
+     * Returns true if this method is variable arity.
+     * @return true if this method is variable arity.
+     */
+    abstract boolean isVarArgs();
+
+    /**
+     * Returns this method's native type.
+     * @return this method's native type.
+     */
+    abstract MethodType getMethodType();
+
+    /**
+     * Given a specified lookup, returns a method handle to this method's target.
+     * @param lookup the lookup to use.
+     * @return the handle to this method's target method.
+     */
+    abstract MethodHandle getTarget(MethodHandles.Lookup lookup);
+
+    @Override
+    MethodHandle getInvocation(CallSiteDescriptor callSiteDescriptor, LinkerServices linkerServices) {
+        return getInvocation(getTarget(callSiteDescriptor.getLookup()), callSiteDescriptor.getMethodType(),
+                linkerServices);
+    }
+
+    @Override
+    SingleDynamicMethod getMethodForExactParamTypes(String paramTypes) {
+        return typeMatchesDescription(paramTypes, getMethodType()) ? this : null;
+    }
+
+    @Override
+    boolean contains(SingleDynamicMethod method) {
+        return getMethodType().parameterList().equals(method.getMethodType().parameterList());
+    }
+
+    static String getMethodNameWithSignature(MethodType type, String methodName) {
+        final String typeStr = type.toString();
+        final int retTypeIndex = typeStr.lastIndexOf(')') + 1;
+        int secondParamIndex = typeStr.indexOf(',') + 1;
+        if(secondParamIndex == 0) {
+            secondParamIndex = retTypeIndex - 1;
+        }
+        return typeStr.substring(retTypeIndex) + " " + methodName + "(" + typeStr.substring(secondParamIndex, retTypeIndex);
+    }
+
+    /**
+     * Given a method handle and a call site type, adapts the method handle to the call site type. Performs type
+     * conversions as needed using the specified linker services, and in case that the method handle is a vararg
+     * collector, matches it to the arity of the call site.
+     * @param target the method handle to adapt
+     * @param callSiteType the type of the call site
+     * @param linkerServices the linker services used for type conversions
+     * @return the adapted method handle.
+     */
+    static MethodHandle getInvocation(MethodHandle target, MethodType callSiteType, LinkerServices linkerServices) {
+        final MethodType methodType = target.type();
+        final int paramsLen = methodType.parameterCount();
+        final boolean varArgs = target.isVarargsCollector();
+        final MethodHandle fixTarget = varArgs ? target.asFixedArity() : target;
+        final int fixParamsLen = varArgs ? paramsLen - 1 : paramsLen;
+        final int argsLen = callSiteType.parameterCount();
+        if(argsLen < fixParamsLen) {
+            // Less actual arguments than number of fixed declared arguments; can't invoke.
+            return null;
+        }
+        // Method handle has the same number of fixed arguments as the call site type
+        if(argsLen == fixParamsLen) {
+            // Method handle that matches the number of actual arguments as the number of fixed arguments
+            final MethodHandle matchedMethod;
+            if(varArgs) {
+                // If vararg, add a zero-length array of the expected type as the last argument to signify no variable
+                // arguments.
+                matchedMethod = MethodHandles.insertArguments(fixTarget, fixParamsLen, Array.newInstance(
+                        methodType.parameterType(fixParamsLen).getComponentType(), 0));
+            } else {
+                // Otherwise, just use the method
+                matchedMethod = fixTarget;
+            }
+            return createConvertingInvocation(matchedMethod, linkerServices, callSiteType);
+        }
+
+        // What's below only works for varargs
+        if(!varArgs) {
+            return null;
+        }
+
+        final Class<?> varArgType = methodType.parameterType(fixParamsLen);
+        // Handle a somewhat sinister corner case: caller passes exactly one argument in the vararg position, and we
+        // must handle both a prepacked vararg array as well as a genuine 1-long vararg sequence.
+        if(argsLen == paramsLen) {
+            final Class<?> callSiteLastArgType = callSiteType.parameterType(fixParamsLen);
+            if(varArgType.isAssignableFrom(callSiteLastArgType)) {
+                // Call site signature guarantees we'll always be passed a single compatible array; just link directly
+                // to the method, introducing necessary conversions. Also, preserve it being a variable arity method.
+                return createConvertingInvocation(target, linkerServices, callSiteType).asVarargsCollector(
+                        callSiteLastArgType);
+            }
+            if(!linkerServices.canConvert(callSiteLastArgType, varArgType)) {
+                // Call site signature guarantees the argument can definitely not be an array (i.e. it is primitive);
+                // link immediately to a vararg-packing method handle.
+                return createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType);
+            }
+            // Call site signature makes no guarantees that the single argument in the vararg position will be
+            // compatible across all invocations. Need to insert an appropriate guard and fall back to generic vararg
+            // method when it is not.
+            return MethodHandles.guardWithTest(Guards.isInstance(varArgType, fixParamsLen, callSiteType),
+                    createConvertingInvocation(fixTarget, linkerServices, callSiteType),
+                    createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType));
+        }
+
+        // Remaining case: more than one vararg.
+        return createConvertingInvocation(collectArguments(fixTarget, argsLen), linkerServices, callSiteType);
+    }
+
+    /**
+     * Creates a method handle out of the original target that will collect the varargs for the exact component type of
+     * the varArg array. Note that this will nicely trigger language-specific type converters for exactly those varargs
+     * for which it is necessary when later passed to linkerServices.convertArguments().
+     *
+     * @param target the original method handle
+     * @param parameterCount the total number of arguments in the new method handle
+     * @return a collecting method handle
+     */
+    static MethodHandle collectArguments(MethodHandle target, final int parameterCount) {
+        final MethodType methodType = target.type();
+        final int fixParamsLen = methodType.parameterCount() - 1;
+        final Class<?> arrayType = methodType.parameterType(fixParamsLen);
+        return target.asCollector(arrayType, parameterCount - fixParamsLen);
+    }
+
+    private static MethodHandle createConvertingInvocation(final MethodHandle sizedMethod,
+            final LinkerServices linkerServices, final MethodType callSiteType) {
+        return linkerServices.asType(sizedMethod, callSiteType);
+    }
+
+    private static boolean typeMatchesDescription(String paramTypes, MethodType type) {
+        final StringTokenizer tok = new StringTokenizer(paramTypes, ", ");
+        for(int i = 1; i < type.parameterCount(); ++i) { // i = 1 as we ignore the receiver
+            if(!(tok.hasMoreTokens() && typeNameMatches(tok.nextToken(), type.parameterType(i)))) {
+                return false;
+            }
+        }
+        return !tok.hasMoreTokens();
+    }
+
+    private static boolean typeNameMatches(String typeName, Class<?> type) {
+        return  typeName.equals(typeName.indexOf('.') == -1 ? type.getSimpleName() : type.getCanonicalName());
+    }
+}
--- a/nashorn/src/jdk/internal/dynalink/beans/StaticClassIntrospector.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/StaticClassIntrospector.java	Fri Jul 26 14:07:32 2013 -0700
@@ -106,10 +106,18 @@
 
     @Override
     MethodHandle editMethodHandle(MethodHandle mh) {
+        return editStaticMethodHandle(mh);
+    }
+
+    static MethodHandle editStaticMethodHandle(MethodHandle mh) {
         return dropReceiver(mh, Object.class);
     }
 
-    static MethodHandle dropReceiver(final MethodHandle mh, final Class<?> receiverClass) {
+    static MethodHandle editConstructorMethodHandle(MethodHandle cmh) {
+        return dropReceiver(cmh, StaticClass.class);
+    }
+
+    private static MethodHandle dropReceiver(final MethodHandle mh, final Class<?> receiverClass) {
         MethodHandle newHandle = MethodHandles.dropArguments(mh, 0, receiverClass);
         // NOTE: this is a workaround for the fact that dropArguments doesn't preserve vararg collector state.
         if(mh.isVarargsCollector() && !newHandle.isVarargsCollector()) {
--- a/nashorn/src/jdk/internal/dynalink/beans/StaticClassLinker.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/StaticClassLinker.java	Fri Jul 26 14:07:32 2013 -0700
@@ -87,13 +87,11 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Arrays;
+import java.util.Collection;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.beans.GuardedInvocationComponent.ValidationType;
 import jdk.internal.dynalink.linker.GuardedInvocation;
-import jdk.internal.dynalink.linker.GuardingDynamicLinker;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.linker.LinkerServices;
 import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
@@ -104,9 +102,9 @@
  * @author Attila Szegedi
  */
 class StaticClassLinker implements TypeBasedGuardingDynamicLinker {
-    private final ClassValue<GuardingDynamicLinker> linkers = new ClassValue<GuardingDynamicLinker>() {
+    private static final ClassValue<SingleClassStaticsLinker> linkers = new ClassValue<SingleClassStaticsLinker>() {
         @Override
-        protected GuardingDynamicLinker computeValue(Class<?> clazz) {
+        protected SingleClassStaticsLinker computeValue(Class<?> clazz) {
             return new SingleClassStaticsLinker(clazz);
         }
     };
@@ -131,20 +129,11 @@
         private static DynamicMethod createConstructorMethod(Class<?> clazz) {
             if(clazz.isArray()) {
                 final MethodHandle boundArrayCtor = ARRAY_CTOR.bindTo(clazz.getComponentType());
-                return new SimpleDynamicMethod(drop(boundArrayCtor.asType(boundArrayCtor.type().changeReturnType(
-                        clazz))), clazz, "<init>");
+                return new SimpleDynamicMethod(StaticClassIntrospector.editConstructorMethodHandle(
+                        boundArrayCtor.asType(boundArrayCtor.type().changeReturnType(clazz))), clazz, "<init>");
             }
 
-            final Constructor<?>[] ctrs = clazz.getConstructors();
-            final List<MethodHandle> mhs = new ArrayList<>(ctrs.length);
-            for(int i = 0; i < ctrs.length; ++i) {
-                mhs.add(drop(SafeUnreflector.unreflectConstructor(ctrs[i])));
-            }
-            return createDynamicMethod(mhs, clazz, "<init>");
-        }
-
-        private static MethodHandle drop(MethodHandle mh) {
-            return StaticClassIntrospector.dropReceiver(mh, StaticClass.class);
+            return createDynamicMethod(Arrays.asList(clazz.getConstructors()), clazz, "<init>");
         }
 
         @Override
@@ -161,17 +150,28 @@
             }
             final CallSiteDescriptor desc = request.getCallSiteDescriptor();
             final String op = desc.getNameToken(CallSiteDescriptor.OPERATOR);
-            final MethodType methodType = desc.getMethodType();
             if("new" == op && constructor != null) {
-                final MethodHandle ctorInvocation = constructor.getInvocation(methodType, linkerServices);
+                final MethodHandle ctorInvocation = constructor.getInvocation(desc, linkerServices);
                 if(ctorInvocation != null) {
-                    return new GuardedInvocation(ctorInvocation, getClassGuard(methodType));
+                    return new GuardedInvocation(ctorInvocation, getClassGuard(desc.getMethodType()));
                 }
             }
             return null;
         }
     }
 
+    static Collection<String> getReadableStaticPropertyNames(Class<?> clazz) {
+        return linkers.get(clazz).getReadablePropertyNames();
+    }
+
+    static Collection<String> getWritableStaticPropertyNames(Class<?> clazz) {
+        return linkers.get(clazz).getWritablePropertyNames();
+    }
+
+    static Collection<String> getStaticMethodNames(Class<?> clazz) {
+        return linkers.get(clazz).getMethodNames();
+    }
+
     @Override
     public GuardedInvocation getGuardedInvocation(LinkRequest request, LinkerServices linkerServices) throws Exception {
         final Object receiver = request.getReceiver();
--- a/nashorn/src/jdk/internal/dynalink/support/AbstractCallSiteDescriptor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/support/AbstractCallSiteDescriptor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -139,8 +139,9 @@
 
     @Override
     public int hashCode() {
+        final MethodHandles.Lookup lookup = getLookup();
+        int h = lookup.lookupClass().hashCode() + 31 * lookup.lookupModes();
         final int c = getNameTokenCount();
-        int h = 0;
         for(int i = 0; i < c; ++i) {
             h = h * 31 + getNameToken(i).hashCode();
         }
--- a/nashorn/src/jdk/internal/dynalink/support/Lookup.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/support/Lookup.java	Fri Jul 26 14:07:32 2013 -0700
@@ -122,6 +122,18 @@
      * @return the unreflected method handle.
      */
     public MethodHandle unreflect(Method m) {
+        return unreflect(lookup, m);
+    }
+
+    /**
+     * Performs a {@link java.lang.invoke.MethodHandles.Lookup#unreflect(Method)}, converting any encountered
+     * {@link IllegalAccessException} into an {@link IllegalAccessError}.
+     *
+     * @param lookup the lookup used to unreflect
+     * @param m the method to unreflect
+     * @return the unreflected method handle.
+     */
+    public static MethodHandle unreflect(MethodHandles.Lookup lookup, Method m) {
         try {
             return lookup.unreflect(m);
         } catch(IllegalAccessException e) {
@@ -131,7 +143,6 @@
         }
     }
 
-
     /**
      * Performs a {@link java.lang.invoke.MethodHandles.Lookup#unreflectGetter(Field)}, converting any encountered
      * {@link IllegalAccessException} into an {@link IllegalAccessError}.
@@ -202,6 +213,18 @@
      * @return the unreflected constructor handle.
      */
     public MethodHandle unreflectConstructor(Constructor<?> c) {
+        return unreflectConstructor(lookup, c);
+    }
+
+    /**
+     * Performs a {@link java.lang.invoke.MethodHandles.Lookup#unreflectConstructor(Constructor)}, converting any
+     * encountered {@link IllegalAccessException} into an {@link IllegalAccessError}.
+     *
+     * @param lookup the lookup used to unreflect
+     * @param c the constructor to unreflect
+     * @return the unreflected constructor handle.
+     */
+    public static MethodHandle unreflectConstructor(MethodHandles.Lookup lookup, Constructor<?> c) {
         try {
             return lookup.unreflectConstructor(c);
         } catch(IllegalAccessException e) {
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornException.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornException.java	Fri Jul 26 14:07:32 2013 -0700
@@ -146,7 +146,7 @@
      * @return array of javascript stack frames
      */
     public static StackTraceElement[] getScriptFrames(final Throwable exception) {
-        final StackTraceElement[] frames = ((Throwable)exception).getStackTrace();
+        final StackTraceElement[] frames = exception.getStackTrace();
         final List<StackTraceElement> filtered = new ArrayList<>();
         for (final StackTraceElement st : frames) {
             if (ECMAErrors.isScriptFrame(st)) {
@@ -170,7 +170,7 @@
      */
     public static String getScriptStackString(final Throwable exception) {
         final StringBuilder buf = new StringBuilder();
-        final StackTraceElement[] frames = getScriptFrames((Throwable)exception);
+        final StackTraceElement[] frames = getScriptFrames(exception);
         for (final StackTraceElement st : frames) {
             buf.append("\tat ");
             buf.append(st.getMethodName());
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Fri Jul 26 14:07:32 2013 -0700
@@ -33,6 +33,7 @@
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.net.URL;
 import java.nio.charset.Charset;
 import java.security.AccessController;
@@ -184,6 +185,19 @@
     }
 
     private <T> T getInterfaceInner(final Object self, final Class<T> clazz) {
+        if (clazz == null || !clazz.isInterface()) {
+            throw new IllegalArgumentException("interface Class expected");
+        }
+
+        // perform security access check as early as possible
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            if (! Modifier.isPublic(clazz.getModifiers())) {
+                throw new SecurityException("attempt to implement non-public interfce: " + clazz);
+            }
+            Context.checkPackageAccess(clazz.getName());
+        }
+
         final ScriptObject realSelf;
         final ScriptObject ctxtGlobal = getNashornGlobalFrom(context);
         if(self == null) {
@@ -193,6 +207,7 @@
         } else {
             realSelf = (ScriptObject)self;
         }
+
         try {
             final ScriptObject oldGlobal = getNashornGlobal();
             try {
--- a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java	Fri Jul 26 14:07:32 2013 -0700
@@ -52,11 +52,6 @@
     private final ScriptObject sobj;
     private final ScriptObject global;
 
-    ScriptObjectMirror(final ScriptObject sobj, final ScriptObject global) {
-        this.sobj = sobj;
-        this.global = global;
-    }
-
     @Override
     public boolean equals(final Object other) {
         if (other instanceof ScriptObjectMirror) {
@@ -81,25 +76,6 @@
         });
     }
 
-    private <V> V inGlobal(final Callable<V> callable) {
-        final ScriptObject oldGlobal = NashornScriptEngine.getNashornGlobal();
-        final boolean globalChanged = (oldGlobal != global);
-        if (globalChanged) {
-            NashornScriptEngine.setNashornGlobal(global);
-        }
-        try {
-            return callable.call();
-        } catch (final RuntimeException e) {
-            throw e;
-        } catch (final Exception e) {
-            throw new AssertionError("Cannot happen", e);
-        } finally {
-            if (globalChanged) {
-                NashornScriptEngine.setNashornGlobal(oldGlobal);
-            }
-        }
-    }
-
     // JSObject methods
     @Override
     public Object call(final String functionName, final Object... args) {
@@ -212,6 +188,8 @@
         });
     }
 
+    // javax.script.Bindings methods
+
     @Override
     public void clear() {
         inGlobal(new Callable<Object>() {
@@ -308,9 +286,9 @@
     public void putAll(final Map<? extends String, ? extends Object> map) {
         final ScriptObject oldGlobal = NashornScriptEngine.getNashornGlobal();
         final boolean globalChanged = (oldGlobal != global);
-        final boolean strict = sobj.isStrictContext();
         inGlobal(new Callable<Object>() {
             @Override public Object call() {
+                final boolean strict = global.isStrictContext();
                 for (final Map.Entry<? extends String, ? extends Object> entry : map.entrySet()) {
                     final Object value = entry.getValue();
                     final Object modValue = globalChanged? wrap(value, oldGlobal) : value;
@@ -379,7 +357,7 @@
     public Object getProto() {
         return inGlobal(new Callable<Object>() {
             @Override public Object call() {
-                return wrap(getScriptObject().getProto(), global);
+                return wrap(sobj.getProto(), global);
             }
         });
     }
@@ -395,7 +373,7 @@
     public Object getOwnPropertyDescriptor(final String key) {
         return inGlobal(new Callable<Object>() {
             @Override public Object call() {
-                return wrap(getScriptObject().getOwnPropertyDescriptor(key), global);
+                return wrap(sobj.getOwnPropertyDescriptor(key), global);
             }
         });
     }
@@ -409,7 +387,7 @@
     public String[] getOwnKeys(final boolean all) {
         return inGlobal(new Callable<String[]>() {
             @Override public String[] call() {
-                return getScriptObject().getOwnKeys(all);
+                return sobj.getOwnKeys(all);
             }
         });
     }
@@ -422,7 +400,7 @@
     public ScriptObjectMirror preventExtensions() {
         return inGlobal(new Callable<ScriptObjectMirror>() {
             @Override public ScriptObjectMirror call() {
-                getScriptObject().preventExtensions();
+                sobj.preventExtensions();
                 return ScriptObjectMirror.this;
             }
         });
@@ -435,7 +413,7 @@
     public boolean isExtensible() {
         return inGlobal(new Callable<Boolean>() {
             @Override public Boolean call() {
-                return getScriptObject().isExtensible();
+                return sobj.isExtensible();
             }
         });
     }
@@ -447,7 +425,7 @@
     public ScriptObjectMirror seal() {
         return inGlobal(new Callable<ScriptObjectMirror>() {
             @Override public ScriptObjectMirror call() {
-                getScriptObject().seal();
+                sobj.seal();
                 return ScriptObjectMirror.this;
             }
         });
@@ -460,7 +438,7 @@
     public boolean isSealed() {
         return inGlobal(new Callable<Boolean>() {
             @Override public Boolean call() {
-                return getScriptObject().isSealed();
+                return sobj.isSealed();
             }
         });
     }
@@ -472,7 +450,7 @@
     public ScriptObjectMirror freeze() {
         return inGlobal(new Callable<ScriptObjectMirror>() {
             @Override public ScriptObjectMirror call() {
-                getScriptObject().freeze();
+                sobj.freeze();
                 return ScriptObjectMirror.this;
             }
         });
@@ -485,7 +463,7 @@
     public boolean isFrozen() {
         return inGlobal(new Callable<Boolean>() {
             @Override public Boolean call() {
-                return getScriptObject().isFrozen();
+                return sobj.isFrozen();
             }
         });
     }
@@ -507,12 +485,39 @@
 
         return inGlobal(new Callable<Boolean>() {
             @Override public Boolean call() {
-                return getScriptObject().isInstance(instance.getScriptObject());
+                return sobj.isInstance(instance.sobj);
             }
         });
     }
 
     /**
+     * is this a function object?
+     *
+     * @return if this mirror wraps a ECMAScript function instance
+     */
+    public boolean isFunction() {
+        return sobj instanceof ScriptFunction;
+    }
+
+    /**
+     * is this a 'use strict' function object?
+     *
+     * @return true if this mirror represents a ECMAScript 'use strict' function
+     */
+    public boolean isStrictFunction() {
+        return isFunction() && ((ScriptFunction)sobj).isStrict();
+    }
+
+    /**
+     * is this an array object?
+     *
+     * @return if this mirror wraps a ECMAScript array object
+     */
+    public boolean isArray() {
+        return sobj.isArray();
+    }
+
+    /**
      * Utility to check if given object is ECMAScript undefined value
      *
      * @param obj object to check
@@ -523,35 +528,6 @@
     }
 
     /**
-     * is this a function object?
-     *
-     * @return if this mirror wraps a ECMAScript function instance
-     */
-    public boolean isFunction() {
-        return getScriptObject() instanceof ScriptFunction;
-    }
-
-    /**
-     * is this a 'use strict' function object?
-     *
-     * @return true if this mirror represents a ECMAScript 'use strict' function
-     */
-    public boolean isStrictFunction() {
-        return isFunction() && ((ScriptFunction)getScriptObject()).isStrict();
-    }
-
-    /**
-     * is this an array object?
-     *
-     * @return if this mirror wraps a ECMAScript array object
-     */
-    public boolean isArray() {
-        return getScriptObject().isArray();
-    }
-
-    // These are public only so that Context can access these.
-
-    /**
      * Make a script object mirror on given object if needed.
      *
      * @param obj object to be wrapped
@@ -621,6 +597,12 @@
     }
 
     // package-privates below this.
+
+    ScriptObjectMirror(final ScriptObject sobj, final ScriptObject global) {
+        this.sobj = sobj;
+        this.global = global;
+    }
+
     ScriptObject getScriptObject() {
         return sobj;
     }
@@ -628,4 +610,25 @@
     static Object translateUndefined(Object obj) {
         return (obj == ScriptRuntime.UNDEFINED)? null : obj;
     }
+
+    // internals only below this.
+    private <V> V inGlobal(final Callable<V> callable) {
+        final ScriptObject oldGlobal = NashornScriptEngine.getNashornGlobal();
+        final boolean globalChanged = (oldGlobal != global);
+        if (globalChanged) {
+            NashornScriptEngine.setNashornGlobal(global);
+        }
+        try {
+            return callable.call();
+        } catch (final RuntimeException e) {
+            throw e;
+        } catch (final Exception e) {
+            throw new AssertionError("Cannot happen", e);
+        } finally {
+            if (globalChanged) {
+                NashornScriptEngine.setNashornGlobal(oldGlobal);
+            }
+        }
+    }
+
 }
--- a/nashorn/src/jdk/nashorn/internal/codegen/Attr.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Attr.java	Fri Jul 26 14:07:32 2013 -0700
@@ -61,6 +61,7 @@
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.CaseNode;
 import jdk.nashorn.internal.ir.CatchNode;
+import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
@@ -72,7 +73,6 @@
 import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.ObjectNode;
-import jdk.nashorn.internal.ir.PropertyNode;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.RuntimeNode;
 import jdk.nashorn.internal.ir.RuntimeNode.Request;
@@ -94,7 +94,6 @@
 import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyMap;
-import jdk.nashorn.internal.runtime.ScriptObject;
 
 /**
  * This is the attribution pass of the code generator. Attr takes Lowered IR,
@@ -166,19 +165,19 @@
     }
 
     private void initFunctionWideVariables(final FunctionNode functionNode, final Block body) {
-        initCompileConstant(CALLEE, body, IS_PARAM | IS_INTERNAL, FunctionNode.FUNCTION_TYPE);
+        initCompileConstant(CALLEE, body, IS_PARAM | IS_INTERNAL);
         initCompileConstant(THIS, body, IS_PARAM | IS_THIS, Type.OBJECT);
 
         if (functionNode.isVarArg()) {
-            initCompileConstant(VARARGS, body, IS_PARAM | IS_INTERNAL, Type.OBJECT_ARRAY);
+            initCompileConstant(VARARGS, body, IS_PARAM | IS_INTERNAL);
             if (functionNode.needsArguments()) {
-                initCompileConstant(ARGUMENTS, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED, Type.typeFor(ScriptObject.class));
+                initCompileConstant(ARGUMENTS, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED);
                 addLocalDef(ARGUMENTS.symbolName());
             }
         }
 
         initParameters(functionNode, body);
-        initCompileConstant(SCOPE, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED, Type.typeFor(ScriptObject.class));
+        initCompileConstant(SCOPE, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED);
         initCompileConstant(RETURN, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED, Type.OBJECT);
     }
 
@@ -234,10 +233,25 @@
             @Override
             public boolean enterVarNode(final VarNode varNode) {
                 final String name = varNode.getName().getName();
-                //if this is used the var node symbol needs to be tagged as can be undefined
+                //if this is used before the var node, the var node symbol needs to be tagged as can be undefined
                 if (uses.contains(name)) {
                     canBeUndefined.add(name);
                 }
+
+                // all uses of the declared varnode inside the var node are potentially undefined
+                // however this is a bit conservative as e.g. var x = 17; var x = 1 + x; does work
+                if (!varNode.isFunctionDeclaration() && varNode.getInit() != null) {
+                    varNode.getInit().accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+                       @Override
+                       public boolean enterIdentNode(final IdentNode identNode) {
+                           if (name.equals(identNode.getName())) {
+                              canBeUndefined.add(name);
+                           }
+                           return false;
+                       }
+                    });
+                }
+
                 return true;
             }
 
@@ -257,6 +271,7 @@
                     }
                     return varNode.setName((IdentNode)ident.setSymbol(lc, symbol));
                 }
+
                 return varNode;
             }
         });
@@ -326,10 +341,11 @@
         catchNestingLevel++;
 
         // define block-local exception variable
-        final Symbol def = defineSymbol(block, exception.getName(), IS_VAR | IS_LET | IS_ALWAYS_DEFINED);
+        final String exname = exception.getName();
+        final Symbol def = defineSymbol(block, exname, IS_VAR | IS_LET | IS_ALWAYS_DEFINED);
         newType(def, Type.OBJECT); //we can catch anything, not just ecma exceptions
 
-        addLocalDef(exception.getName());
+        addLocalDef(exname);
 
         return true;
     }
@@ -496,7 +512,6 @@
             assert nameSymbol != null;
 
             selfInit = selfInit.setName((IdentNode)name.setSymbol(lc, nameSymbol));
-            selfInit = (VarNode)selfInit.setSymbol(lc, nameSymbol);
 
             newStatements.add(selfInit);
             newStatements.addAll(body.getStatements());
@@ -661,7 +676,7 @@
 
             if (scopeBlock != null) {
                 assert lc.contains(scopeBlock);
-                lc.setFlag(scopeBlock, Block.NEEDS_SCOPE);
+                lc.setBlockNeedsScope(scopeBlock);
             }
         }
     }
@@ -724,14 +739,9 @@
     }
 
     @Override
-    public Node leavePropertyNode(final PropertyNode propertyNode) {
-        // assign a pseudo symbol to property name, see NASHORN-710
-        return propertyNode.setSymbol(lc, new Symbol(propertyNode.getKeyName(), 0, Type.OBJECT));
-    }
-
-    @Override
     public Node leaveReturnNode(final ReturnNode returnNode) {
-        final Node expr = returnNode.getExpression();
+        final Expression expr = returnNode.getExpression();
+        final Type returnType;
 
         if (expr != null) {
             //we can't do parameter specialization if we return something that hasn't been typed yet
@@ -740,10 +750,12 @@
                 symbol.setType(Type.OBJECT);
             }
 
-            final Type returnType = Type.widest(returnTypes.pop(), symbol.getSymbolType());
-            returnTypes.push(returnType);
-            LOG.info("Returntype is now ", returnType);
+            returnType = Type.widest(returnTypes.pop(), symbol.getSymbolType());
+        } else {
+            returnType = Type.OBJECT; //undefined
         }
+        LOG.info("Returntype is now ", returnType);
+        returnTypes.push(returnType);
 
         end(returnNode);
 
@@ -765,7 +777,7 @@
                     final LiteralNode<?> lit = (LiteralNode<?>)test;
                     if (lit.isNumeric() && !(lit.getValue() instanceof Integer)) {
                         if (JSType.isRepresentableAsInt(lit.getNumber())) {
-                            newCaseNode = caseNode.setTest(LiteralNode.newInstance(lit, lit.getInt32()).accept(this));
+                            newCaseNode = caseNode.setTest((Expression)LiteralNode.newInstance(lit, lit.getInt32()).accept(this));
                         }
                     }
                 } else {
@@ -774,6 +786,9 @@
                 }
 
                 type = Type.widest(type, newCaseNode.getTest().getType());
+                if (type.isBoolean()) {
+                    type = Type.OBJECT; //booleans and integers aren't assignment compatible
+                }
             }
 
             newCases.add(newCaseNode);
@@ -825,19 +840,18 @@
 
     @Override
     public Node leaveVarNode(final VarNode varNode) {
-        VarNode newVarNode = varNode;
+        final Expression init  = varNode.getInit();
+        final IdentNode  ident = varNode.getName();
+        final String     name  = ident.getName();
 
-        final Node      init  = newVarNode.getInit();
-        final IdentNode ident = newVarNode.getName();
-        final String    name  = ident.getName();
-
-        final Symbol  symbol = findSymbol(lc.getCurrentBlock(), ident.getName());
+        final Symbol  symbol = findSymbol(lc.getCurrentBlock(), name);
+        assert ident.getSymbol() == symbol;
 
         if (init == null) {
             // var x; with no init will be treated like a use of x by
             // leaveIdentNode unless we remove the name from the localdef list.
             removeLocalDef(name);
-            return end(newVarNode.setSymbol(lc, symbol));
+            return end(varNode);
         }
 
         addLocalDef(name);
@@ -846,8 +860,7 @@
 
         final IdentNode newIdent = (IdentNode)ident.setSymbol(lc, symbol);
 
-        newVarNode = newVarNode.setName(newIdent);
-        newVarNode = (VarNode)newVarNode.setSymbol(lc, symbol);
+        final VarNode newVarNode = varNode.setName(newIdent);
 
         final boolean isScript = lc.getDefiningFunction(symbol).isProgram(); //see NASHORN-56
         if ((init.getType().isNumeric() || init.getType().isBoolean()) && !isScript) {
@@ -857,7 +870,7 @@
             newType(symbol, Type.OBJECT);
         }
 
-        assert newVarNode.hasType() : newVarNode + " has no type";
+        assert newVarNode.getName().hasType() : newVarNode + " has no type";
 
         return end(newVarNode);
     }
@@ -885,11 +898,11 @@
     public Node leaveDELETE(final UnaryNode unaryNode) {
         final FunctionNode   currentFunctionNode = lc.getCurrentFunction();
         final boolean        strictMode          = currentFunctionNode.isStrict();
-        final Node           rhs                 = unaryNode.rhs();
-        final Node           strictFlagNode      = LiteralNode.newInstance(unaryNode, strictMode).accept(this);
+        final Expression     rhs                 = unaryNode.rhs();
+        final Expression     strictFlagNode      = (Expression)LiteralNode.newInstance(unaryNode, strictMode).accept(this);
 
         Request request = Request.DELETE;
-        final List<Node> args = new ArrayList<>();
+        final List<Expression> args = new ArrayList<>();
 
         if (rhs instanceof IdentNode) {
             // If this is a declared variable or a function parameter, delete always fails (except for globals).
@@ -900,7 +913,7 @@
             if (failDelete && rhs.getSymbol().isThis()) {
                 return LiteralNode.newInstance(unaryNode, true).accept(this);
             }
-            final Node literalNode = LiteralNode.newInstance(unaryNode, name).accept(this);
+            final Expression literalNode = (Expression)LiteralNode.newInstance(unaryNode, name).accept(this);
 
             if (!failDelete) {
                 args.add(compilerConstant(SCOPE));
@@ -912,16 +925,17 @@
                 request = Request.FAIL_DELETE;
             }
         } else if (rhs instanceof AccessNode) {
-            final Node      base     = ((AccessNode)rhs).getBase();
-            final IdentNode property = ((AccessNode)rhs).getProperty();
+            final Expression base     = ((AccessNode)rhs).getBase();
+            final IdentNode  property = ((AccessNode)rhs).getProperty();
 
             args.add(base);
-            args.add(LiteralNode.newInstance(unaryNode, property.getName()).accept(this));
+            args.add((Expression)LiteralNode.newInstance(unaryNode, property.getName()).accept(this));
             args.add(strictFlagNode);
 
         } else if (rhs instanceof IndexNode) {
-            final Node base  = ((IndexNode)rhs).getBase();
-            final Node index = ((IndexNode)rhs).getIndex();
+            final IndexNode indexNode = (IndexNode)rhs;
+            final Expression base  = indexNode.getBase();
+            final Expression index = indexNode.getIndex();
 
             args.add(base);
             args.add(index);
@@ -976,15 +990,15 @@
 
     @Override
     public Node leaveTYPEOF(final UnaryNode unaryNode) {
-        final Node rhs = unaryNode.rhs();
+        final Expression rhs = unaryNode.rhs();
 
-        List<Node> args = new ArrayList<>();
+        List<Expression> args = new ArrayList<>();
         if (rhs instanceof IdentNode && !rhs.getSymbol().isParam() && !rhs.getSymbol().isVar()) {
             args.add(compilerConstant(SCOPE));
-            args.add(LiteralNode.newInstance(rhs, ((IdentNode)rhs).getName()).accept(this)); //null
+            args.add((Expression)LiteralNode.newInstance(rhs, ((IdentNode)rhs).getName()).accept(this)); //null
         } else {
             args.add(rhs);
-            args.add(LiteralNode.newInstance(unaryNode).accept(this)); //null, do not reuse token of identifier rhs, it can be e.g. 'this'
+            args.add((Expression)LiteralNode.newInstance(unaryNode).accept(this)); //null, do not reuse token of identifier rhs, it can be e.g. 'this'
         }
 
         RuntimeNode runtimeNode = new RuntimeNode(unaryNode, Request.TYPEOF, args);
@@ -1009,10 +1023,7 @@
 
     @Override
     public Node leaveVOID(final UnaryNode unaryNode) {
-        final RuntimeNode runtimeNode = (RuntimeNode)new RuntimeNode(unaryNode, Request.VOID).accept(this);
-        assert runtimeNode.getSymbol().getSymbolType().isObject();
-        end(unaryNode);
-        return runtimeNode;
+        return end(ensureSymbol(Type.OBJECT, unaryNode));
     }
 
     /**
@@ -1021,8 +1032,8 @@
      */
     @Override
     public Node leaveADD(final BinaryNode binaryNode) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         ensureTypeNotUnknown(lhs);
         ensureTypeNotUnknown(rhs);
@@ -1077,8 +1088,8 @@
     private Node leaveAssignmentNode(final BinaryNode binaryNode) {
         BinaryNode newBinaryNode = binaryNode;
 
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
         final Type type;
 
         if (rhs.getType().isNumeric()) {
@@ -1114,8 +1125,8 @@
 
     @Override
     public Node leaveASSIGN_ADD(final BinaryNode binaryNode) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         final Type widest = Type.widest(lhs.getType(), rhs.getType());
         //Type.NUMBER if we can't prove that the add doesn't overflow. todo
@@ -1394,19 +1405,26 @@
 
     @Override
     public Node leaveTernaryNode(final TernaryNode ternaryNode) {
-        final Node lhs  = ternaryNode.rhs();
-        final Node rhs  = ternaryNode.third();
+        final Expression trueExpr  = ternaryNode.getTrueExpression();
+        final Expression falseExpr = ternaryNode.getFalseExpression();
+
+        ensureTypeNotUnknown(trueExpr);
+        ensureTypeNotUnknown(falseExpr);
 
-        ensureTypeNotUnknown(lhs);
-        ensureTypeNotUnknown(rhs);
+        final Type type = Type.widest(trueExpr.getType(), falseExpr.getType());
+        return end(ensureSymbol(type, ternaryNode));
+    }
 
-        final Type type = Type.widest(lhs.getType(), rhs.getType());
-        return end(ensureSymbol(type, ternaryNode));
+    private void initCompileConstant(final CompilerConstants cc, final Block block, final int flags) {
+        final Class<?> type = cc.type();
+        // Must not call this method for constants with no explicit types; use the one with (..., Type) signature instead.
+        assert type != null;
+        initCompileConstant(cc, block, flags, Type.typeFor(type));
     }
 
     private void initCompileConstant(final CompilerConstants cc, final Block block, final int flags, final Type type) {
         final Symbol symbol = defineSymbol(block, cc.symbolName(), flags);
-        newType(symbol, type);
+        symbol.setTypeOverride(type);
         symbol.setNeedsSlot(true);
     }
 
@@ -1511,7 +1529,7 @@
         }
     }
 
-    private static void ensureTypeNotUnknown(final Node node) {
+    private static void ensureTypeNotUnknown(final Expression node) {
 
         final Symbol symbol = node.getSymbol();
 
@@ -1568,13 +1586,13 @@
      *
      * @param assignmentDest the destination node of the assignment, e.g. lhs for binary nodes
      */
-    private Node ensureAssignmentSlots(final Node assignmentDest) {
+    private Expression ensureAssignmentSlots(final Expression assignmentDest) {
         final LexicalContext attrLexicalContext = lc;
-        return assignmentDest.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
+        return (Expression)assignmentDest.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
             @Override
             public Node leaveIndexNode(final IndexNode indexNode) {
                 assert indexNode.getSymbol().isTemp();
-                final Node index = indexNode.getIndex();
+                final Expression index = indexNode.getIndex();
                 //only temps can be set as needing slots. the others will self resolve
                 //it is illegal to take a scope var and force it to be a slot, that breaks
                 Symbol indexSymbol = index.getSymbol();
@@ -1616,7 +1634,7 @@
             changed.clear();
             final FunctionNode newFunctionNode = (FunctionNode)currentFunctionNode.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
 
-                private Node widen(final Node node, final Type to) {
+                private Expression widen(final Expression node, final Type to) {
                     if (node instanceof LiteralNode) {
                         return node;
                     }
@@ -1628,7 +1646,7 @@
                             symbol = temporarySymbols.getTypedTemporarySymbol(to);
                         }
                         newType(symbol, to);
-                        final Node newNode = node.setSymbol(lc, symbol);
+                        final Expression newNode = node.setSymbol(lc, symbol);
                         changed.add(newNode);
                         return newNode;
                     }
@@ -1683,7 +1701,7 @@
 
     private Node leaveSelfModifyingAssignmentNode(final BinaryNode binaryNode, final Type destType) {
         //e.g. for -=, Number, no wider, destType (binaryNode.getWidestOperationType())  is the coerce type
-        final Node lhs = binaryNode.lhs();
+        final Expression lhs = binaryNode.lhs();
 
         newType(lhs.getSymbol(), destType); //may not narrow if dest is already wider than destType
 //        ensureSymbol(destType, binaryNode); //for OP= nodes, the node can carry a narrower types than its lhs rhs. This is perfectly fine
@@ -1691,9 +1709,9 @@
         return end(ensureSymbol(destType, ensureAssignmentSlots(binaryNode)));
     }
 
-    private Node ensureSymbol(final Type type, final Node node) {
+    private Expression ensureSymbol(final Type type, final Expression expr) {
         LOG.info("New TEMPORARY added to ", lc.getCurrentFunction().getName(), " type=", type);
-        return temporarySymbols.ensureSymbol(lc, type, node);
+        return temporarySymbols.ensureSymbol(lc, type, expr);
     }
 
     private Symbol newInternal(final String name, final Type type) {
@@ -1815,11 +1833,11 @@
         return true;
     }
 
-    private Node end(final Node node) {
+    private <T extends Node> T end(final T node) {
         return end(node, true);
     }
 
-    private Node end(final Node node, final boolean printNode) {
+    private <T extends Node> T end(final T node, final boolean printNode) {
         if(node instanceof Statement) {
             // If we're done with a statement, all temporaries can be reused.
             temporarySymbols.reuse();
@@ -1834,10 +1852,13 @@
                 append(" in '").
                 append(lc.getCurrentFunction().getName());
 
-            if (node.getSymbol() == null) {
-                sb.append(" <NO SYMBOL>");
-            } else {
-                sb.append(" <symbol=").append(node.getSymbol()).append('>');
+            if(node instanceof Expression) {
+                final Symbol symbol = ((Expression)node).getSymbol();
+                if (symbol == null) {
+                    sb.append(" <NO SYMBOL>");
+                } else {
+                    sb.append(" <symbol=").append(symbol).append('>');
+                }
             }
 
             LOG.unindent();
--- a/nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/BranchOptimizer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,7 +34,7 @@
 
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.BinaryNode;
-import jdk.nashorn.internal.ir.Node;
+import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.TernaryNode;
 import jdk.nashorn.internal.ir.UnaryNode;
 
@@ -52,16 +52,16 @@
         this.method  = method;
     }
 
-    void execute(final Node node, final Label label, final boolean state) {
+    void execute(final Expression node, final Label label, final boolean state) {
         branchOptimizer(node, label, state);
     }
 
-    private void load(final Node node) {
+    private void load(final Expression node) {
         codegen.load(node);
     }
 
     private void branchOptimizer(final UnaryNode unaryNode, final Label label, final boolean state) {
-        final Node rhs = unaryNode.rhs();
+        final Expression rhs = unaryNode.rhs();
 
         switch (unaryNode.tokenType()) {
         case NOT:
@@ -88,8 +88,8 @@
     }
 
     private void branchOptimizer(final BinaryNode binaryNode, final Label label, final boolean state) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         switch (binaryNode.tokenType()) {
         case AND:
@@ -173,7 +173,7 @@
         }
     }
 
-    private void branchOptimizer(final Node node, final Label label, final boolean state) {
+    private void branchOptimizer(final Expression node, final Label label, final boolean state) {
         if (!(node instanceof TernaryNode)) {
 
             if (node instanceof BinaryNode) {
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -55,10 +55,12 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.EnumSet;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
+import java.util.Set;
 import java.util.TreeMap;
 import jdk.nashorn.internal.codegen.ClassEmitter.Flag;
 import jdk.nashorn.internal.codegen.CompilerConstants.Call;
@@ -69,6 +71,7 @@
 import jdk.nashorn.internal.ir.BaseNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.BlockStatement;
 import jdk.nashorn.internal.ir.BreakNode;
 import jdk.nashorn.internal.ir.BreakableNode;
 import jdk.nashorn.internal.ir.CallNode;
@@ -76,7 +79,8 @@
 import jdk.nashorn.internal.ir.CatchNode;
 import jdk.nashorn.internal.ir.ContinueNode;
 import jdk.nashorn.internal.ir.EmptyNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.Expression;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
@@ -109,6 +113,8 @@
 import jdk.nashorn.internal.ir.debug.ASTWriter;
 import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+import jdk.nashorn.internal.objects.Global;
+import jdk.nashorn.internal.objects.ScriptFunctionImpl;
 import jdk.nashorn.internal.parser.Lexer.RegexToken;
 import jdk.nashorn.internal.parser.TokenType;
 import jdk.nashorn.internal.runtime.Context;
@@ -148,11 +154,9 @@
  */
 final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContext> {
 
-    /** Name of the Global object, cannot be referred to as .class, @see CodeGenerator */
-    private static final String GLOBAL_OBJECT = Compiler.OBJECTS_PACKAGE + '/' + "Global";
-
-    /** Name of the ScriptFunctionImpl, cannot be referred to as .class @see FunctionObjectCreator */
-    private static final String SCRIPTFUNCTION_IMPL_OBJECT = Compiler.OBJECTS_PACKAGE + '/' + "ScriptFunctionImpl";
+    private static final String GLOBAL_OBJECT = Type.getInternalName(Global.class);
+
+    private static final String SCRIPTFUNCTION_IMPL_OBJECT = Type.getInternalName(ScriptFunctionImpl.class);
 
     /** Constant data & installation. The only reason the compiler keeps this is because it is assigned
      *  by reflection in class installation */
@@ -179,6 +183,10 @@
 
     private static final DebugLogger LOG   = new DebugLogger("codegen", "nashorn.codegen.debug");
 
+    /** From what size should we use spill instead of fields for JavaScript objects? */
+    private static final int OBJECT_SPILL_THRESHOLD = 300;
+
+    private final Set<String> emittedMethods = new HashSet<>();
 
     /**
      * Constructor.
@@ -348,11 +356,11 @@
      *
      * @return the method emitter used
      */
-    MethodEmitter load(final Node node) {
+    MethodEmitter load(final Expression node) {
         return load(node, false);
     }
 
-    private MethodEmitter load(final Node node, final boolean baseAlreadyOnStack) {
+    private MethodEmitter load(final Expression node, final boolean baseAlreadyOnStack) {
         final Symbol symbol = node.getSymbol();
 
         // If we lack symbols, we just generate what we see.
@@ -486,6 +494,9 @@
 
     @Override
     public boolean enterBlock(final Block block) {
+        if(lc.isFunctionBody() && emittedMethods.contains(lc.getCurrentFunction().getName())) {
+            return false;
+        }
         method.label(block.getEntryLabel());
         initLocals(block);
 
@@ -537,11 +548,11 @@
         return false;
     }
 
-    private int loadArgs(final List<Node> args) {
+    private int loadArgs(final List<Expression> args) {
         return loadArgs(args, null, false, args.size());
     }
 
-    private int loadArgs(final List<Node> args, final String signature, final boolean isVarArg, final int argCount) {
+    private int loadArgs(final List<Expression> args, final String signature, final boolean isVarArg, final int argCount) {
         // arg have already been converted to objects here.
         if (isVarArg || argCount > LinkerCallSite.ARGLIMIT) {
             loadArgsArray(args);
@@ -551,7 +562,7 @@
         // pad with undefined if size is too short. argCount is the real number of args
         int n = 0;
         final Type[] params = signature == null ? null : Type.getMethodArguments(signature);
-        for (final Node arg : args) {
+        for (final Expression arg : args) {
             assert arg != null;
             load(arg);
             if (n >= argCount) {
@@ -572,12 +583,13 @@
 
     @Override
     public boolean enterCallNode(final CallNode callNode) {
-        lineNumber(callNode);
-
-        final List<Node>   args            = callNode.getArgs();
-        final Node         function        = callNode.getFunction();
-        final Block        currentBlock    = lc.getCurrentBlock();
+        lineNumber(callNode.getLineNumber());
+
+        final List<Expression> args = callNode.getArgs();
+        final Expression function = callNode.getFunction();
+        final Block currentBlock = lc.getCurrentBlock();
         final CodeGeneratorLexicalContext codegenLexicalContext = lc;
+        final Type callNodeType = callNode.getType();
 
         function.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
 
@@ -593,7 +605,7 @@
                 }
                 loadArgs(args);
                 final Type[] paramTypes = method.getTypesFromStack(args.size());
-                final SharedScopeCall scopeCall = codegenLexicalContext.getScopeCall(unit, symbol, identNode.getType(), callNode.getType(), paramTypes, scopeCallFlags);
+                final SharedScopeCall scopeCall = codegenLexicalContext.getScopeCall(unit, symbol, identNode.getType(), callNodeType, paramTypes, scopeCallFlags);
                 return scopeCall.generateInvoke(method);
             }
 
@@ -602,7 +614,7 @@
                 method.convert(Type.OBJECT); // foo() makes no sense if foo == 3
                 // ScriptFunction will see CALLSITE_SCOPE and will bind scope accordingly.
                 method.loadNull(); //the 'this'
-                method.dynamicCall(callNode.getType(), 2 + loadArgs(args), flags);
+                method.dynamicCall(callNodeType, 2 + loadArgs(args), flags);
             }
 
             private void evalCall(final IdentNode node, final int flags) {
@@ -634,14 +646,14 @@
 
                 // direct call to Global.directEval
                 globalDirectEval();
-                method.convert(callNode.getType());
+                method.convert(callNodeType);
                 method._goto(eval_done);
 
                 method.label(not_eval);
                 // This is some scope 'eval' or global eval replaced by user
                 // but not the built-in ECMAScript 'eval' function call
                 method.loadNull();
-                method.dynamicCall(callNode.getType(), 2 + loadArgs(args), flags);
+                method.dynamicCall(callNodeType, 2 + loadArgs(args), flags);
 
                 method.label(eval_done);
             }
@@ -666,7 +678,7 @@
                     } else {
                         sharedScopeCall(node, flags);
                     }
-                    assert method.peekType().equals(callNode.getType()) : method.peekType() + "!=" + callNode.getType();
+                    assert method.peekType().equals(callNodeType) : method.peekType() + "!=" + callNode.getType();
                 } else {
                     enterDefault(node);
                 }
@@ -681,8 +693,8 @@
                 method.dup();
                 method.dynamicGet(node.getType(), node.getProperty().getName(), getCallSiteFlags(), true);
                 method.swap();
-                method.dynamicCall(callNode.getType(), 2 + loadArgs(args), getCallSiteFlags());
-                assert method.peekType().equals(callNode.getType());
+                method.dynamicCall(callNodeType, 2 + loadArgs(args), getCallSiteFlags());
+                assert method.peekType().equals(callNodeType);
 
                 return false;
             }
@@ -707,6 +719,7 @@
                 assert callee.getCompileUnit() != null : "no compile unit for " + callee.getName() + " " + Debug.id(callee) + " " + callNode;
                 method.invokestatic(callee.getCompileUnit().getUnitClassName(), callee.getName(), signature);
                 assert method.peekType().equals(callee.getReturnType()) : method.peekType() + " != " + callee.getReturnType();
+                method.convert(callNodeType);
                 return false;
             }
 
@@ -722,7 +735,7 @@
                 }
                 method.dynamicGetIndex(node.getType(), getCallSiteFlags(), true);
                 method.swap();
-                method.dynamicCall(callNode.getType(), 2 + loadArgs(args), getCallSiteFlags());
+                method.dynamicCall(callNodeType, 2 + loadArgs(args), getCallSiteFlags());
                 assert method.peekType().equals(callNode.getType());
 
                 return false;
@@ -734,7 +747,7 @@
                 load(function);
                 method.convert(Type.OBJECT); //TODO, e.g. booleans can be used as functions
                 method.loadNull(); // ScriptFunction will figure out the correct this when it sees CALLSITE_SCOPE
-                method.dynamicCall(callNode.getType(), 2 + loadArgs(args), getCallSiteFlags() | CALLSITE_SCOPE);
+                method.dynamicCall(callNodeType, 2 + loadArgs(args), getCallSiteFlags() | CALLSITE_SCOPE);
                 assert method.peekType().equals(callNode.getType());
 
                 return false;
@@ -767,11 +780,19 @@
     }
 
     @Override
-    public boolean enterExecuteNode(final ExecuteNode executeNode) {
-        lineNumber(executeNode);
-
-        final Node expression = executeNode.getExpression();
-        expression.accept(this);
+    public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
+        lineNumber(expressionStatement);
+
+        expressionStatement.getExpression().accept(this);
+
+        return false;
+    }
+
+    @Override
+    public boolean enterBlockStatement(final BlockStatement blockStatement) {
+        lineNumber(blockStatement);
+
+        blockStatement.getBlock().accept(this);
 
         return false;
     }
@@ -790,10 +811,10 @@
     }
 
     private void enterFor(final ForNode forNode) {
-        final Node  init   = forNode.getInit();
-        final Node  test   = forNode.getTest();
-        final Block body   = forNode.getBody();
-        final Node  modify = forNode.getModify();
+        final Expression init   = forNode.getInit();
+        final Expression test   = forNode.getTest();
+        final Block      body   = forNode.getBody();
+        final Expression modify = forNode.getModify();
 
         if (init != null) {
             init.accept(this);
@@ -823,19 +844,13 @@
 
     private void enterForIn(final ForNode forNode) {
         final Block body   = forNode.getBody();
-        final Node  modify = forNode.getModify();
+        final Expression  modify = forNode.getModify();
 
         final Symbol iter      = forNode.getIterator();
         final Label  loopLabel = new Label("loop");
 
-        Node init = forNode.getInit();
-
-        // We have to evaluate the optional initializer expression
-        // of the iterator variable of the for-in statement.
-        if (init instanceof VarNode) {
-            init.accept(this);
-            init = ((VarNode)init).getName();
-        }
+        final Expression init = forNode.getInit();
+        assert init instanceof IdentNode;
 
         load(modify);
         assert modify.getType().isObject();
@@ -844,7 +859,7 @@
         method._goto(forNode.getContinueLabel());
         method.label(loopLabel);
 
-        new Store<Node>(init) {
+        new Store<Expression>(init) {
             @Override
             protected void storeNonDiscard() {
                 return;
@@ -877,9 +892,15 @@
 
         final FunctionNode function = lc.getCurrentFunction();
         if (isFunctionBody) {
-            /* Fix the predefined slots so they have numbers >= 0, like varargs. */
-            if (function.needsParentScope()) {
-                initParentScope();
+            if(method.hasScope()) {
+                if (function.needsParentScope()) {
+                    method.loadCompilerConstant(CALLEE);
+                    method.invoke(ScriptFunction.GET_SCOPE);
+                } else {
+                    assert function.hasScopeBlock();
+                    method.loadNull();
+                }
+                method.storeCompilerConstant(SCOPE);
             }
             if (function.needsArguments()) {
                 initArguments(function);
@@ -940,22 +961,12 @@
              * Create a new object based on the symbols and values, generate
              * bootstrap code for object
              */
-            final FieldObjectCreator<Symbol> foc = new FieldObjectCreator<Symbol>(this, nameList, newSymbols, values, true, hasArguments) {
+            new FieldObjectCreator<Symbol>(this, nameList, newSymbols, values, true, hasArguments) {
                 @Override
                 protected void loadValue(final Symbol value) {
                     method.load(value);
                 }
-
-                @Override
-                protected void loadScope(MethodEmitter m) {
-                    if (function.needsParentScope()) {
-                        m.loadCompilerConstant(SCOPE);
-                    } else {
-                        m.loadNull();
-                    }
-                }
-            };
-            foc.makeObject(method);
+            }.makeObject(method);
 
             // runScript(): merge scope into global
             if (isFunctionBody && function.isProgram()) {
@@ -995,12 +1006,6 @@
         method.storeCompilerConstant(ARGUMENTS);
     }
 
-    private void initParentScope() {
-        method.loadCompilerConstant(CALLEE);
-        method.invoke(ScriptFunction.GET_SCOPE);
-        method.storeCompilerConstant(SCOPE);
-    }
-
     @Override
     public boolean enterFunctionNode(final FunctionNode functionNode) {
         if (functionNode.isLazy()) {
@@ -1009,17 +1014,28 @@
             return false;
         }
 
-        LOG.info("=== BEGIN ", functionNode.getName());
-
-        assert functionNode.getCompileUnit() != null : "no compile unit for " + functionNode.getName() + " " + Debug.id(functionNode);
-        unit = lc.pushCompileUnit(functionNode.getCompileUnit());
-        assert lc.hasCompileUnits();
-
-        method = lc.pushMethodEmitter(unit.getClassEmitter().method(functionNode));
-        // new method - reset last line number
-        lastLineNumber = -1;
-        // Mark end for variable tables.
-        method.begin();
+        final String fnName = functionNode.getName();
+        // NOTE: we only emit the method for a function with the given name once. We can have multiple functions with
+        // the same name as a result of inlining finally blocks. However, in the future -- with type specialization,
+        // notably -- we might need to check for both name *and* signature. Of course, even that might not be
+        // sufficient; the function might have a code dependency on the type of the variables in its enclosing scopes,
+        // and the type of such a variable can be different in catch and finally blocks. So, in the future we will have
+        // to decide to either generate a unique method for each inlined copy of the function, maybe figure out its
+        // exact type closure and deduplicate based on that, or just decide that functions in finally blocks aren't
+        // worth it, and generate one method with most generic type closure.
+        if(!emittedMethods.contains(fnName)) {
+            LOG.info("=== BEGIN ", fnName);
+
+            assert functionNode.getCompileUnit() != null : "no compile unit for " + fnName + " " + Debug.id(functionNode);
+            unit = lc.pushCompileUnit(functionNode.getCompileUnit());
+            assert lc.hasCompileUnits();
+
+            method = lc.pushMethodEmitter(unit.getClassEmitter().method(functionNode));
+            // new method - reset last line number
+            lastLineNumber = -1;
+            // Mark end for variable tables.
+            method.begin();
+        }
 
         return true;
     }
@@ -1027,13 +1043,14 @@
     @Override
     public Node leaveFunctionNode(final FunctionNode functionNode) {
         try {
-            method.end(); // wrap up this method
-            unit   = lc.popCompileUnit(functionNode.getCompileUnit());
-            method = lc.popMethodEmitter(method);
-            LOG.info("=== END ", functionNode.getName());
+            if(emittedMethods.add(functionNode.getName())) {
+                method.end(); // wrap up this method
+                unit   = lc.popCompileUnit(functionNode.getCompileUnit());
+                method = lc.popMethodEmitter(method);
+                LOG.info("=== END ", functionNode.getName());
+            }
 
             final FunctionNode newFunctionNode = functionNode.setState(lc, CompilationState.EMITTED);
-
             newFunctionObject(newFunctionNode, functionNode);
             return newFunctionNode;
         } catch (final Throwable t) {
@@ -1053,7 +1070,7 @@
     public boolean enterIfNode(final IfNode ifNode) {
         lineNumber(ifNode);
 
-        final Node  test = ifNode.getTest();
+        final Expression test = ifNode.getTest();
         final Block pass = ifNode.getPass();
         final Block fail = ifNode.getFail();
 
@@ -1093,7 +1110,10 @@
     }
 
     private void lineNumber(final Statement statement) {
-        final int lineNumber = statement.getLineNumber();
+        lineNumber(statement.getLineNumber());
+    }
+
+    private void lineNumber(int lineNumber) {
         if (lineNumber != lastLineNumber) {
             method.lineNumber(lineNumber);
         }
@@ -1112,7 +1132,7 @@
     private MethodEmitter loadArray(final ArrayLiteralNode arrayLiteralNode, final ArrayType arrayType) {
         assert arrayType == Type.INT_ARRAY || arrayType == Type.LONG_ARRAY || arrayType == Type.NUMBER_ARRAY || arrayType == Type.OBJECT_ARRAY;
 
-        final Node[]          nodes    = arrayLiteralNode.getValue();
+        final Expression[]    nodes    = arrayLiteralNode.getValue();
         final Object          presets  = arrayLiteralNode.getPresets();
         final int[]           postsets = arrayLiteralNode.getPostsets();
         final Class<?>        type     = arrayType.getTypeClass();
@@ -1172,11 +1192,11 @@
         return method;
     }
 
-    private void storeElement(final Node[] nodes, final Type elementType, final int index) {
+    private void storeElement(final Expression[] nodes, final Type elementType, final int index) {
         method.dup();
         method.load(index);
 
-        final Node element = nodes[index];
+        final Expression element = nodes[index];
 
         if (element == null) {
             method.loadEmpty(elementType);
@@ -1188,7 +1208,7 @@
         method.arraystore();
     }
 
-    private MethodEmitter loadArgsArray(final List<Node> args) {
+    private MethodEmitter loadArgsArray(final List<Expression> args) {
         final Object[] array = new Object[args.size()];
         loadConstant(array);
 
@@ -1318,9 +1338,8 @@
         return method;
     }
 
-    @SuppressWarnings("rawtypes")
     @Override
-    public boolean enterLiteralNode(final LiteralNode literalNode) {
+    public boolean enterLiteralNode(final LiteralNode<?> literalNode) {
         assert literalNode.getSymbol() != null : literalNode + " has no symbol";
         load(literalNode).store(literalNode.getSymbol());
         return false;
@@ -1330,16 +1349,16 @@
     public boolean enterObjectNode(final ObjectNode objectNode) {
         final List<PropertyNode> elements = objectNode.getElements();
 
-        final List<String> keys    = new ArrayList<>();
-        final List<Symbol> symbols = new ArrayList<>();
-        final List<Node>   values  = new ArrayList<>();
+        final List<String>     keys    = new ArrayList<>();
+        final List<Symbol>     symbols = new ArrayList<>();
+        final List<Expression> values  = new ArrayList<>();
 
         boolean hasGettersSetters = false;
 
         for (PropertyNode propertyNode: elements) {
-            final Node         value        = propertyNode.getValue();
+            final Expression   value        = propertyNode.getValue();
             final String       key          = propertyNode.getKeyName();
-            final Symbol       symbol       = value == null ? null : propertyNode.getSymbol();
+            final Symbol       symbol       = value == null ? null : propertyNode.getKey().getSymbol();
 
             if (value == null) {
                 hasGettersSetters = true;
@@ -1350,73 +1369,71 @@
             values.add(value);
         }
 
-        new FieldObjectCreator<Node>(this, keys, symbols, values) {
-            @Override
-            protected void loadValue(final Node node) {
-                load(node);
-            }
-
-            /**
-             * Ensure that the properties start out as object types so that
-             * we can do putfield initializations instead of dynamicSetIndex
-             * which would be the case to determine initial property type
-             * otherwise.
-             *
-             * Use case, it's very expensive to do a million var x = {a:obj, b:obj}
-             * just to have to invalidate them immediately on initialization
-             *
-             * see NASHORN-594
-             */
-            @Override
-            protected MapCreator newMapCreator(final Class<?> fieldObjectClass) {
-                return new MapCreator(fieldObjectClass, keys, symbols) {
-                    @Override
-                    protected int getPropertyFlags(final Symbol symbol, final boolean isVarArg) {
-                        return super.getPropertyFlags(symbol, isVarArg) | Property.IS_ALWAYS_OBJECT;
-                    }
-                };
-            }
-
-        }.makeObject(method);
+        if (elements.size() > OBJECT_SPILL_THRESHOLD) {
+            new SpillObjectCreator(this, keys, symbols, values).makeObject(method);
+        } else {
+            new FieldObjectCreator<Expression>(this, keys, symbols, values) {
+                @Override
+                protected void loadValue(final Expression node) {
+                    load(node);
+                }
+
+                /**
+                 * Ensure that the properties start out as object types so that
+                 * we can do putfield initializations instead of dynamicSetIndex
+                 * which would be the case to determine initial property type
+                 * otherwise.
+                 *
+                 * Use case, it's very expensive to do a million var x = {a:obj, b:obj}
+                 * just to have to invalidate them immediately on initialization
+                 *
+                 * see NASHORN-594
+                 */
+                @Override
+                protected MapCreator newMapCreator(final Class<?> fieldObjectClass) {
+                    return new MapCreator(fieldObjectClass, keys, symbols) {
+                        @Override
+                        protected int getPropertyFlags(final Symbol symbol, final boolean hasArguments) {
+                            return super.getPropertyFlags(symbol, hasArguments) | Property.IS_ALWAYS_OBJECT;
+                        }
+                    };
+                }
+
+            }.makeObject(method);
+        }
 
         method.dup();
         globalObjectPrototype();
         method.invoke(ScriptObject.SET_PROTO);
 
-        if (!hasGettersSetters) {
-            method.store(objectNode.getSymbol());
-            return false;
-        }
-
-        for (final Node element : elements) {
-            final PropertyNode propertyNode = (PropertyNode)element;
-            final Object       key          = propertyNode.getKey();
-            final FunctionNode getter       = propertyNode.getGetter();
-            final FunctionNode setter       = propertyNode.getSetter();
-
-            if (getter == null && setter == null) {
-                continue;
+        if (hasGettersSetters) {
+            for (final PropertyNode propertyNode : elements) {
+                final FunctionNode getter       = propertyNode.getGetter();
+                final FunctionNode setter       = propertyNode.getSetter();
+
+                if (getter == null && setter == null) {
+                    continue;
+                }
+
+                method.dup().loadKey(propertyNode.getKey());
+
+                if (getter == null) {
+                    method.loadNull();
+                } else {
+                    getter.accept(this);
+                }
+
+                if (setter == null) {
+                    method.loadNull();
+                } else {
+                    setter.accept(this);
+                }
+
+                method.invoke(ScriptObject.SET_USER_ACCESSORS);
             }
-
-            method.dup().loadKey(key);
-
-            if (getter == null) {
-                method.loadNull();
-            } else {
-                getter.accept(this);
-            }
-
-            if (setter == null) {
-                method.loadNull();
-            } else {
-                setter.accept(this);
-            }
-
-            method.invoke(ScriptObject.SET_USER_ACCESSORS);
         }
 
         method.store(objectNode.getSymbol());
-
         return false;
     }
 
@@ -1428,7 +1445,7 @@
 
         final Type returnType = lc.getCurrentFunction().getReturnType();
 
-        final Node expression = returnNode.getExpression();
+        final Expression expression = returnNode.getExpression();
         if (expression != null) {
             load(expression);
         } else {
@@ -1444,7 +1461,7 @@
         return node instanceof LiteralNode<?> && ((LiteralNode<?>) node).isNull();
     }
 
-    private boolean nullCheck(final RuntimeNode runtimeNode, final List<Node> args, final String signature) {
+    private boolean nullCheck(final RuntimeNode runtimeNode, final List<Expression> args, final String signature) {
         final Request request = runtimeNode.getRequest();
 
         if (!Request.isEQ(request) && !Request.isNE(request)) {
@@ -1453,11 +1470,11 @@
 
         assert args.size() == 2 : "EQ or NE or TYPEOF need two args";
 
-        Node lhs = args.get(0);
-        Node rhs = args.get(1);
+        Expression lhs = args.get(0);
+        Expression rhs = args.get(1);
 
         if (isNullLiteral(lhs)) {
-            final Node tmp = lhs;
+            final Expression tmp = lhs;
             lhs = rhs;
             rhs = tmp;
         }
@@ -1511,7 +1528,7 @@
         return false;
     }
 
-    private boolean specializationCheck(final RuntimeNode.Request request, final Node node, final List<Node> args) {
+    private boolean specializationCheck(final RuntimeNode.Request request, final Expression node, final List<Expression> args) {
         if (!request.canSpecialize()) {
             return false;
         }
@@ -1564,10 +1581,11 @@
          *
          * TODO - remove this - Access Specializer will always know after Attr/Lower
          */
+        final List<Expression> args = runtimeNode.getArgs();
         if (runtimeNode.isPrimitive() && !runtimeNode.isFinal() && isReducible(runtimeNode.getRequest())) {
-            final Node lhs = runtimeNode.getArgs().get(0);
-            assert runtimeNode.getArgs().size() > 1 : runtimeNode + " must have two args";
-            final Node rhs = runtimeNode.getArgs().get(1);
+            final Expression lhs = args.get(0);
+            assert args.size() > 1 : runtimeNode + " must have two args";
+            final Expression rhs = args.get(1);
 
             final Type   type   = runtimeNode.getType();
             final Symbol symbol = runtimeNode.getSymbol();
@@ -1604,9 +1622,6 @@
             }
         }
 
-        // Get the request arguments.
-        final List<Node> args = runtimeNode.getArgs();
-
         if (nullCheck(runtimeNode, args, new FunctionSignature(false, false, runtimeNode.getType(), args).toString())) {
             return false;
         }
@@ -1615,7 +1630,7 @@
             return false;
         }
 
-        for (final Node arg : runtimeNode.getArgs()) {
+        for (final Expression arg : args) {
             load(arg).convert(Type.OBJECT); //TODO this should not be necessary below Lower
         }
 
@@ -1626,7 +1641,7 @@
                 false,
                 false,
                 runtimeNode.getType(),
-                runtimeNode.getArgs().size()).toString());
+                args.size()).toString());
         method.convert(runtimeNode.getType());
         method.store(runtimeNode.getSymbol());
 
@@ -1635,8 +1650,6 @@
 
     @Override
     public boolean enterSplitNode(final SplitNode splitNode) {
-        lineNumber(splitNode);
-
         final CompileUnit splitCompileUnit = splitNode.getCompileUnit();
 
         final FunctionNode fn   = lc.getCurrentFunction();
@@ -1781,7 +1794,7 @@
     public boolean enterSwitchNode(final SwitchNode switchNode) {
         lineNumber(switchNode);
 
-        final Node           expression  = switchNode.getExpression();
+        final Expression     expression  = switchNode.getExpression();
         final Symbol         tag         = switchNode.getTag();
         final boolean        allInteger  = tag.getSymbolType().isInteger();
         final List<CaseNode> cases       = switchNode.getCases();
@@ -1847,7 +1860,7 @@
             // If expression not int see if we can convert, if not use deflt to trigger default.
             if (!type.isInteger()) {
                 method.load(deflt);
-                final Class exprClass = type.getTypeClass();
+                final Class<?> exprClass = type.getTypeClass();
                 method.invoke(staticCallNoLookup(ScriptRuntime.class, "switchTagAsInt", int.class, exprClass.isPrimitive()? exprClass : Object.class, int.class));
             }
 
@@ -1878,11 +1891,13 @@
                 method.store(tag);
                 method.conditionalJump(Condition.NE, true, defaultLabel);
             } else {
+                assert tag.getSymbolType().isObject();
+                method.convert(Type.OBJECT); //e.g. 1 literal pushed and tag is object
                 method.store(tag);
             }
 
             for (final CaseNode caseNode : cases) {
-                final Node test = caseNode.getTest();
+                final Expression test = caseNode.getTest();
 
                 if (test != null) {
                     method.load(tag);
@@ -1922,10 +1937,10 @@
 
         final Source source     = lc.getCurrentFunction().getSource();
 
-        final Node   expression = throwNode.getExpression();
-        final int    position   = throwNode.position();
-        final int    line       = source.getLine(position);
-        final int    column     = source.getColumn(position);
+        final Expression expression = throwNode.getExpression();
+        final int        position   = throwNode.position();
+        final int        line       = source.getLine(position);
+        final int        column     = source.getColumn(position);
 
         load(expression);
         assert expression.getType().isObject();
@@ -1974,10 +1989,10 @@
             lc.push(catchBlock);
             enterBlock(catchBlock);
 
-            final CatchNode catchNode          = (CatchNode)catchBlocks.get(i).getStatements().get(0);
-            final IdentNode exception          = catchNode.getException();
-            final Node      exceptionCondition = catchNode.getExceptionCondition();
-            final Block     catchBody          = catchNode.getBody();
+            final CatchNode  catchNode          = (CatchNode)catchBlocks.get(i).getStatements().get(0);
+            final IdentNode  exception          = catchNode.getException();
+            final Expression exceptionCondition = catchNode.getExceptionCondition();
+            final Block      catchBody          = catchNode.getBody();
 
             new Store<IdentNode>(exception) {
                 @Override
@@ -2045,7 +2060,7 @@
     @Override
     public boolean enterVarNode(final VarNode varNode) {
 
-        final Node init = varNode.getInit();
+        final Expression init = varNode.getInit();
 
         if (init == null) {
             return false;
@@ -2053,8 +2068,8 @@
 
         lineNumber(varNode);
 
-        final Symbol varSymbol = varNode.getSymbol();
-        assert varSymbol != null : "variable node " + varNode + " requires a symbol";
+        final Symbol varSymbol = varNode.getName().getSymbol();
+        assert varSymbol != null : "variable node " + varNode + " requires a name with a symbol";
 
         assert method != null;
 
@@ -2074,9 +2089,7 @@
                 method.dynamicSet(type, identNode.getName(), flags);
             }
         } else {
-            assert varNode.getType() == varNode.getName().getType() : "varNode type=" + varNode.getType() + " nametype=" + varNode.getName().getType() + " inittype=" + init.getType();
-
-            method.convert(varNode.getType()); // aw: convert moved here
+            method.convert(varNode.getName().getType()); // aw: convert moved here
             method.store(varSymbol);
         }
 
@@ -2087,11 +2100,11 @@
     public boolean enterWhileNode(final WhileNode whileNode) {
         lineNumber(whileNode);
 
-        final Node  test          = whileNode.getTest();
-        final Block body          = whileNode.getBody();
-        final Label breakLabel    = whileNode.getBreakLabel();
-        final Label continueLabel = whileNode.getContinueLabel();
-        final Label loopLabel     = new Label("loop");
+        final Expression test          = whileNode.getTest();
+        final Block      body          = whileNode.getBody();
+        final Label      breakLabel    = whileNode.getBreakLabel();
+        final Label      continueLabel = whileNode.getContinueLabel();
+        final Label      loopLabel     = new Label("loop");
 
         if (!whileNode.isDoWhile()) {
             method._goto(continueLabel);
@@ -2118,8 +2131,8 @@
 
     @Override
     public boolean enterWithNode(final WithNode withNode) {
-        final Node expression = withNode.getExpression();
-        final Node body       = withNode.getBody();
+        final Expression expression = withNode.getExpression();
+        final Node       body       = withNode.getBody();
 
         // It is possible to have a "pathological" case where the with block does not reference *any* identifiers. It's
         // pointless, but legal. In that case, if nothing else in the method forced the assignment of a slot to the
@@ -2194,7 +2207,7 @@
     // do this better with convert calls to method. TODO
     @Override
     public boolean enterCONVERT(final UnaryNode unaryNode) {
-        final Node rhs = unaryNode.rhs();
+        final Expression rhs = unaryNode.rhs();
         final Type to  = unaryNode.getType();
 
         if (to.isObject() && rhs instanceof LiteralNode) {
@@ -2231,11 +2244,11 @@
 
     @Override
     public boolean enterDECINC(final UnaryNode unaryNode) {
-        final Node      rhs         = unaryNode.rhs();
-        final Type      type        = unaryNode.getType();
-        final TokenType tokenType   = unaryNode.tokenType();
-        final boolean   isPostfix   = tokenType == TokenType.DECPOSTFIX || tokenType == TokenType.INCPOSTFIX;
-        final boolean   isIncrement = tokenType == TokenType.INCPREFIX || tokenType == TokenType.INCPOSTFIX;
+        final Expression rhs         = unaryNode.rhs();
+        final Type       type        = unaryNode.getType();
+        final TokenType  tokenType   = unaryNode.tokenType();
+        final boolean    isPostfix   = tokenType == TokenType.DECPOSTFIX || tokenType == TokenType.INCPOSTFIX;
+        final boolean    isIncrement = tokenType == TokenType.INCPREFIX || tokenType == TokenType.INCPOSTFIX;
 
         assert !type.isObject();
 
@@ -2279,7 +2292,7 @@
 
     @Override
     public boolean enterDISCARD(final UnaryNode unaryNode) {
-        final Node rhs = unaryNode.rhs();
+        final Expression rhs = unaryNode.rhs();
 
         lc.pushDiscard(rhs);
         load(rhs);
@@ -2296,7 +2309,7 @@
     @Override
     public boolean enterNEW(final UnaryNode unaryNode) {
         final CallNode callNode = (CallNode)unaryNode.rhs();
-        final List<Node> args   = callNode.getArgs();
+        final List<Expression> args   = callNode.getArgs();
 
         // Load function reference.
         load(callNode.getFunction()).convert(Type.OBJECT); // must detect type error
@@ -2309,7 +2322,7 @@
 
     @Override
     public boolean enterNOT(final UnaryNode unaryNode) {
-        final Node rhs = unaryNode.rhs();
+        final Expression rhs = unaryNode.rhs();
 
         load(rhs);
 
@@ -2335,19 +2348,26 @@
         return false;
     }
 
-    private Node enterNumericAdd(final Node lhs, final Node rhs, final Type type, final Symbol symbol) {
+    @Override
+    public boolean enterVOID(final UnaryNode unaryNode) {
+        load(unaryNode.rhs()).pop();
+        method.loadUndefined(Type.OBJECT);
+
+        return false;
+    }
+
+    private void enterNumericAdd(final Expression lhs, final Expression rhs, final Type type, final Symbol symbol) {
         assert lhs.getType().equals(rhs.getType()) && lhs.getType().equals(type) : lhs.getType() + " != " + rhs.getType() + " != " + type + " " + new ASTWriter(lhs) + " " + new ASTWriter(rhs);
         load(lhs);
         load(rhs);
         method.add(); //if the symbol is optimistic, it always needs to be written, not on the stack?
         method.store(symbol);
-        return null;
     }
 
     @Override
     public boolean enterADD(final BinaryNode binaryNode) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         final Type type = binaryNode.getType();
         if (type.isNumeric()) {
@@ -2363,8 +2383,8 @@
     }
 
     private boolean enterAND_OR(final BinaryNode binaryNode) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         final Label skip = new Label("skip");
 
@@ -2391,8 +2411,8 @@
 
     @Override
     public boolean enterASSIGN(final BinaryNode binaryNode) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         final Type lhsType = lhs.getType();
         final Type rhsType = rhs.getType();
@@ -2660,8 +2680,8 @@
     }
 
     private boolean enterComma(final BinaryNode binaryNode) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         load(lhs);
         load(rhs);
@@ -2692,7 +2712,7 @@
         return false;
     }
 
-    private boolean enterCmp(final Node lhs, final Node rhs, final Condition cond, final Type type, final Symbol symbol) {
+    private boolean enterCmp(final Expression lhs, final Expression rhs, final Condition cond, final Type type, final Symbol symbol) {
         final Type lhsType = lhs.getType();
         final Type rhsType = rhs.getType();
 
@@ -2845,21 +2865,21 @@
 
     @Override
     public boolean enterTernaryNode(final TernaryNode ternaryNode) {
-        final Node lhs   = ternaryNode.lhs();
-        final Node rhs   = ternaryNode.rhs();
-        final Node third = ternaryNode.third();
+        final Expression test      = ternaryNode.getTest();
+        final Expression trueExpr  = ternaryNode.getTrueExpression();
+        final Expression falseExpr = ternaryNode.getFalseExpression();
 
         final Symbol symbol     = ternaryNode.getSymbol();
         final Label  falseLabel = new Label("ternary_false");
         final Label  exitLabel  = new Label("ternary_exit");
 
-        Type widest = Type.widest(rhs.getType(), third.getType());
-        if (rhs.getType().isArray() || third.getType().isArray()) { //loadArray creates a Java array type on the stack, calls global allocate, which creates a native array type
+        Type widest = Type.widest(trueExpr.getType(), falseExpr.getType());
+        if (trueExpr.getType().isArray() || falseExpr.getType().isArray()) { //loadArray creates a Java array type on the stack, calls global allocate, which creates a native array type
             widest = Type.OBJECT;
         }
 
-        load(lhs);
-        assert lhs.getType().isBoolean() : "lhs in ternary must be boolean";
+        load(test);
+        assert test.getType().isBoolean() : "lhs in ternary must be boolean";
 
         // we still keep the conversion here as the AccessSpecializer can have separated the types, e.g. var y = x ? x=55 : 17
         // will left as (Object)x=55 : (Object)17 by Lower. Then the first term can be {I}x=55 of type int, which breaks the
@@ -2867,11 +2887,11 @@
         // to early, or Apply the AccessSpecializer too late. We are mostly probably looking for a separate type pass to
         // do this property. Then we never need any conversions in CodeGenerator
         method.ifeq(falseLabel);
-        load(rhs);
+        load(trueExpr);
         method.convert(widest);
         method._goto(exitLabel);
         method.label(falseLabel);
-        load(third);
+        load(falseExpr);
         method.convert(widest);
         method.label(exitLabel);
         method.store(symbol);
@@ -2924,8 +2944,8 @@
      *
      * @param <T>
      */
-    private abstract class SelfModifyingStore<T extends Node> extends Store<T> {
-        protected SelfModifyingStore(final T assignNode, final Node target) {
+    private abstract class SelfModifyingStore<T extends Expression> extends Store<T> {
+        protected SelfModifyingStore(final T assignNode, final Expression target) {
             super(assignNode, target);
         }
 
@@ -2938,13 +2958,13 @@
     /**
      * Helper class to generate stores
      */
-    private abstract class Store<T extends Node> {
+    private abstract class Store<T extends Expression> {
 
         /** An assignment node, e.g. x += y */
         protected final T assignNode;
 
         /** The target node to store to, e.g. x */
-        private final Node target;
+        private final Expression target;
 
         /** How deep on the stack do the arguments go if this generates an indy call */
         private int depth;
@@ -2958,7 +2978,7 @@
          * @param assignNode the node representing the whole assignment
          * @param target     the target node of the assignment (destination)
          */
-        protected Store(final T assignNode, final Node target) {
+        protected Store(final T assignNode, final Expression target) {
             this.assignNode = assignNode;
             this.target = target;
         }
@@ -3001,8 +3021,8 @@
 
                 private void enterBaseNode() {
                     assert target instanceof BaseNode : "error - base node " + target + " must be instanceof BaseNode";
-                    final BaseNode baseNode = (BaseNode)target;
-                    final Node     base     = baseNode.getBase();
+                    final BaseNode   baseNode = (BaseNode)target;
+                    final Expression base     = baseNode.getBase();
 
                     load(base);
                     method.convert(Type.OBJECT);
@@ -3023,7 +3043,7 @@
                 public boolean enterIndexNode(final IndexNode node) {
                     enterBaseNode();
 
-                    final Node index = node.getIndex();
+                    final Expression index = node.getIndex();
                     // could be boolean here as well
                     load(index);
                     if (!index.getType().isNumeric()) {
@@ -3173,31 +3193,24 @@
             return;
         }
 
-        final boolean isLazy  = functionNode.isLazy();
-
-        new ObjectCreator(this, new ArrayList<String>(), new ArrayList<Symbol>(), false, false) {
-            @Override
-            protected void makeObject(final MethodEmitter m) {
-                final String className = SCRIPTFUNCTION_IMPL_OBJECT;
-
-                m._new(className).dup();
-                loadConstant(new RecompilableScriptFunctionData(functionNode, compiler.getCodeInstaller(), Compiler.binaryName(getClassName()), makeMap()));
-
-                if (isLazy || functionNode.needsParentScope()) {
-                    m.loadCompilerConstant(SCOPE);
-                } else {
-                    m.loadNull();
-                }
-                m.invoke(constructorNoLookup(className, RecompilableScriptFunctionData.class, ScriptObject.class));
-            }
-        }.makeObject(method);
+        // Generate the object class and property map in case this function is ever used as constructor
+        final String      className          = SCRIPTFUNCTION_IMPL_OBJECT;
+        final int         fieldCount         = ObjectClassGenerator.getPaddedFieldCount(functionNode.countThisProperties());
+        final String      allocatorClassName = Compiler.binaryName(ObjectClassGenerator.getClassName(fieldCount));
+        final PropertyMap allocatorMap       = PropertyMap.newMap(null, 0, fieldCount, 0);
+
+        method._new(className).dup();
+        loadConstant(new RecompilableScriptFunctionData(functionNode, compiler.getCodeInstaller(), allocatorClassName, allocatorMap));
+
+        if (functionNode.isLazy() || functionNode.needsParentScope()) {
+            method.loadCompilerConstant(SCOPE);
+        } else {
+            method.loadNull();
+        }
+        method.invoke(constructorNoLookup(className, RecompilableScriptFunctionData.class, ScriptObject.class));
     }
 
-    /*
-     * Globals are special. We cannot refer to any Global (or NativeObject) class by .class, as they are different
-     * for different contexts. As far as I can tell, the only NativeObject that we need to deal with like this
-     * is from the code pipeline is Global
-     */
+    // calls on Global class.
     private MethodEmitter globalInstance() {
         return method.invokestatic(GLOBAL_OBJECT, "instance", "()L" + GLOBAL_OBJECT + ';');
     }
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Fri Jul 26 14:07:32 2013 -0700
@@ -18,17 +18,16 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-
 import jdk.nashorn.internal.codegen.types.Range;
 import jdk.nashorn.internal.codegen.types.Type;
-import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.CallNode;
+import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.LexicalContext;
+import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.ReturnNode;
 import jdk.nashorn.internal.ir.Symbol;
-import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
-import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.TemporarySymbols;
 import jdk.nashorn.internal.ir.debug.ASTWriter;
 import jdk.nashorn.internal.ir.debug.PrintVisitor;
@@ -117,7 +116,7 @@
                         final FunctionNode parent = lc.getParentFunction(functionNode);
                         assert parent != null;
                         lc.setFlag(parent, FunctionNode.HAS_LAZY_CHILDREN);
-                        lc.setFlag(parent.getBody(), Block.NEEDS_SCOPE);
+                        lc.setBlockNeedsScope(parent.getBody());
                         lc.setFlag(functionNode, FunctionNode.IS_LAZY);
                         return functionNode;
                     }
@@ -258,17 +257,20 @@
 
                 @Override
                 public Node leaveDefault(final Node node) {
-                    final Symbol symbol = node.getSymbol();
-                    if (symbol != null) {
-                        final Range range  = symbol.getRange();
-                        final Type  symbolType = symbol.getSymbolType();
-                        if (!symbolType.isNumeric()) {
-                            return node;
-                        }
-                        final Type  rangeType  = range.getType();
-                        if (!Type.areEquivalent(symbolType, rangeType) && Type.widest(symbolType, rangeType) == symbolType) { //we can narrow range
-                            RangeAnalyzer.LOG.info("[", lc.getCurrentFunction().getName(), "] ", symbol, " can be ", range.getType(), " ", symbol.getRange());
-                            return node.setSymbol(lc, symbol.setTypeOverrideShared(range.getType(), compiler.getTemporarySymbols()));
+                    if(node instanceof Expression) {
+                        final Expression expr = (Expression)node;
+                        final Symbol symbol = expr.getSymbol();
+                        if (symbol != null) {
+                            final Range range  = symbol.getRange();
+                            final Type  symbolType = symbol.getSymbolType();
+                            if (!symbolType.isNumeric()) {
+                                return expr;
+                            }
+                            final Type  rangeType  = range.getType();
+                            if (!Type.areEquivalent(symbolType, rangeType) && Type.widest(symbolType, rangeType) == symbolType) { //we can narrow range
+                                RangeAnalyzer.LOG.info("[", lc.getCurrentFunction().getName(), "] ", symbol, " can be ", range.getType(), " ", symbol.getRange());
+                                return expr.setSymbol(lc, symbol.setTypeOverrideShared(range.getType(), compiler.getTemporarySymbols()));
+                            }
                         }
                     }
                     return node;
--- a/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Compiler.java	Fri Jul 26 14:07:32 2013 -0700
@@ -528,8 +528,8 @@
         return this.env;
     }
 
-    private static String safeSourceName(final Source source) {
-        String baseName = new File(source.getName()).getName();
+    private String safeSourceName(final Source src) {
+        String baseName = new File(src.getName()).getName();
 
         final int index = baseName.lastIndexOf(".js");
         if (index != -1) {
@@ -537,6 +537,9 @@
         }
 
         baseName = baseName.replace('.', '_').replace('-', '_');
+        if (! env._loader_per_compile) {
+            baseName = baseName + installer.getUniqueScriptId();
+        }
         final String mangled = NameCodec.encode(baseName);
 
         return mangled != null ? mangled : baseName;
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Fri Jul 26 14:07:32 2013 -0700
@@ -100,10 +100,10 @@
     CALLEE(":callee", ScriptFunction.class),
 
     /** the varargs variable when necessary */
-    VARARGS(":varargs"),
+    VARARGS(":varargs", Object[].class),
 
     /** the arguments vector when necessary and the slot */
-    ARGUMENTS("arguments", Object.class, 2),
+    ARGUMENTS("arguments", ScriptObject.class, 2),
 
     /** prefix for iterators for for (x in ...) */
     ITERATOR_PREFIX(":i", Iterator.class),
--- a/nashorn/src/jdk/nashorn/internal/codegen/FieldObjectCreator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/FieldObjectCreator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -26,15 +26,16 @@
 package jdk.nashorn.internal.codegen;
 
 import static jdk.nashorn.internal.codegen.CompilerConstants.ARGUMENTS;
-import static jdk.nashorn.internal.codegen.CompilerConstants.SCOPE;
 import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup;
 import static jdk.nashorn.internal.codegen.CompilerConstants.typeDescriptor;
+import static jdk.nashorn.internal.codegen.ObjectClassGenerator.getPaddedFieldCount;
 import static jdk.nashorn.internal.codegen.types.Type.OBJECT;
 
 import java.util.Iterator;
 import java.util.List;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.Symbol;
+import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
@@ -48,6 +49,13 @@
  * @see jdk.nashorn.internal.ir.Node
  */
 public abstract class FieldObjectCreator<T> extends ObjectCreator {
+
+    private         String        fieldObjectClassName;
+    private         Class<?>      fieldObjectClass;
+    private         int           fieldCount;
+    private         int           paddedFieldCount;
+    private         int           paramCount;
+
     /** array of corresponding values to symbols (null for no values) */
     private final List<T> values;
 
@@ -80,14 +88,9 @@
         super(codegen, keys, symbols, isScope, hasArguments);
         this.values        = values;
         this.callSiteFlags = codegen.getCallSiteFlags();
-    }
 
-    /**
-     * Loads the scope on the stack through the passed method emitter.
-     * @param method the method emitter to use
-     */
-    protected void loadScope(final MethodEmitter method) {
-        method.loadCompilerConstant(SCOPE);
+        countFields();
+        findClass();
     }
 
     /**
@@ -137,6 +140,13 @@
         }
     }
 
+    @Override
+    protected PropertyMap makeMap() {
+        assert propertyMap == null : "property map already initialized";
+        propertyMap = newMapCreator(fieldObjectClass).makeFieldMap(hasArguments(), fieldCount, paddedFieldCount);
+        return propertyMap;
+    }
+
     /**
      * Technique for loading an initial value. Defined by anonymous subclasses in code gen.
      *
@@ -173,4 +183,47 @@
         loadValue(value);
         method.dynamicSetIndex(callSiteFlags);
     }
+
+    /**
+     * Locate (or indirectly create) the object container class.
+     */
+    private void findClass() {
+        fieldObjectClassName = isScope() ?
+                ObjectClassGenerator.getClassName(fieldCount, paramCount) :
+                ObjectClassGenerator.getClassName(paddedFieldCount);
+
+        try {
+            this.fieldObjectClass = Context.forStructureClass(Compiler.binaryName(fieldObjectClassName));
+        } catch (final ClassNotFoundException e) {
+            throw new AssertionError("Nashorn has encountered an internal error.  Structure can not be created.");
+        }
+    }
+
+    /**
+     * Get the class name for the object class,
+     * e.g. {@code com.nashorn.oracle.scripts.JO2P0}
+     *
+     * @return script class name
+     */
+    String getClassName() {
+        return fieldObjectClassName;
+    }
+
+    /**
+     * Tally the number of fields and parameters.
+     */
+    private void countFields() {
+        for (final Symbol symbol : this.symbols) {
+            if (symbol != null) {
+                if (hasArguments() && symbol.isParam()) {
+                    symbol.setFieldIndex(paramCount++);
+                } else {
+                    symbol.setFieldIndex(fieldCount++);
+                }
+            }
+        }
+
+        paddedFieldCount = getPaddedFieldCount(fieldCount);
+    }
+
 }
--- a/nashorn/src/jdk/nashorn/internal/codegen/FinalizeTypes.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/FinalizeTypes.java	Fri Jul 26 14:07:32 2013 -0700
@@ -31,7 +31,6 @@
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.AccessNode;
 import jdk.nashorn.internal.ir.Assignment;
@@ -40,7 +39,8 @@
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.CaseNode;
 import jdk.nashorn.internal.ir.CatchNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.Expression;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
@@ -147,9 +147,9 @@
      * strings etc as well.
      */
     @Override
-    public Node leaveADD(final BinaryNode binaryNode) {
-        final Node lhs = binaryNode.lhs();
-        final Node rhs = binaryNode.rhs();
+    public Expression leaveADD(final BinaryNode binaryNode) {
+        final Expression lhs = binaryNode.lhs();
+        final Expression rhs = binaryNode.rhs();
 
         final Type type = binaryNode.getType();
 
@@ -175,6 +175,14 @@
         if (destType == null) {
             destType = specBinaryNode.getType();
         }
+        // Register assignments to this object in case this is used as constructor
+        if (binaryNode.lhs() instanceof AccessNode) {
+            AccessNode accessNode = (AccessNode) binaryNode.lhs();
+
+            if (accessNode.getBase().getSymbol().isThis()) {
+                lc.getCurrentFunction().addThisProperty(accessNode.getProperty().getName());
+            }
+        }
         return specBinaryNode.setRHS(convert(specBinaryNode.rhs(), destType));
     }
 
@@ -233,7 +241,7 @@
         return leaveASSIGN(binaryNode);
     }
 
-    private boolean symbolIsInteger(Node node) {
+    private boolean symbolIsInteger(final Expression node) {
         final Symbol symbol = node.getSymbol();
         assert symbol != null && symbol.getSymbolType().isInteger() : "int coercion expected: " + Debug.id(symbol) + " " + symbol + " " + lc.getCurrentFunction().getSource();
         return true;
@@ -365,7 +373,7 @@
 
     @Override
     public Node leaveCatchNode(final CatchNode catchNode) {
-        final Node exceptionCondition = catchNode.getExceptionCondition();
+        final Expression exceptionCondition = catchNode.getExceptionCondition();
         if (exceptionCondition != null) {
             return catchNode.setExceptionCondition(convert(exceptionCondition, Type.BOOLEAN));
         }
@@ -373,16 +381,16 @@
     }
 
     @Override
-    public Node leaveExecuteNode(final ExecuteNode executeNode) {
+    public Node leaveExpressionStatement(final ExpressionStatement expressionStatement) {
         temporarySymbols.reuse();
-        return executeNode.setExpression(discard(executeNode.getExpression()));
+        return expressionStatement.setExpression(discard(expressionStatement.getExpression()));
     }
 
     @Override
     public Node leaveForNode(final ForNode forNode) {
-        final Node init   = forNode.getInit();
-        final Node test   = forNode.getTest();
-        final Node modify = forNode.getModify();
+        final Expression init   = forNode.getInit();
+        final Expression test   = forNode.getTest();
+        final Expression modify = forNode.getModify();
 
         if (forNode.isForIn()) {
             return forNode.setModify(lc, convert(forNode.getModify(), Type.OBJECT)); // NASHORN-400
@@ -407,10 +415,10 @@
         if (!functionNode.needsCallee()) {
             functionNode.compilerConstant(CALLEE).setNeedsSlot(false);
         }
-        // Similar reasoning applies to __scope__ symbol: if the function doesn't need either parent scope or its
-        // own scope, we ensure it doesn't get a slot, but we can't determine whether it needs a scope earlier than
-        // this phase.
-        if (!(functionNode.getBody().needsScope() || functionNode.needsParentScope())) {
+        // Similar reasoning applies to __scope__ symbol: if the function doesn't need either parent scope and none of
+        // its blocks create a scope, we ensure it doesn't get a slot, but we can't determine whether it needs a scope
+        // earlier than this phase.
+        if (!(functionNode.hasScopeBlock() || functionNode.needsParentScope())) {
             functionNode.compilerConstant(SCOPE).setNeedsSlot(false);
         }
 
@@ -432,13 +440,13 @@
     public boolean enterLiteralNode(final LiteralNode literalNode) {
         if (literalNode instanceof ArrayLiteralNode) {
             final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode;
-            final Node[]           array            = arrayLiteralNode.getValue();
+            final Expression[]     array            = arrayLiteralNode.getValue();
             final Type             elementType      = arrayLiteralNode.getElementType();
 
             for (int i = 0; i < array.length; i++) {
                 final Node element = array[i];
                 if (element != null) {
-                    array[i] = convert(element.accept(this), elementType);
+                    array[i] = convert((Expression)element.accept(this), elementType);
                 }
             }
         }
@@ -448,7 +456,7 @@
 
     @Override
     public Node leaveReturnNode(final ReturnNode returnNode) {
-        final Node expr = returnNode.getExpression();
+        final Expression expr = returnNode.getExpression();
         if (expr != null) {
             return returnNode.setExpression(convert(expr, lc.getCurrentFunction().getReturnType()));
         }
@@ -457,8 +465,8 @@
 
     @Override
     public Node leaveRuntimeNode(final RuntimeNode runtimeNode) {
-        final List<Node> args = runtimeNode.getArgs();
-        for (final Node arg : args) {
+        final List<Expression> args = runtimeNode.getArgs();
+        for (final Expression arg : args) {
             assert !arg.getType().isUnknown();
         }
         return runtimeNode;
@@ -472,12 +480,12 @@
             return switchNode;
         }
 
-        final Node           expression  = switchNode.getExpression();
+        final Expression     expression  = switchNode.getExpression();
         final List<CaseNode> cases       = switchNode.getCases();
         final List<CaseNode> newCases    = new ArrayList<>();
 
         for (final CaseNode caseNode : cases) {
-            final Node test = caseNode.getTest();
+            final Expression test = caseNode.getTest();
             newCases.add(test != null ? caseNode.setTest(convert(test, Type.OBJECT)) : caseNode);
         }
 
@@ -488,7 +496,7 @@
 
     @Override
     public Node leaveTernaryNode(final TernaryNode ternaryNode) {
-        return ternaryNode.setLHS(convert(ternaryNode.lhs(), Type.BOOLEAN));
+        return ternaryNode.setTest(convert(ternaryNode.getTest(), Type.BOOLEAN));
     }
 
     @Override
@@ -498,16 +506,16 @@
 
     @Override
     public Node leaveVarNode(final VarNode varNode) {
-        final Node init = varNode.getInit();
+        final Expression init = varNode.getInit();
         if (init != null) {
             final SpecializedNode specialized = specialize(varNode);
             final VarNode specVarNode = (VarNode)specialized.node;
             Type destType = specialized.type;
             if (destType == null) {
-                destType = specVarNode.getType();
+                destType = specVarNode.getName().getType();
             }
-            assert specVarNode.hasType() : specVarNode + " doesn't have a type";
-            final Node convertedInit = convert(init, destType);
+            assert specVarNode.getName().hasType() : specVarNode + " doesn't have a type";
+            final Expression convertedInit = convert(init, destType);
             temporarySymbols.reuse();
             return specVarNode.setInit(convertedInit);
         }
@@ -517,7 +525,7 @@
 
     @Override
     public Node leaveWhileNode(final WhileNode whileNode) {
-        final Node test = whileNode.getTest();
+        final Expression test = whileNode.getTest();
         if (test != null) {
             return whileNode.setTest(lc, convert(test, Type.BOOLEAN));
         }
@@ -592,8 +600,8 @@
      */
     @SuppressWarnings("fallthrough")
     private Node leaveCmp(final BinaryNode binaryNode, final RuntimeNode.Request request) {
-        final Node lhs    = binaryNode.lhs();
-        final Node rhs    = binaryNode.rhs();
+        final Expression lhs    = binaryNode.lhs();
+        final Expression rhs    = binaryNode.rhs();
 
         Type widest = Type.widest(lhs.getType(), rhs.getType());
 
@@ -689,10 +697,10 @@
         }
     }
 
-    <T extends Node> SpecializedNode specialize(final Assignment<T> assignment) {
+    <T extends Expression> SpecializedNode specialize(final Assignment<T> assignment) {
         final Node node = ((Node)assignment);
         final T lhs = assignment.getAssignmentDest();
-        final Node rhs = assignment.getAssignmentSource();
+        final Expression rhs = assignment.getAssignmentSource();
 
         if (!canHaveCallSiteType(lhs)) {
             return new SpecializedNode(node, null);
@@ -711,8 +719,16 @@
         }
 
         final Node newNode = assignment.setAssignmentDest(setTypeOverride(lhs, to));
-        final Node typePropagatedNode = propagateType(newNode, to);
-
+        final Node typePropagatedNode;
+        if(newNode instanceof Expression) {
+            typePropagatedNode = propagateType((Expression)newNode, to);
+        } else if(newNode instanceof VarNode) {
+            // VarNode, being a statement, doesn't have its own symbol; it uses the symbol of its name instead.
+            final VarNode varNode = (VarNode)newNode;
+            typePropagatedNode = varNode.setName((IdentNode)propagateType(varNode.getName(), to));
+        } else {
+            throw new AssertionError();
+        }
         return new SpecializedNode(typePropagatedNode, to);
     }
 
@@ -752,7 +768,7 @@
      * @param to      new type
      */
     @SuppressWarnings("unchecked")
-    <T extends Node> T setTypeOverride(final T node, final Type to) {
+    <T extends Expression> T setTypeOverride(final T node, final Type to) {
         final Type from = node.getType();
         if (!node.getType().equals(to)) {
             LOG.info("Changing call override type for '", node, "' from ", node.getType(), " to ", to);
@@ -781,7 +797,7 @@
      * @param to   destination type
      * @return     conversion node
      */
-    private Node convert(final Node node, final Type to) {
+    private Expression convert(final Expression node, final Type to) {
         assert !to.isUnknown() : "unknown type for " + node + " class=" + node.getClass();
         assert node != null : "node is null";
         assert node.getSymbol() != null : "node " + node + " " + node.getClass() + " has no symbol! " + lc.getCurrentFunction();
@@ -797,7 +813,7 @@
             return node;
         }
 
-        Node resultNode = node;
+        Expression resultNode = node;
 
         if (node instanceof LiteralNode && !(node instanceof ArrayLiteralNode) && !to.isObject()) {
             final LiteralNode<?> newNode = new LiteralNodeConstantEvaluator((LiteralNode<?>)node, to).eval();
@@ -821,9 +837,9 @@
         return temporarySymbols.ensureSymbol(lc, to, resultNode);
     }
 
-    private static Node discard(final Node node) {
+    private static Expression discard(final Expression node) {
         if (node.getSymbol() != null) {
-            final Node discard = new UnaryNode(Token.recast(node.getToken(), TokenType.DISCARD), node);
+            final UnaryNode discard = new UnaryNode(Token.recast(node.getToken(), TokenType.DISCARD), node);
             //discard never has a symbol in the discard node - then it would be a nop
             assert !node.isTerminal();
             return discard;
@@ -846,7 +862,7 @@
      * @param node
      * @param to
      */
-    private Node propagateType(final Node node, final Type to) {
+    private Expression propagateType(final Expression node, final Type to) {
         Symbol symbol = node.getSymbol();
         if (symbol.isTemp() && symbol.getSymbolType() != to) {
             symbol = symbol.setTypeOverrideShared(to, temporarySymbols);
--- a/nashorn/src/jdk/nashorn/internal/codegen/FoldConstants.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/FoldConstants.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,8 +28,8 @@
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.BlockStatement;
 import jdk.nashorn.internal.ir.EmptyNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
 import jdk.nashorn.internal.ir.IfNode;
@@ -91,7 +91,7 @@
         if (test instanceof LiteralNode) {
             final Block shortCut = ((LiteralNode<?>)test).isTrue() ? ifNode.getPass() : ifNode.getFail();
             if (shortCut != null) {
-                return new ExecuteNode(shortCut.getLineNumber(), shortCut.getToken(), shortCut.getFinish(), shortCut);
+                return new BlockStatement(ifNode.getLineNumber(), shortCut);
             }
             return new EmptyNode(ifNode);
         }
@@ -100,9 +100,9 @@
 
     @Override
     public Node leaveTernaryNode(final TernaryNode ternaryNode) {
-        final Node test = ternaryNode.lhs();
+        final Node test = ternaryNode.getTest();
         if (test instanceof LiteralNode) {
-            return ((LiteralNode<?>)test).isTrue() ? ternaryNode.rhs() : ternaryNode.third();
+            return ((LiteralNode<?>)test).isTrue() ? ternaryNode.getTrueExpression() : ternaryNode.getFalseExpression();
         }
         return ternaryNode;
     }
--- a/nashorn/src/jdk/nashorn/internal/codegen/FunctionSignature.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/FunctionSignature.java	Fri Jul 26 14:07:32 2013 -0700
@@ -31,8 +31,8 @@
 import java.util.ArrayList;
 import java.util.List;
 import jdk.nashorn.internal.codegen.types.Type;
+import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.FunctionNode;
-import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
 
@@ -63,7 +63,7 @@
      * @param retType   what is the return type
      * @param args      argument list of AST Nodes
      */
-    public FunctionSignature(final boolean hasSelf, final boolean hasCallee, final Type retType, final List<? extends Node> args) {
+    public FunctionSignature(final boolean hasSelf, final boolean hasCallee, final Type retType, final List<? extends Expression> args) {
         this(hasSelf, hasCallee, retType, FunctionSignature.typeArray(args));
     }
 
@@ -167,7 +167,7 @@
      *
      * @return the array of types
      */
-    private static Type[] typeArray(final List<? extends Node> args) {
+    private static Type[] typeArray(final List<? extends Expression> args) {
         if (args == null) {
             return null;
         }
@@ -175,7 +175,7 @@
         final Type[] typeArray = new Type[args.size()];
 
         int pos = 0;
-        for (final Node arg : args) {
+        for (final Expression arg : args) {
             typeArray[pos++] = arg.getType();
         }
 
--- a/nashorn/src/jdk/nashorn/internal/codegen/Lower.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Lower.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,16 +32,19 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.ListIterator;
 import jdk.nashorn.internal.ir.BaseNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.BlockLexicalContext;
+import jdk.nashorn.internal.ir.BlockStatement;
 import jdk.nashorn.internal.ir.BreakNode;
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.CatchNode;
 import jdk.nashorn.internal.ir.ContinueNode;
 import jdk.nashorn.internal.ir.EmptyNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.Expression;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
@@ -115,6 +118,21 @@
                 }
                 return newStatements;
             }
+
+            @Override
+            protected Block afterSetStatements(final Block block) {
+                final List<Statement> stmts = block.getStatements();
+                for(final ListIterator<Statement> li = stmts.listIterator(stmts.size()); li.hasPrevious();) {
+                    final Statement stmt = li.previous();
+                    // popStatements() guarantees that the only thing after a terminal statement are uninitialized
+                    // VarNodes. We skip past those, and set the terminal state of the block to the value of the
+                    // terminal state of the first statement that is not an uninitialized VarNode.
+                    if(!(stmt instanceof VarNode && ((VarNode)stmt).getInit() == null)) {
+                        return block.setIsTerminal(this, stmt.isTerminal());
+                    }
+                }
+                return block.setIsTerminal(this, false);
+            }
         });
     }
 
@@ -122,7 +140,7 @@
     public boolean enterBlock(final Block block) {
         final FunctionNode   function = lc.getCurrentFunction();
         if (lc.isFunctionBody() && function.isProgram() && !function.hasDeclaredFunctions()) {
-            new ExecuteNode(block.getLineNumber(), block.getToken(), block.getFinish(), LiteralNode.newInstance(block, ScriptRuntime.UNDEFINED)).accept(this);
+            new ExpressionStatement(function.getLineNumber(), block.getToken(), block.getFinish(), LiteralNode.newInstance(block, ScriptRuntime.UNDEFINED)).accept(this);
         }
         return true;
     }
@@ -132,24 +150,20 @@
         //now we have committed the entire statement list to the block, but we need to truncate
         //whatever is after the last terminal. block append won't append past it
 
-        Statement last = lc.getLastStatement();
 
         if (lc.isFunctionBody()) {
             final FunctionNode currentFunction = lc.getCurrentFunction();
             final boolean isProgram = currentFunction.isProgram();
+            final Statement last = lc.getLastStatement();
             final ReturnNode returnNode = new ReturnNode(
-                last == null ? block.getLineNumber() : last.getLineNumber(), //TODO?
+                last == null ? currentFunction.getLineNumber() : last.getLineNumber(), //TODO?
                 currentFunction.getToken(),
                 currentFunction.getFinish(),
                 isProgram ?
                     compilerConstant(RETURN) :
                     LiteralNode.newInstance(block, ScriptRuntime.UNDEFINED));
 
-            last = (Statement)returnNode.accept(this);
-        }
-
-        if (last != null && last.isTerminal()) {
-            return block.setIsTerminal(lc, true);
+            returnNode.accept(this);
         }
 
         return block;
@@ -183,23 +197,21 @@
     }
 
     @Override
-    public Node leaveExecuteNode(final ExecuteNode executeNode) {
-        final Node expr = executeNode.getExpression();
-        ExecuteNode node = executeNode;
+    public Node leaveExpressionStatement(final ExpressionStatement expressionStatement) {
+        final Expression expr = expressionStatement.getExpression();
+        ExpressionStatement node = expressionStatement;
 
         final FunctionNode currentFunction = lc.getCurrentFunction();
 
         if (currentFunction.isProgram()) {
-            if (!(expr instanceof Block) || expr instanceof FunctionNode) { // it's not a block, but can be a function
-                if (!isInternalExpression(expr) && !isEvalResultAssignment(expr)) {
-                    node = executeNode.setExpression(
-                        new BinaryNode(
-                            Token.recast(
-                                executeNode.getToken(),
-                                TokenType.ASSIGN),
-                            compilerConstant(RETURN),
-                        expr));
-                }
+            if (!isInternalExpression(expr) && !isEvalResultAssignment(expr)) {
+                node = expressionStatement.setExpression(
+                    new BinaryNode(
+                        Token.recast(
+                            expressionStatement.getToken(),
+                            TokenType.ASSIGN),
+                        compilerConstant(RETURN),
+                    expr));
             }
         }
 
@@ -207,6 +219,11 @@
     }
 
     @Override
+    public Node leaveBlockStatement(BlockStatement blockStatement) {
+        return addStatement(blockStatement);
+    }
+
+    @Override
     public Node leaveForNode(final ForNode forNode) {
         ForNode newForNode = forNode;
 
@@ -290,11 +307,11 @@
 
         final IdentNode exception = new IdentNode(token, finish, lc.getCurrentFunction().uniqueName("catch_all"));
 
-        final Block catchBody = new Block(lineNumber, token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), ThrowNode.IS_SYNTHETIC_RETHROW)).
+        final Block catchBody = new Block(token, finish, new ThrowNode(lineNumber, token, finish, new IdentNode(exception), ThrowNode.IS_SYNTHETIC_RETHROW)).
                 setIsTerminal(lc, true); //ends with throw, so terminal
 
         final CatchNode catchAllNode  = new CatchNode(lineNumber, token, finish, new IdentNode(exception), null, catchBody, CatchNode.IS_SYNTHETIC_RETHROW);
-        final Block     catchAllBlock = new Block(lineNumber, token, finish, catchAllNode);
+        final Block     catchAllBlock = new Block(token, finish, catchAllNode);
 
         //catchallblock -> catchallnode (catchnode) -> exception -> throw
 
@@ -343,14 +360,14 @@
                     if (!isTerminal(newStatements)) {
                         newStatements.add(throwNode);
                     }
-                    return new Block(throwNode.getLineNumber(), throwNode.getToken(), throwNode.getFinish(), newStatements);
+                    return BlockStatement.createReplacement(throwNode, newStatements);
                 }
                 return throwNode;
             }
 
             @Override
             public Node leaveBreakNode(final BreakNode breakNode) {
-                return copy(breakNode, Lower.this.lc.getBreakable(breakNode.getLabel()));
+                return copy(breakNode, (Node)Lower.this.lc.getBreakable(breakNode.getLabel()));
             }
 
             @Override
@@ -360,15 +377,15 @@
 
             @Override
             public Node leaveReturnNode(final ReturnNode returnNode) {
-                final Node  expr  = returnNode.getExpression();
+                final Expression expr  = returnNode.getExpression();
                 final List<Statement> newStatements = new ArrayList<>();
 
-                final Node resultNode;
+                final Expression resultNode;
                 if (expr != null) {
                     //we need to evaluate the result of the return in case it is complex while
                     //still in the try block, store it in a result value and return it afterwards
                     resultNode = new IdentNode(Lower.this.compilerConstant(RETURN));
-                    newStatements.add(new ExecuteNode(returnNode.getLineNumber(), returnNode.getToken(), returnNode.getFinish(), new BinaryNode(Token.recast(returnNode.getToken(), TokenType.ASSIGN), resultNode, expr)));
+                    newStatements.add(new ExpressionStatement(returnNode.getLineNumber(), returnNode.getToken(), returnNode.getFinish(), new BinaryNode(Token.recast(returnNode.getToken(), TokenType.ASSIGN), resultNode, expr)));
                 } else {
                     resultNode = null;
                 }
@@ -378,7 +395,7 @@
                     newStatements.add(expr == null ? returnNode : returnNode.setExpression(resultNode));
                 }
 
-                return new ExecuteNode(returnNode.getLineNumber(), returnNode.getToken(), returnNode.getFinish(), new Block(returnNode.getLineNumber(), returnNode.getToken(), lc.getCurrentBlock().getFinish(), newStatements));
+                return BlockStatement.createReplacement(returnNode, lc.getCurrentBlock().getFinish(), newStatements);
             }
 
             private Node copy(final Statement endpoint, final Node targetNode) {
@@ -387,7 +404,7 @@
                     if (!isTerminal(newStatements)) {
                         newStatements.add(endpoint);
                     }
-                    return new ExecuteNode(endpoint.getLineNumber(), endpoint.getToken(), endpoint.getFinish(), new Block(endpoint.getLineNumber(), endpoint.getToken(), finish, newStatements));
+                    return BlockStatement.createReplacement(endpoint, finish, newStatements);
                 }
                 return endpoint;
             }
@@ -449,7 +466,7 @@
         if (tryNode.getCatchBlocks().isEmpty()) {
             newTryNode = tryNode.setFinallyBody(null);
         } else {
-            Block outerBody = new Block(tryNode.getLineNumber(), tryNode.getToken(), tryNode.getFinish(), new ArrayList<Statement>(Arrays.asList(tryNode.setFinallyBody(null))));
+            Block outerBody = new Block(tryNode.getToken(), tryNode.getFinish(), new ArrayList<Statement>(Arrays.asList(tryNode.setFinallyBody(null))));
             newTryNode = tryNode.setBody(outerBody).setCatchBlocks(null);
         }
 
@@ -466,7 +483,7 @@
     public Node leaveVarNode(final VarNode varNode) {
         addStatement(varNode);
         if (varNode.getFlag(VarNode.IS_LAST_FUNCTION_DECLARATION) && lc.getCurrentFunction().isProgram()) {
-            new ExecuteNode(varNode.getLineNumber(), varNode.getToken(), varNode.getFinish(), new IdentNode(varNode.getName())).accept(this);
+            new ExpressionStatement(varNode.getLineNumber(), varNode.getToken(), varNode.getFinish(), new IdentNode(varNode.getName())).accept(this);
         }
         return varNode;
     }
@@ -499,7 +516,7 @@
      * @param function function called by a CallNode
      * @return transformed node to marker function or identity if not ident/access/indexnode
      */
-    private static Node markerFunction(final Node function) {
+    private static Expression markerFunction(final Expression function) {
         if (function instanceof IdentNode) {
             return ((IdentNode)function).setIsFunction();
         } else if (function instanceof BaseNode) {
@@ -541,15 +558,15 @@
     private CallNode checkEval(final CallNode callNode) {
         if (callNode.getFunction() instanceof IdentNode) {
 
-            final List<Node> args   = callNode.getArgs();
-            final IdentNode  callee = (IdentNode)callNode.getFunction();
+            final List<Expression> args = callNode.getArgs();
+            final IdentNode callee = (IdentNode)callNode.getFunction();
 
             // 'eval' call with at least one argument
             if (args.size() >= 1 && EVAL.symbolName().equals(callee.getName())) {
                 final FunctionNode currentFunction = lc.getCurrentFunction();
                 return callNode.setEvalArgs(
                     new CallNode.EvalArgs(
-                        ensureUniqueNamesIn(args.get(0)).accept(this),
+                        (Expression)ensureUniqueNamesIn(args.get(0)).accept(this),
                         compilerConstant(THIS),
                         evalLocation(callee),
                         currentFunction.isStrict()));
@@ -618,7 +635,7 @@
      * @param expression expression to check for internal symbol
      * @return true if internal, false otherwise
      */
-    private static boolean isInternalExpression(final Node expression) {
+    private static boolean isInternalExpression(final Expression expression) {
         final Symbol symbol = expression.getSymbol();
         return symbol != null && symbol.isInternal();
     }
--- a/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -41,10 +41,10 @@
     private final Class<?> structure;
 
     /** key set for object map */
-    private final String[] keys;
+    final List<String> keys;
 
     /** corresponding symbol set for object map */
-    private final Symbol[] symbols;
+    final List<Symbol> symbols;
 
     /**
      * Constructor
@@ -54,11 +54,9 @@
      * @param symbols   list of symbols for map
      */
     MapCreator(final Class<?> structure, final List<String> keys, final List<Symbol> symbols) {
-        final int size   = keys.size();
-
         this.structure = structure;
-        this.keys      = keys.toArray(new String[size]);
-        this.symbols   = symbols.toArray(new Symbol[size]);
+        this.keys      = keys;
+        this.symbols   = symbols;
     }
 
     /**
@@ -70,21 +68,37 @@
      *
      * @return New map populated with accessor properties.
      */
-    PropertyMap makeMap(final boolean hasArguments, final int fieldCount, final int fieldMaximum) {
+    PropertyMap makeFieldMap(final boolean hasArguments, final int fieldCount, final int fieldMaximum) {
         final List<Property> properties = new ArrayList<>();
-
         assert keys != null;
 
-        for (int i = 0; i < keys.length; i++) {
-            final String key    = keys[i];
-            final Symbol symbol = symbols[i];
+        for (int i = 0, length = keys.size(); i < length; i++) {
+            final String key    = keys.get(i);
+            final Symbol symbol = symbols.get(i);
 
             if (symbol != null && !ArrayIndex.isIntArrayIndex(key)) {
                 properties.add(new AccessorProperty(key, getPropertyFlags(symbol, hasArguments), structure, symbol.getFieldIndex()));
             }
         }
 
-        return PropertyMap.newMap(structure, properties, fieldCount, fieldMaximum);
+        return PropertyMap.newMap(properties, fieldCount, fieldMaximum, 0);
+    }
+
+    PropertyMap makeSpillMap(final boolean hasArguments) {
+        final List<Property> properties = new ArrayList<>();
+        int spillIndex = 0;
+        assert keys != null;
+
+        for (int i = 0, length = keys.size(); i < length; i++) {
+            final String key    = keys.get(i);
+            final Symbol symbol = symbols.get(i);
+
+            if (symbol != null && !ArrayIndex.isIntArrayIndex(key)) {
+                properties.add(new AccessorProperty(key, getPropertyFlags(symbol, hasArguments), spillIndex++));
+            }
+        }
+
+        return PropertyMap.newMap(properties, 0, 0, spillIndex);
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -74,11 +74,6 @@
     static final int FIELD_PADDING  = 4;
 
     /**
-     * Rounding when calculating the number of fields.
-     */
-    static final int FIELD_ROUNDING = 4;
-
-    /**
      * Debug field logger
      * Should we print debugging information for fields when they are generated and getters/setters are called?
      */
@@ -325,7 +320,6 @@
         final List<String> initFields   = addFields(classEmitter, fieldCount);
 
         final MethodEmitter init = newInitMethod(classEmitter);
-        initializeToUndefined(init, className, initFields);
         init.returnVoid();
         init.end();
 
@@ -441,13 +435,13 @@
      * @return Open method emitter.
      */
     private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
-        final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, Object.class);
+        final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
         init.begin();
         init.load(Type.OBJECT, JAVA_THIS.slot());
         init.load(Type.OBJECT, INIT_MAP.slot());
         init.load(Type.OBJECT, INIT_SCOPE.slot());
         init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
-        init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, Object.class));
+        init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));
 
         return init;
     }
@@ -709,6 +703,15 @@
         }
     }
 
+    /**
+     * Add padding to field count to avoid creating too many classes and have some spare fields
+     * @param count the field count
+     * @return the padded field count
+     */
+    static int getPaddedFieldCount(final int count) {
+        return count / FIELD_PADDING * FIELD_PADDING + FIELD_PADDING;
+    }
+
     //
     // Provide generic getters and setters for undefined types. If a type is undefined, all
     // and marshals the set to the correct setter depending on the type of the value being set.
--- a/nashorn/src/jdk/nashorn/internal/codegen/ObjectCreator.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/ObjectCreator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,10 +25,10 @@
 
 package jdk.nashorn.internal.codegen;
 
+import static jdk.nashorn.internal.codegen.CompilerConstants.SCOPE;
+
 import java.util.List;
-import static jdk.nashorn.internal.codegen.ObjectClassGenerator.FIELD_PADDING;
 import jdk.nashorn.internal.ir.Symbol;
-import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.PropertyMap;
 
 /**
@@ -36,9 +36,6 @@
  */
 public abstract class ObjectCreator {
 
-    /** Compile unit for this ObjectCreator, see CompileUnit */
-    //protected final CompileUnit   compileUnit;
-
     /** List of keys to initiate in this ObjectCreator */
     protected final List<String>  keys;
 
@@ -50,12 +47,7 @@
 
     private   final boolean       isScope;
     private   final boolean       hasArguments;
-    private         int           fieldCount;
-    private         int           paddedFieldCount;
-    private         int           paramCount;
-    private         String        fieldObjectClassName;
-    private         Class<?>      fieldObjectClass;
-    private         PropertyMap   propertyMap;
+    protected       PropertyMap   propertyMap;
 
     /**
      * Constructor
@@ -72,41 +64,6 @@
         this.symbols       = symbols;
         this.isScope       = isScope;
         this.hasArguments  = hasArguments;
-
-        countFields();
-        findClass();
-    }
-
-    /**
-     * Tally the number of fields and parameters.
-     */
-    private void countFields() {
-        for (final Symbol symbol : this.symbols) {
-            if (symbol != null) {
-                if (hasArguments() && symbol.isParam()) {
-                    symbol.setFieldIndex(paramCount++);
-                } else {
-                    symbol.setFieldIndex(fieldCount++);
-                }
-            }
-        }
-
-        paddedFieldCount = fieldCount + FIELD_PADDING;
-    }
-
-    /**
-     * Locate (or indirectly create) the object container class.
-     */
-    private void findClass() {
-        fieldObjectClassName = isScope() ?
-            ObjectClassGenerator.getClassName(fieldCount, paramCount) :
-            ObjectClassGenerator.getClassName(paddedFieldCount);
-
-        try {
-            this.fieldObjectClass = Context.forStructureClass(Compiler.binaryName(fieldObjectClassName));
-        } catch (final ClassNotFoundException e) {
-            throw new AssertionError("Nashorn has encountered an internal error.  Structure can not be created.");
-        }
     }
 
     /**
@@ -116,6 +73,12 @@
     protected abstract void makeObject(final MethodEmitter method);
 
     /**
+     * Construct the property map appropriate for the object.
+     * @return the newly created property map
+     */
+    protected abstract PropertyMap makeMap();
+
+    /**
      * Create a new MapCreator
      * @param clazz type of MapCreator
      * @return map creator instantiated by type
@@ -125,12 +88,11 @@
     }
 
     /**
-     * Construct the property map appropriate for the object.
-     * @return the newly created property map
+     * Loads the scope on the stack through the passed method emitter.
+     * @param method the method emitter to use
      */
-    protected PropertyMap makeMap() {
-        propertyMap = newMapCreator(fieldObjectClass).makeMap(hasArguments(), fieldCount, paddedFieldCount);
-        return propertyMap;
+    protected void loadScope(final MethodEmitter method) {
+        method.loadCompilerConstant(SCOPE);
     }
 
     /**
@@ -144,16 +106,6 @@
     }
 
     /**
-     * Get the class name for the object class,
-     * e.g. {@code com.nashorn.oracle.scripts.JO2P0}
-     *
-     * @return script class name
-     */
-    String getClassName() {
-        return fieldObjectClassName;
-    }
-
-    /**
      * Is this a scope object
      * @return true if scope
      */
--- a/nashorn/src/jdk/nashorn/internal/codegen/RangeAnalyzer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/RangeAnalyzer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,11 +28,11 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
-
 import jdk.nashorn.internal.codegen.types.Range;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.Assignment;
 import jdk.nashorn.internal.ir.BinaryNode;
+import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.IdentNode;
 import jdk.nashorn.internal.ir.LexicalContext;
@@ -87,7 +87,7 @@
     }
 
     //destination visited
-    private Symbol setRange(final Node dest, final Range range) {
+    private Symbol setRange(final Expression dest, final Range range) {
         if (range.isUnknown()) {
             return null;
         }
@@ -352,7 +352,6 @@
             range = range.isUnknown() ? Range.createGenericRange() : range;
 
             setRange(node.getName(), range);
-            setRange(node, range);
         }
 
         return node;
@@ -438,12 +437,12 @@
      * @return
      */
     private static Symbol findLoopCounter(final LoopNode node) {
-        final Node test = node.getTest();
+        final Expression test = node.getTest();
 
         if (test != null && test.isComparison()) {
             final BinaryNode binaryNode = (BinaryNode)test;
-            final Node lhs = binaryNode.lhs();
-            final Node rhs = binaryNode.rhs();
+            final Expression lhs = binaryNode.lhs();
+            final Expression rhs = binaryNode.rhs();
 
             //detect ident cmp int_literal
             if (lhs instanceof IdentNode && rhs instanceof LiteralNode && ((LiteralNode<?>)rhs).getType().isInteger()) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/codegen/SpillObjectCreator.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2010-2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.codegen;
+
+import static jdk.nashorn.internal.codegen.CompilerConstants.constructorNoLookup;
+import static jdk.nashorn.internal.codegen.types.Type.OBJECT;
+
+import java.util.List;
+import jdk.nashorn.internal.codegen.types.Type;
+import jdk.nashorn.internal.ir.Expression;
+import jdk.nashorn.internal.ir.LiteralNode;
+import jdk.nashorn.internal.ir.Symbol;
+import jdk.nashorn.internal.runtime.Property;
+import jdk.nashorn.internal.runtime.PropertyMap;
+import jdk.nashorn.internal.runtime.ScriptObject;
+import jdk.nashorn.internal.scripts.JO;
+
+/**
+ * An object creator that uses spill properties.
+ */
+public class SpillObjectCreator extends ObjectCreator {
+
+    private final List<Expression> values;
+
+    /**
+     * Constructor
+     *
+     * @param codegen  code generator
+     * @param keys     keys for fields in object
+     * @param symbols  symbols for fields in object
+     * @param values   list of values corresponding to keys
+     */
+    protected SpillObjectCreator(final CodeGenerator codegen, final List<String> keys, final List<Symbol> symbols, final List<Expression> values) {
+        super(codegen, keys, symbols, false, false);
+        this.values = values;
+        makeMap();
+    }
+
+    @Override
+    protected void makeObject(final MethodEmitter method) {
+        assert !isScope() : "spill scope objects are not currently supported";
+
+        final int      length       = keys.size();
+        final Object[] presetValues = new Object[propertyMap.size()];
+        final Class    clazz        = JO.class;
+
+        // Compute constant values
+        for (int i = 0; i < length; i++) {
+            final String key = keys.get(i);
+            final Property property = propertyMap.findProperty(key);
+
+            if (property != null) {
+                presetValues[property.getSlot()] = LiteralNode.objectAsConstant(values.get(i));
+            }
+        }
+
+        method._new(clazz).dup();
+        codegen.loadConstant(propertyMap);
+
+        method.invoke(constructorNoLookup(JO.class, PropertyMap.class));
+
+        method.dup();
+        codegen.loadConstant(presetValues);
+
+        // Create properties with non-constant values
+        for (int i = 0; i < length; i++) {
+            final String key = keys.get(i);
+            final Property property = propertyMap.findProperty(key);
+
+            if (property != null && presetValues[property.getSlot()] == LiteralNode.POSTSET_MARKER) {
+                method.dup();
+                method.load(property.getSlot());
+                codegen.load(values.get(i)).convert(OBJECT);
+                method.arraystore();
+                presetValues[property.getSlot()] = null;
+            }
+        }
+
+        method.putField(Type.typeFor(ScriptObject.class).getInternalName(), "spill", Type.OBJECT_ARRAY.getDescriptor());
+        final int callSiteFlags = codegen.getCallSiteFlags();
+
+        // Assign properties with valid array index keys
+        for (int i = 0; i < length; i++) {
+            final String key = keys.get(i);
+            final Property property = propertyMap.findProperty(key);
+            final Expression value = values.get(i);
+
+            if (property == null && value != null) {
+                method.dup();
+                method.load(keys.get(i));
+                codegen.load(value);
+                method.dynamicSetIndex(callSiteFlags);
+            }
+        }
+    }
+
+    @Override
+    protected PropertyMap makeMap() {
+        assert propertyMap == null : "property map already initialized";
+
+        propertyMap = new MapCreator(JO.class, keys, symbols) {
+            @Override
+            protected int getPropertyFlags(Symbol symbol, boolean hasArguments) {
+                return super.getPropertyFlags(symbol, hasArguments) | Property.IS_SPILL | Property.IS_ALWAYS_OBJECT;
+            }
+        }.makeSpillMap(false);
+
+        return propertyMap;
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/codegen/Splitter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/Splitter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -31,7 +31,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
@@ -221,14 +220,13 @@
      * @return New split node.
      */
     private SplitNode createBlockSplitNode(final Block parent, final FunctionNode function, final List<Statement> statements, final long weight) {
-        final int    lineNumber = parent.getLineNumber();
         final long   token      = parent.getToken();
         final int    finish     = parent.getFinish();
         final String name       = function.uniqueName(SPLIT_PREFIX.symbolName());
 
-        final Block newBlock = new Block(lineNumber, token, finish, statements);
+        final Block newBlock = new Block(token, finish, statements);
 
-        return new SplitNode(lineNumber, name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
+        return new SplitNode(name, newBlock, compiler.findUnit(weight + WeighNodes.FUNCTION_WEIGHT));
     }
 
     @Override
--- a/nashorn/src/jdk/nashorn/internal/codegen/WeighNodes.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/WeighNodes.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,7 +27,6 @@
 
 import java.util.List;
 import java.util.Map;
-
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.AccessNode;
 import jdk.nashorn.internal.ir.BinaryNode;
@@ -36,7 +35,7 @@
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.CatchNode;
 import jdk.nashorn.internal.ir.ContinueNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.IdentNode;
@@ -158,8 +157,8 @@
     }
 
     @Override
-    public Node leaveExecuteNode(final ExecuteNode executeNode) {
-        return executeNode;
+    public Node leaveExpressionStatement(final ExpressionStatement expressionStatement) {
+        return expressionStatement;
     }
 
     @Override
--- a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java	Fri Jul 26 14:07:32 2013 -0700
@@ -47,9 +47,8 @@
 import static jdk.internal.org.objectweb.asm.Opcodes.T_LONG;
 
 import java.lang.invoke.MethodHandle;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.nashorn.internal.codegen.CompilerConstants.Call;
 
@@ -548,19 +547,19 @@
      * @return the Type representing this class
      */
     public static Type typeFor(final Class<?> clazz) {
-        Type type = cache.get(clazz);
-
-        if (type == null) {
-            assert !clazz.isPrimitive() || clazz == void.class;
-            if (clazz.isArray()) {
-                type = new ArrayType(clazz);
-            } else {
-                type = new ObjectType(clazz);
-            }
-            cache.put(clazz, type);
+        final Type type = cache.get(clazz);
+        if(type != null) {
+            return type;
         }
-
-        return type;
+        assert !clazz.isPrimitive() || clazz == void.class;
+        final Type newType;
+        if (clazz.isArray()) {
+            newType = new ArrayType(clazz);
+        } else {
+            newType = new ObjectType(clazz);
+        }
+        final Type existingType = cache.putIfAbsent(clazz, newType);
+        return existingType == null ? newType : existingType;
     }
 
     @Override
@@ -663,35 +662,38 @@
         }
     }
 
+    /** Mappings between java classes and their Type singletons */
+    private static final ConcurrentMap<Class<?>, Type> cache = new ConcurrentHashMap<>();
+
     /**
      * This is the boolean singleton, used for all boolean types
      */
-    public static final Type BOOLEAN = new BooleanType();
+    public static final Type BOOLEAN = putInCache(new BooleanType());
 
     /**
      * This is an integer type, i.e INT, INT32.
      */
-    public static final Type INT = new IntType();
+    public static final Type INT = putInCache(new IntType());
 
     /**
      * This is the number singleton, used for all number types
      */
-    public static final Type NUMBER = new NumberType();
+    public static final Type NUMBER = putInCache(new NumberType());
 
     /**
      * This is the long singleton, used for all long types
      */
-    public static final Type LONG = new LongType();
+    public static final Type LONG = putInCache(new LongType());
 
     /**
      * A string singleton
      */
-    public static final Type STRING = new ObjectType(String.class);
+    public static final Type STRING = putInCache(new ObjectType(String.class));
 
     /**
      * This is the object singleton, used for all object types
      */
-    public static final Type OBJECT = new ObjectType();
+    public static final Type OBJECT = putInCache(new ObjectType());
 
     /**
      * This is the singleton for integer arrays
@@ -775,13 +777,13 @@
     };
 
     /** Singleton for method handle arrays used for properties etc. */
-    public static final ArrayType METHODHANDLE_ARRAY = new ArrayType(MethodHandle[].class);
+    public static final ArrayType METHODHANDLE_ARRAY = putInCache(new ArrayType(MethodHandle[].class));
 
     /** This is the singleton for string arrays */
-    public static final ArrayType STRING_ARRAY = new ArrayType(String[].class);
+    public static final ArrayType STRING_ARRAY = putInCache(new ArrayType(String[].class));
 
     /** This is the singleton for object arrays */
-    public static final ArrayType OBJECT_ARRAY = new ArrayType(Object[].class);
+    public static final ArrayType OBJECT_ARRAY = putInCache(new ArrayType(Object[].class));
 
     /** This type, always an object type, just a toString override */
     public static final Type THIS = new ObjectType() {
@@ -855,18 +857,8 @@
         }
     };
 
-    /** Mappings between java classes and their Type singletons */
-    private static final Map<Class<?>, Type> cache = Collections.synchronizedMap(new HashMap<Class<?>, Type>());
-
-    //TODO may need to be cleared, as all types are retained throughout code generation
-    static {
-        cache.put(BOOLEAN.getTypeClass(), BOOLEAN);
-        cache.put(INT.getTypeClass(),     INT);
-        cache.put(LONG.getTypeClass(),    LONG);
-        cache.put(NUMBER.getTypeClass(),  NUMBER);
-        cache.put(STRING.getTypeClass(),  STRING);
-        cache.put(OBJECT.getTypeClass(),  OBJECT);
-        cache.put(OBJECT_ARRAY.getTypeClass(), OBJECT_ARRAY);
+    private static <T extends Type> T putInCache(T type) {
+        cache.put(type.getTypeClass(), type);
+        return type;
     }
-
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/AccessNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/AccessNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -45,12 +45,12 @@
      * @param base      base node
      * @param property  property
      */
-    public AccessNode(final long token, final int finish, final Node base, final IdentNode property) {
+    public AccessNode(final long token, final int finish, final Expression base, final IdentNode property) {
         super(token, finish, base, false, false);
         this.property = property.setIsPropertyName();
     }
 
-    private AccessNode(final AccessNode accessNode, final Node base, final IdentNode property, final boolean isFunction, final boolean hasCallSiteType) {
+    private AccessNode(final AccessNode accessNode, final Expression base, final IdentNode property, final boolean isFunction, final boolean hasCallSiteType) {
         super(accessNode, base, isFunction, hasCallSiteType);
         this.property = property;
     }
@@ -63,7 +63,7 @@
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterAccessNode(this)) {
             return visitor.leaveAccessNode(
-                setBase(base.accept(visitor)).
+                setBase((Expression)base.accept(visitor)).
                 setProperty((IdentNode)property.accept(visitor)));
         }
         return this;
@@ -103,7 +103,7 @@
         return property;
     }
 
-    private AccessNode setBase(final Node base) {
+    private AccessNode setBase(final Expression base) {
         if (this.base == base) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/Assignment.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/Assignment.java	Fri Jul 26 14:07:32 2013 -0700
@@ -31,7 +31,7 @@
  *
  * @param <D> the destination type
  */
-public interface Assignment<D extends Node> {
+public interface Assignment<D extends Expression> {
 
     /**
      * Get assignment destination
@@ -45,7 +45,7 @@
      *
      * @return get the assignment source node
      */
-    public Node getAssignmentSource();
+    public Expression getAssignmentSource();
 
     /**
      * Set assignment destination node.
--- a/nashorn/src/jdk/nashorn/internal/ir/BaseNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BaseNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -26,6 +26,7 @@
 package jdk.nashorn.internal.ir;
 
 import static jdk.nashorn.internal.codegen.ObjectClassGenerator.DEBUG_FIELDS;
+
 import jdk.nashorn.internal.codegen.ObjectClassGenerator;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.annotations.Immutable;
@@ -37,10 +38,10 @@
  * @see IndexNode
  */
 @Immutable
-public abstract class BaseNode extends Node implements FunctionCall, TypeOverride<BaseNode> {
+public abstract class BaseNode extends Expression implements FunctionCall, TypeOverride<BaseNode> {
 
     /** Base Node. */
-    protected final Node base;
+    protected final Expression base;
 
     private final boolean isFunction;
 
@@ -55,7 +56,7 @@
      * @param isFunction is this a function
      * @param hasCallSiteType does this access have a callsite type
      */
-    public BaseNode(final long token, final int finish, final Node base, final boolean isFunction, final boolean hasCallSiteType) {
+    public BaseNode(final long token, final int finish, final Expression base, final boolean isFunction, final boolean hasCallSiteType) {
         super(token, base.getStart(), finish);
         this.base            = base;
         this.isFunction      = isFunction;
@@ -69,7 +70,7 @@
      * @param isFunction is this a function
      * @param hasCallSiteType does this access have a callsite type
      */
-    protected BaseNode(final BaseNode baseNode, final Node base, final boolean isFunction, final boolean hasCallSiteType) {
+    protected BaseNode(final BaseNode baseNode, final Expression base, final boolean isFunction, final boolean hasCallSiteType) {
         super(baseNode);
         this.base            = base;
         this.isFunction      = isFunction;
@@ -80,7 +81,7 @@
      * Get the base node for this access
      * @return the base node
      */
-    public Node getBase() {
+    public Expression getBase() {
         return base;
     }
 
--- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,11 +34,11 @@
  * BinaryNode nodes represent two operand operations.
  */
 @Immutable
-public final class BinaryNode extends Node implements Assignment<Node> {
+public final class BinaryNode extends Expression implements Assignment<Expression> {
     /** Left hand side argument. */
-    private final Node lhs;
+    private final Expression lhs;
 
-    private final Node rhs;
+    private final Expression rhs;
 
     /**
      * Constructor
@@ -47,13 +47,13 @@
      * @param lhs    left hand side
      * @param rhs    right hand side
      */
-    public BinaryNode(final long token, final Node lhs, final Node rhs) {
+    public BinaryNode(final long token, final Expression lhs, final Expression rhs) {
         super(token, lhs.getStart(), rhs.getFinish());
         this.lhs   = lhs;
         this.rhs   = rhs;
     }
 
-    private BinaryNode(final BinaryNode binaryNode, final Node lhs, final Node rhs) {
+    private BinaryNode(final BinaryNode binaryNode, final Expression lhs, final Expression rhs) {
         super(binaryNode);
         this.lhs = lhs;
         this.rhs = rhs;
@@ -141,17 +141,17 @@
     }
 
     @Override
-    public Node getAssignmentDest() {
+    public Expression getAssignmentDest() {
         return isAssignment() ? lhs() : null;
     }
 
     @Override
-    public Node setAssignmentDest(Node n) {
+    public BinaryNode setAssignmentDest(Expression n) {
         return setLHS(n);
     }
 
     @Override
-    public Node getAssignmentSource() {
+    public Expression getAssignmentSource() {
         return rhs();
     }
 
@@ -162,7 +162,7 @@
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterBinaryNode(this)) {
-            return visitor.leaveBinaryNode(setLHS(lhs.accept(visitor)).setRHS(rhs.accept(visitor)));
+            return visitor.leaveBinaryNode(setLHS((Expression)lhs.accept(visitor)).setRHS((Expression)rhs.accept(visitor)));
         }
 
         return this;
@@ -218,7 +218,7 @@
      * Get the left hand side expression for this node
      * @return the left hand side expression
      */
-    public Node lhs() {
+    public Expression lhs() {
         return lhs;
     }
 
@@ -226,7 +226,7 @@
      * Get the right hand side expression for this node
      * @return the left hand side expression
      */
-    public Node rhs() {
+    public Expression rhs() {
         return rhs;
     }
 
@@ -235,7 +235,7 @@
      * @param lhs new left hand side expression
      * @return a node equivalent to this one except for the requested change.
      */
-    public BinaryNode setLHS(final Node lhs) {
+    public BinaryNode setLHS(final Expression lhs) {
         if (this.lhs == lhs) {
             return this;
         }
@@ -247,7 +247,7 @@
      * @param rhs new left hand side expression
      * @return a node equivalent to this one except for the requested change.
      */
-    public BinaryNode setRHS(final Node rhs) {
+    public BinaryNode setRHS(final Expression rhs) {
         if (this.rhs == rhs) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/Block.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/Block.java	Fri Jul 26 14:07:32 2013 -0700
@@ -38,11 +38,10 @@
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 
 /**
- * IR representation for a list of statements and functions. All provides the
- * basis for script body.
+ * IR representation for a list of statements.
  */
 @Immutable
-public class Block extends BreakableNode implements Flags<Block> {
+public class Block extends Node implements BreakableNode, Flags<Block> {
     /** List of statements */
     protected final List<Statement> statements;
 
@@ -52,6 +51,9 @@
     /** Entry label. */
     protected final Label entryLabel;
 
+    /** Break label. */
+    private final Label breakLabel;
+
     /** Does the block/function need a new scope? */
     protected final int flags;
 
@@ -76,17 +78,17 @@
     /**
      * Constructor
      *
-     * @param lineNumber line number
      * @param token      token
      * @param finish     finish
      * @param statements statements
      */
-    public Block(final int lineNumber, final long token, final int finish, final Statement... statements) {
-        super(lineNumber, token, finish, new Label("block_break"));
+    public Block(final long token, final int finish, final Statement... statements) {
+        super(token, finish);
 
         this.statements = Arrays.asList(statements);
         this.symbols    = new LinkedHashMap<>();
         this.entryLabel = new Label("block_entry");
+        this.breakLabel = new Label("block_break");
         this.flags     =  0;
     }
 
@@ -98,8 +100,8 @@
      * @param finish     finish
      * @param statements statements
      */
-    public Block(final int lineNumber, final long token, final int finish, final List<Statement> statements) {
-        this(lineNumber, token, finish, statements.toArray(new Statement[statements.size()]));
+    public Block(final long token, final int finish, final List<Statement> statements) {
+        this(token, finish, statements.toArray(new Statement[statements.size()]));
     }
 
     private Block(final Block block, final int finish, final List<Statement> statements, final int flags, final Map<String, Symbol> symbols) {
@@ -108,6 +110,7 @@
         this.flags      = flags;
         this.symbols    = new LinkedHashMap<>(symbols); //todo - symbols have no dependencies on any IR node and can as far as we understand it be shallow copied now
         this.entryLabel = new Label(block.entryLabel);
+        this.breakLabel = new Label(block.breakLabel);
         this.finish     = finish;
     }
 
@@ -223,6 +226,11 @@
         return entryLabel;
     }
 
+    @Override
+    public Label getBreakLabel() {
+        return breakLabel;
+    }
+
     /**
      * Get the list of statements in this block
      *
@@ -322,7 +330,17 @@
     }
 
     @Override
-    protected boolean isBreakableWithoutLabel() {
+    public boolean isBreakableWithoutLabel() {
         return false;
     }
+
+    @Override
+    public List<Label> getLabels() {
+        return Collections.singletonList(breakLabel);
+    }
+
+    @Override
+    public Node accept(NodeVisitor<? extends LexicalContext> visitor) {
+        return Acceptor.accept(this, visitor);
+    }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,7 +29,6 @@
 import java.util.ArrayList;
 import java.util.Deque;
 import java.util.List;
-import java.util.ListIterator;
 
 /**
  * This is a subclass of lexical context used for filling
@@ -63,6 +62,16 @@
         return sstack.pop();
     }
 
+    /**
+     * Override this method to perform some additional processing on the block after its statements have been set. By
+     * default does nothing and returns the original block.
+     * @param block the block to operate on
+     * @return a modified block.
+     */
+    protected Block afterSetStatements(Block block) {
+        return block;
+    }
+
     @SuppressWarnings("unchecked")
     @Override
     public <T extends LexicalContextNode> T pop(final T node) {
@@ -70,6 +79,7 @@
         if (node instanceof Block) {
             final List<Statement> newStatements = popStatements();
             expected = (T)((Block)node).setStatements(this, newStatements);
+            expected = (T)afterSetStatements((Block)expected);
             if (!sstack.isEmpty()) {
                 lastStatement = lastStatement(sstack.peek());
             }
@@ -107,10 +117,7 @@
     }
 
     private static Statement lastStatement(final List<Statement> statements) {
-        for (final ListIterator<Statement> iter = statements.listIterator(statements.size()); iter.hasPrevious(); ) {
-            final Statement node = iter.previous();
-            return node;
-        }
-        return null;
+        final int s = statements.size();
+        return s == 0 ? null : statements.get(s - 1);
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/ir/BlockStatement.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import java.util.List;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+/**
+ * Represents a block used as a statement.
+ */
+public class BlockStatement extends Statement {
+    /** Block to execute. */
+    private final Block block;
+
+    /**
+     * Constructor
+     *
+     * @param lineNumber line number
+     * @param block the block to execute
+     */
+    public BlockStatement(final int lineNumber, final Block block) {
+        super(lineNumber, block.getToken(), block.getFinish());
+        this.block = block;
+    }
+
+    private BlockStatement(final BlockStatement blockStatement, final Block block) {
+        super(blockStatement);
+        this.block = block;
+    }
+
+    /**
+     * Use this method to create a block statement meant to replace a single statement.
+     * @param stmt the statement to replace
+     * @param newStmts the statements for the new block statement
+     * @return a block statement with the new statements. It will have the line number, token, and finish of the
+     * original statement.
+     */
+    public static Statement createReplacement(final Statement stmt, final List<Statement> newStmts) {
+        return createReplacement(stmt, stmt.getFinish(), newStmts);
+    }
+
+    /**
+     * Use this method to create a block statement meant to replace a single statement.
+     * @param stmt the statement to replace
+     * @param finish the new finish for the block
+     * @param newStmts the statements for the new block statement
+     * @return a block statement with the new statements. It will have the line number, and token of the
+     * original statement.
+     */
+    public static Statement createReplacement(final Statement stmt, int finish, final List<Statement> newStmts) {
+        return new BlockStatement(stmt.getLineNumber(), new Block(stmt.getToken(), finish, newStmts));
+    }
+
+    @Override
+    public boolean isTerminal() {
+        return block.isTerminal();
+    }
+
+    @Override
+    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+        if (visitor.enterBlockStatement(this)) {
+            return visitor.leaveBlockStatement(setBlock((Block)block.accept(visitor)));
+        }
+
+        return this;
+    }
+
+    @Override
+    public void toString(final StringBuilder sb) {
+        block.toString(sb);
+    }
+
+    /**
+     * Return the block to be executed
+     * @return the block
+     */
+    public Block getBlock() {
+        return block;
+    }
+
+    /**
+     * Reset the block to be executed
+     * @param block the block
+     * @return new or same execute node
+     */
+    public BlockStatement setBlock(final Block block) {
+        if (this.block == block) {
+            return this;
+        }
+        return new BlockStatement(this, block);
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,46 +25,14 @@
 
 package jdk.nashorn.internal.ir;
 
-import java.util.Arrays;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.Label;
-import jdk.nashorn.internal.ir.annotations.Immutable;
 
 /**
  * This class represents a node from which control flow can execute
  * a {@code break} statement
  */
-@Immutable
-public abstract class BreakableNode extends LexicalContextNode {
-
-    /** break label. */
-    protected final Label breakLabel;
-
-    /**
-     * Constructor
-     *
-     * @param lineNumber line number
-     * @param token      token
-     * @param finish     finish
-     * @param breakLabel break label
-     */
-    protected BreakableNode(final int lineNumber, final long token, final int finish, final Label breakLabel) {
-        super(lineNumber, token, finish);
-        this.breakLabel = breakLabel;
-    }
-
-    /**
-     * Copy constructor
-     *
-     * @param breakableNode source node
-     */
-    protected BreakableNode(final BreakableNode breakableNode) {
-        super(breakableNode);
-        this.breakLabel = new Label(breakableNode.getBreakLabel());
-    }
-
-    @Override
+public interface BreakableNode extends LexicalContextNode {
     public abstract Node ensureUniqueLabels(final LexicalContext lc);
 
     /**
@@ -72,17 +40,13 @@
      * e.g. everything but Blocks, basically
      * @return true if breakable without label
      */
-    protected boolean isBreakableWithoutLabel() {
-        return true;
-    }
+    public boolean isBreakableWithoutLabel();
 
     /**
      * Return the break label, i.e. the location to go to on break.
      * @return the break label
      */
-    public Label getBreakLabel() {
-        return breakLabel;
-    }
+    public Label getBreakLabel();
 
     /**
      * Return the labels associated with this node. Breakable nodes that
@@ -90,8 +54,5 @@
      * afterwards the node in code
      * @return list of labels representing locations around this node
      */
-    public List<Label> getLabels() {
-        return Arrays.asList(breakLabel);
-    }
-
+    public List<Label> getLabels();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/ir/BreakableStatement.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import java.util.Collections;
+import java.util.List;
+import jdk.nashorn.internal.codegen.Label;
+import jdk.nashorn.internal.ir.annotations.Immutable;
+
+@Immutable
+abstract class BreakableStatement extends LexicalContextStatement implements BreakableNode {
+
+    /** break label. */
+    protected final Label breakLabel;
+
+    /**
+     * Constructor
+     *
+     * @param lineNumber line number
+     * @param token      token
+     * @param finish     finish
+     * @param breakLabel break label
+     */
+    protected BreakableStatement(final int lineNumber, final long token, final int finish, final Label breakLabel) {
+        super(lineNumber, token, finish);
+        this.breakLabel = breakLabel;
+    }
+
+    /**
+     * Copy constructor
+     *
+     * @param breakableNode source node
+     */
+    protected BreakableStatement(final BreakableStatement breakableNode) {
+        super(breakableNode);
+        this.breakLabel = new Label(breakableNode.getBreakLabel());
+    }
+
+    /**
+     * Check whether this can be broken out from without using a label,
+     * e.g. everything but Blocks, basically
+     * @return true if breakable without label
+     */
+    @Override
+    public boolean isBreakableWithoutLabel() {
+        return true;
+    }
+
+    /**
+     * Return the break label, i.e. the location to go to on break.
+     * @return the break label
+     */
+    @Override
+    public Label getBreakLabel() {
+        return breakLabel;
+    }
+
+    /**
+     * Return the labels associated with this node. Breakable nodes that
+     * aren't LoopNodes only have a break label - the location immediately
+     * afterwards the node in code
+     * @return list of labels representing locations around this node
+     */
+    @Override
+    public List<Label> getLabels() {
+        return Collections.singletonList(breakLabel);
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/ir/CallNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/CallNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,7 +27,6 @@
 
 import java.util.Collections;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.annotations.Ignore;
 import jdk.nashorn.internal.ir.annotations.Immutable;
@@ -37,27 +36,29 @@
  * IR representation for a function call.
  */
 @Immutable
-public final class CallNode extends LexicalContextNode implements TypeOverride<CallNode> {
+public final class CallNode extends LexicalContextExpression implements TypeOverride<CallNode> {
 
     private final Type type;
 
     /** Function identifier or function body. */
-    private final Node function;
+    private final Expression function;
 
     /** Call arguments. */
-    private final List<Node> args;
+    private final List<Expression> args;
 
     /** Is this a "new" operation */
     public static final int IS_NEW        = 0x1;
 
     private final int flags;
 
+    private final int lineNumber;
+
     /**
      * Arguments to be passed to builtin {@code eval} function
      */
     public static class EvalArgs {
         /** evaluated code */
-        private final Node code;
+        private final Expression code;
 
         /** 'this' passed to evaluated code */
         private final IdentNode evalThis;
@@ -76,7 +77,7 @@
          * @param location   location for the eval call
          * @param strictMode is this a call from a strict context?
          */
-        public EvalArgs(final Node code, final IdentNode evalThis, final String location, final boolean strictMode) {
+        public EvalArgs(final Expression code, final IdentNode evalThis, final String location, final boolean strictMode) {
             this.code = code;
             this.evalThis = evalThis;
             this.location = location;
@@ -87,11 +88,11 @@
          * Return the code that is to be eval:ed by this eval function
          * @return code as an AST node
          */
-        public Node getCode() {
+        public Expression getCode() {
             return code;
         }
 
-        private EvalArgs setCode(final Node code) {
+        private EvalArgs setCode(final Expression code) {
             if (this.code == code) {
                 return this;
             }
@@ -143,18 +144,20 @@
      * @param function   the function to call
      * @param args       args to the call
      */
-    public CallNode(final int lineNumber, final long token, final int finish, final Node function, final List<Node> args) {
-        super(lineNumber, token, finish);
+    public CallNode(final int lineNumber, final long token, final int finish, final Expression function, final List<Expression> args) {
+        super(token, finish);
 
-        this.function = function;
-        this.args     = args;
-        this.flags    = 0;
-        this.type     = null;
-        this.evalArgs = null;
+        this.function   = function;
+        this.args       = args;
+        this.flags      = 0;
+        this.type       = null;
+        this.evalArgs   = null;
+        this.lineNumber = lineNumber;
     }
 
-    private CallNode(final CallNode callNode, final Node function, final List<Node> args, final int flags, final Type type, final EvalArgs evalArgs) {
+    private CallNode(final CallNode callNode, final Expression function, final List<Expression> args, final int flags, final Type type, final EvalArgs evalArgs) {
         super(callNode);
+        this.lineNumber = callNode.lineNumber;
         this.function = function;
         this.args = args;
         this.flags = flags;
@@ -162,6 +165,14 @@
         this.evalArgs = evalArgs;
     }
 
+    /**
+     * Returns the line number.
+     * @return the line number.
+     */
+    public int getLineNumber() {
+        return lineNumber;
+    }
+
     @Override
     public Type getType() {
         if (hasCallSiteType()) {
@@ -198,13 +209,13 @@
     public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterCallNode(this)) {
             final CallNode newCallNode = (CallNode)visitor.leaveCallNode(
-                    setFunction(function.accept(visitor)).
-                    setArgs(Node.accept(visitor, Node.class, args)).
+                    setFunction((Expression)function.accept(visitor)).
+                    setArgs(Node.accept(visitor, Expression.class, args)).
                     setFlags(flags).
                     setType(null, lc, type).
                     setEvalArgs(evalArgs == null ?
                             null :
-                            evalArgs.setCode(evalArgs.getCode().accept(visitor)).
+                            evalArgs.setCode((Expression)evalArgs.getCode().accept(visitor)).
                                 setThis((IdentNode)evalArgs.getThis().accept(visitor))));
             // Theoretically, we'd need to instead pass lc to every setter and do a replacement on each. In practice,
             // setType from TypeOverride can't accept a lc, and we don't necessarily want to go there now.
@@ -248,7 +259,7 @@
      * Get the arguments for the call
      * @return a list of arguments
      */
-    public List<Node> getArgs() {
+    public List<Expression> getArgs() {
         return Collections.unmodifiableList(args);
     }
 
@@ -256,7 +267,7 @@
      * Reset the arguments for the call
      * @param args new arguments list
      */
-    private CallNode setArgs(final List<Node> args) {
+    private CallNode setArgs(final List<Expression> args) {
         if (this.args == args) {
             return this;
         }
@@ -297,7 +308,7 @@
      * Return the function expression that this call invokes
      * @return the function
      */
-    public Node getFunction() {
+    public Expression getFunction() {
         return function;
     }
 
@@ -306,7 +317,7 @@
      * @param function the function
      * @return same node or new one on state change
      */
-    public CallNode setFunction(final Node function) {
+    public CallNode setFunction(final Expression function) {
         if (this.function == function) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/CaseNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/CaseNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -36,7 +36,7 @@
 @Immutable
 public final class CaseNode extends Node {
     /** Test expression. */
-    private final Node test;
+    private final Expression test;
 
     /** Statements. */
     private final Block body;
@@ -52,7 +52,7 @@
      * @param test     case test node, can be any node in JavaScript
      * @param body     case body
      */
-    public CaseNode(final long token, final int finish, final Node test, final Block body) {
+    public CaseNode(final long token, final int finish, final Expression test, final Block body) {
         super(token, finish);
 
         this.test  = test;
@@ -60,7 +60,7 @@
         this.entry = new Label("entry");
     }
 
-    CaseNode(final CaseNode caseNode, final Node test, final Block body) {
+    CaseNode(final CaseNode caseNode, final Expression test, final Block body) {
         super(caseNode);
 
         this.test  = test;
@@ -80,7 +80,7 @@
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterCaseNode(this)) {
-            final Node  newTest = test == null ? null : test.accept(visitor);
+            final Expression newTest = test == null ? null : (Expression)test.accept(visitor);
             final Block newBody = body == null ? null : (Block)body.accept(visitor);
 
             return visitor.leaveCaseNode(setTest(newTest).setBody(newBody));
@@ -120,7 +120,7 @@
      * Get the test expression for this case node
      * @return the test
      */
-    public Node getTest() {
+    public Expression getTest() {
         return test;
     }
 
@@ -129,7 +129,7 @@
      * @param test new test expression
      * @return new or same CaseNode
      */
-    public CaseNode setTest(final Node test) {
+    public CaseNode setTest(final Expression test) {
         if (this.test == test) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/CatchNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/CatchNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -37,7 +37,7 @@
     private final IdentNode exception;
 
     /** Exception condition. */
-    private final Node exceptionCondition;
+    private final Expression exceptionCondition;
 
     /** Catch body. */
     private final Block body;
@@ -58,7 +58,7 @@
      * @param body               catch body
      * @param flags              flags
      */
-    public CatchNode(final int lineNumber, final long token, final int finish, final IdentNode exception, final Node exceptionCondition, final Block body, final int flags) {
+    public CatchNode(final int lineNumber, final long token, final int finish, final IdentNode exception, final Expression exceptionCondition, final Block body, final int flags) {
         super(lineNumber, token, finish);
         this.exception          = exception;
         this.exceptionCondition = exceptionCondition;
@@ -66,7 +66,7 @@
         this.flags              = flags;
     }
 
-    private CatchNode(final CatchNode catchNode, final IdentNode exception, final Node exceptionCondition, final Block body, final int flags) {
+    private CatchNode(final CatchNode catchNode, final IdentNode exception, final Expression exceptionCondition, final Block body, final int flags) {
         super(catchNode);
         this.exception          = exception;
         this.exceptionCondition = exceptionCondition;
@@ -83,7 +83,7 @@
         if (visitor.enterCatchNode(this)) {
             return visitor.leaveCatchNode(
                 setException((IdentNode)exception.accept(visitor)).
-                setExceptionCondition(exceptionCondition == null ? null : exceptionCondition.accept(visitor)).
+                setExceptionCondition(exceptionCondition == null ? null : (Expression)exceptionCondition.accept(visitor)).
                 setBody((Block)body.accept(visitor)));
         }
 
@@ -119,7 +119,7 @@
      * Get the exception condition for this catch block
      * @return the exception condition
      */
-    public Node getExceptionCondition() {
+    public Expression getExceptionCondition() {
         return exceptionCondition;
     }
 
@@ -128,7 +128,7 @@
      * @param exceptionCondition the new exception condition
      * @return new or same CatchNode
      */
-    public CatchNode setExceptionCondition(final Node exceptionCondition) {
+    public CatchNode setExceptionCondition(final Expression exceptionCondition) {
         if (this.exceptionCondition == exceptionCondition) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/ExecuteNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.nashorn.internal.ir;
-
-import jdk.nashorn.internal.ir.annotations.Immutable;
-import jdk.nashorn.internal.ir.visitor.NodeVisitor;
-
-/**
- * IR representation for executing bare expressions. Basically, an expression
- * node means "this code will be executed" and evaluating it results in
- * statements being added to the IR
- */
-@Immutable
-public final class ExecuteNode extends Statement {
-    /** Expression to execute. */
-    private final Node expression;
-
-    /**
-     * Constructor
-     *
-     * @param lineNumber line number
-     * @param token      token
-     * @param finish     finish
-     * @param expression the expression to execute
-     */
-    public ExecuteNode(final int lineNumber, final long token, final int finish, final Node expression) {
-        super(lineNumber, token, finish);
-        this.expression = expression;
-    }
-
-    private ExecuteNode(final ExecuteNode executeNode, final Node expression) {
-        super(executeNode);
-        this.expression = expression;
-    }
-
-    @Override
-    public boolean isTerminal() {
-        return expression.isTerminal();
-    }
-
-    @Override
-    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
-        if (visitor.enterExecuteNode(this)) {
-            return visitor.leaveExecuteNode(setExpression(expression.accept(visitor)));
-        }
-
-        return this;
-    }
-
-    @Override
-    public void toString(final StringBuilder sb) {
-        expression.toString(sb);
-    }
-
-    /**
-     * Return the expression to be executed
-     * @return the expression
-     */
-    public Node getExpression() {
-        return expression;
-    }
-
-    /**
-     * Reset the expression to be executed
-     * @param expression the expression
-     * @return new or same execute node
-     */
-    public ExecuteNode setExpression(final Node expression) {
-        if (this.expression == expression) {
-            return this;
-        }
-        return new ExecuteNode(this, expression);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/ir/Expression.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import jdk.nashorn.internal.codegen.types.Type;
+
+/**
+ * Common superclass for all expression nodes. Expression nodes can have
+ * an associated symbol as well as a type.
+ *
+ */
+public abstract class Expression extends Node {
+    private Symbol symbol;
+
+    Expression(long token, int start, int finish) {
+        super(token, start, finish);
+    }
+
+    Expression(long token, int finish) {
+        super(token, finish);
+    }
+
+    Expression(Expression expr) {
+        super(expr);
+        this.symbol = expr.symbol;
+    }
+
+    /**
+     * Return the Symbol the compiler has assigned to this Node. The symbol
+     * is the place where it's expression value is stored after evaluation
+     *
+     * @return the symbol
+     */
+    public Symbol getSymbol() {
+        return symbol;
+    }
+
+    /**
+     * Assign a symbol to this node. See {@link Expression#getSymbol()} for explanation
+     * of what a symbol is
+     *
+     * @param lc lexical context
+     * @param symbol the symbol
+     * @return new node
+     */
+    public Expression setSymbol(final LexicalContext lc, final Symbol symbol) {
+        if (this.symbol == symbol) {
+            return this;
+        }
+        final Expression newExpr = (Expression)clone();
+        newExpr.symbol = symbol;
+        return newExpr;
+    }
+
+    /**
+     * Check if the expression has a type. The default behavior is to go into the symbol
+     * and check the symbol type, but there may be overrides, for example in
+     * getters that require a different type than the internal representation
+     *
+     * @return true if a type exists
+     */
+    public boolean hasType() {
+        return getSymbol() != null;
+    }
+
+    /**
+     * Returns the type of the expression. Typically this is the symbol type. No types
+     * are stored in the expression itself, unless it implements TypeOverride.
+     *
+     * @return the type of the node.
+     */
+    public Type getType() {
+        assert hasType() : this + " has no type";
+        return symbol.getSymbolType();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/ir/ExpressionStatement.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import jdk.nashorn.internal.ir.annotations.Immutable;
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+/**
+ * IR representation for executing bare expressions. Basically, an expression
+ * node means "this code will be executed" and evaluating it results in
+ * statements being added to the IR
+ */
+@Immutable
+public final class ExpressionStatement extends Statement {
+    /** Expression to execute. */
+    private final Expression expression;
+
+    /**
+     * Constructor
+     *
+     * @param lineNumber line number
+     * @param token      token
+     * @param finish     finish
+     * @param expression the expression to execute
+     */
+    public ExpressionStatement(final int lineNumber, final long token, final int finish, final Expression expression) {
+        super(lineNumber, token, finish);
+        this.expression = expression;
+    }
+
+    private ExpressionStatement(final ExpressionStatement expressionStatement, final Expression expression) {
+        super(expressionStatement);
+        this.expression = expression;
+    }
+
+    @Override
+    public boolean isTerminal() {
+        return expression.isTerminal();
+    }
+
+    @Override
+    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+        if (visitor.enterExpressionStatement(this)) {
+            return visitor.leaveExpressionStatement(setExpression((Expression)expression.accept(visitor)));
+        }
+
+        return this;
+    }
+
+    @Override
+    public void toString(final StringBuilder sb) {
+        expression.toString(sb);
+    }
+
+    /**
+     * Return the expression to be executed
+     * @return the expression
+     */
+    public Expression getExpression() {
+        return expression;
+    }
+
+    /**
+     * Reset the expression to be executed
+     * @param expression the expression
+     * @return new or same execute node
+     */
+    public ExpressionStatement setExpression(final Expression expression) {
+        if (this.expression == expression) {
+            return this;
+        }
+        return new ExpressionStatement(this, expression);
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/ir/ForNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/ForNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,10 +34,10 @@
 @Immutable
 public final class ForNode extends LoopNode {
     /** Initialize expression. */
-    private final Node init;
+    private final Expression init;
 
     /** Test expression. */
-    private final Node modify;
+    private final Expression modify;
 
     /** Iterator symbol. */
     private Symbol iterator;
@@ -65,14 +65,14 @@
      * @param modify     modify
      * @param flags      flags
      */
-    public ForNode(final int lineNumber, final long token, final int finish, final Node init, final Node test, final Block body, final Node modify, final int flags) {
+    public ForNode(final int lineNumber, final long token, final int finish, final Expression init, final Expression test, final Block body, final Expression modify, final int flags) {
         super(lineNumber, token, finish, test, body, false);
         this.init   = init;
         this.modify = modify;
         this.flags  = flags;
     }
 
-    private ForNode(final ForNode forNode, final Node init, final Node test, final Block body, final Node modify, final int flags, final boolean controlFlowEscapes) {
+    private ForNode(final ForNode forNode, final Expression init, final Expression test, final Block body, final Expression modify, final int flags, final boolean controlFlowEscapes) {
         super(forNode, test, body, controlFlowEscapes);
         this.init   = init;
         this.modify = modify;
@@ -86,12 +86,12 @@
     }
 
     @Override
-    protected Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
+    public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterForNode(this)) {
             return visitor.leaveForNode(
-                setInit(lc, init == null ? null : init.accept(visitor)).
-                setTest(lc, test == null ? null : test.accept(visitor)).
-                setModify(lc, modify == null ? null : modify.accept(visitor)).
+                setInit(lc, init == null ? null : (Expression)init.accept(visitor)).
+                setTest(lc, test == null ? null : (Expression)test.accept(visitor)).
+                setModify(lc, modify == null ? null : (Expression)modify.accept(visitor)).
                 setBody(lc, (Block)body.accept(visitor)));
         }
 
@@ -140,7 +140,7 @@
      * Get the initialization expression for this for loop
      * @return the initialization expression
      */
-    public Node getInit() {
+    public Expression getInit() {
         return init;
     }
 
@@ -150,7 +150,7 @@
      * @param init new initialization expression
      * @return new for node if changed or existing if not
      */
-    public ForNode setInit(final LexicalContext lc, final Node init) {
+    public ForNode setInit(final LexicalContext lc, final Expression init) {
         if (this.init == init) {
             return this;
         }
@@ -212,7 +212,7 @@
      * Get the modification expression for this ForNode
      * @return the modification expression
      */
-    public Node getModify() {
+    public Expression getModify() {
         return modify;
     }
 
@@ -222,7 +222,7 @@
      * @param modify new modification expression
      * @return new for node if changed or existing if not
      */
-    public ForNode setModify(final LexicalContext lc, final Node modify) {
+    public ForNode setModify(final LexicalContext lc, final Expression modify) {
         if (this.modify == modify) {
             return this;
         }
@@ -230,12 +230,12 @@
     }
 
     @Override
-    public Node getTest() {
+    public Expression getTest() {
         return test;
     }
 
     @Override
-    public ForNode setTest(final LexicalContext lc, final Node test) {
+    public ForNode setTest(final LexicalContext lc, final Expression test) {
         if (this.test == test) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/FunctionNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -47,7 +47,7 @@
  * IR representation for function (or script.)
  */
 @Immutable
-public final class FunctionNode extends LexicalContextNode implements Flags<FunctionNode> {
+public final class FunctionNode extends LexicalContextExpression implements Flags<FunctionNode> {
 
     /** Type used for all FunctionNodes */
     public static final Type FUNCTION_TYPE = Type.typeFor(ScriptFunction.class);
@@ -131,9 +131,15 @@
     @Ignore
     private final Compiler.Hints hints;
 
+    /** Properties of this object assigned in this function */
+    @Ignore
+    private HashSet<String> thisProperties;
+
     /** Function flags. */
     private final int flags;
 
+    private final int lineNumber;
+
     /** Is anonymous function flag. */
     public static final int IS_ANONYMOUS                = 1 << 0;
 
@@ -156,6 +162,10 @@
     /** Does a nested function contain eval? If it does, then all variables in this function might be get/set by it. */
     public static final int HAS_NESTED_EVAL = 1 << 6;
 
+    /** Does this function have any blocks that create a scope? This is used to determine if the function needs to
+     * have a local variable slot for the scope symbol. */
+    public static final int HAS_SCOPE_BLOCK = 1 << 7;
+
     /**
      * Flag this function as one that defines the identifier "arguments" as a function parameter or nested function
      * name. This precludes it from needing to have an Arguments object defined as "arguments" local variable. Note that
@@ -226,9 +236,10 @@
         final List<IdentNode> parameters,
         final FunctionNode.Kind kind,
         final int flags) {
-        super(lineNumber, token, finish);
+        super(token, finish);
 
         this.source           = source;
+        this.lineNumber       = lineNumber;
         this.ident            = ident;
         this.name             = name;
         this.kind             = kind;
@@ -258,7 +269,7 @@
         final FunctionNode snapshot,
         final Compiler.Hints hints) {
         super(functionNode);
-
+        this.lineNumber       = functionNode.lineNumber;
         this.flags            = flags;
         this.name             = name;
         this.returnType       = returnType;
@@ -277,6 +288,7 @@
         this.declaredSymbols = functionNode.declaredSymbols;
         this.kind            = functionNode.kind;
         this.firstToken      = functionNode.firstToken;
+        this.thisProperties  = functionNode.thisProperties;
     }
 
     @Override
@@ -296,6 +308,14 @@
     }
 
     /**
+     * Returns the line number.
+     * @return the line number.
+     */
+    public int getLineNumber() {
+        return lineNumber;
+    }
+
+    /**
      * Get the version of this function node's code as it looked upon construction
      * i.e typically parsed and nothing else
      * @return initial version of function node
@@ -572,7 +592,7 @@
         if(this.body == body) {
             return this;
         }
-        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags, name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
+        return Node.replaceInLexicalContext(lc, this, new FunctionNode(this, lastToken, flags | (body.needsScope() ? FunctionNode.HAS_SCOPE_BLOCK : 0), name, returnType, compileUnit, compilationState, body, parameters, snapshot, hints));
     }
 
     /**
@@ -614,6 +634,33 @@
     }
 
     /**
+     * Register a property assigned to the this object in this function.
+     * @param key the property name
+     */
+    public void addThisProperty(final String key) {
+        if (thisProperties == null) {
+            thisProperties = new HashSet<>();
+        }
+        thisProperties.add(key);
+    }
+
+    /**
+     * Get the number of properties assigned to the this object in this function.
+     * @return number of properties
+     */
+    public int countThisProperties() {
+        return thisProperties == null ? 0 : thisProperties.size();
+    }
+
+    /**
+     * Returns true if any of the blocks in this function create their own scope.
+     * @return true if any of the blocks in this function create their own scope.
+     */
+    public boolean hasScopeBlock() {
+        return getFlag(HAS_SCOPE_BLOCK);
+    }
+
+    /**
      * Return the kind of this function
      * @see FunctionNode.Kind
      * @return the kind
--- a/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,6 +29,7 @@
 import static jdk.nashorn.internal.codegen.CompilerConstants.__FILE__;
 import static jdk.nashorn.internal.codegen.CompilerConstants.__LINE__;
 import static jdk.nashorn.internal.codegen.ObjectClassGenerator.DEBUG_FIELDS;
+
 import jdk.nashorn.internal.codegen.ObjectClassGenerator;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.annotations.Immutable;
@@ -38,7 +39,7 @@
  * IR representation for an identifier.
  */
 @Immutable
-public final class IdentNode extends Node implements PropertyKey, TypeOverride<IdentNode>, FunctionCall {
+public final class IdentNode extends Expression implements PropertyKey, TypeOverride<IdentNode>, FunctionCall {
     private static final int PROPERTY_NAME    = 1 << 0;
     private static final int INITIALIZED_HERE = 1 << 1;
     private static final int FUNCTION         = 1 << 2;
--- a/nashorn/src/jdk/nashorn/internal/ir/IfNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/IfNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,7 +34,7 @@
 @Immutable
 public final class IfNode extends Statement {
     /** Test expression. */
-    private final Node test;
+    private final Expression test;
 
     /** Pass statements. */
     private final Block pass;
@@ -52,14 +52,14 @@
      * @param pass       block to execute when test passes
      * @param fail       block to execute when test fails or null
      */
-    public IfNode(final int lineNumber, final long token, final int finish, final Node test, final Block pass, final Block fail) {
+    public IfNode(final int lineNumber, final long token, final int finish, final Expression test, final Block pass, final Block fail) {
         super(lineNumber, token, finish);
         this.test = test;
         this.pass = pass;
         this.fail = fail;
     }
 
-    private IfNode(final IfNode ifNode, final Node test, final Block pass, final Block fail) {
+    private IfNode(final IfNode ifNode, final Expression test, final Block pass, final Block fail) {
         super(ifNode);
         this.test = test;
         this.pass = pass;
@@ -75,7 +75,7 @@
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterIfNode(this)) {
             return visitor.leaveIfNode(
-                setTest(test.accept(visitor)).
+                setTest((Expression)test.accept(visitor)).
                 setPass((Block)pass.accept(visitor)).
                 setFail(fail == null ? null : (Block)fail.accept(visitor)));
         }
@@ -124,7 +124,7 @@
      * Get the test expression for this IfNode
      * @return the test expression
      */
-    public Node getTest() {
+    public Expression getTest() {
         return test;
     }
 
@@ -133,7 +133,7 @@
      * @param test a new test expression
      * @return new or same IfNode
      */
-    public IfNode setTest(final Node test) {
+    public IfNode setTest(final Expression test) {
         if (this.test == test) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/IndexNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/IndexNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -35,7 +35,7 @@
 @Immutable
 public final class IndexNode extends BaseNode {
     /** Property index. */
-    private final Node index;
+    private final Expression index;
 
     /**
      * Constructors
@@ -45,12 +45,12 @@
      * @param base    base node for access
      * @param index   index for access
      */
-    public IndexNode(final long token, final int finish, final Node base, final Node index) {
+    public IndexNode(final long token, final int finish, final Expression base, final Expression index) {
         super(token, finish, base, false, false);
         this.index = index;
     }
 
-    private IndexNode(final IndexNode indexNode, final Node base, final Node index, final boolean isFunction, final boolean hasCallSiteType) {
+    private IndexNode(final IndexNode indexNode, final Expression base, final Expression index, final boolean isFunction, final boolean hasCallSiteType) {
         super(indexNode, base, isFunction, hasCallSiteType);
         this.index = index;
     }
@@ -59,8 +59,8 @@
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterIndexNode(this)) {
             return visitor.leaveIndexNode(
-                setBase(base.accept(visitor)).
-                setIndex(index.accept(visitor)));
+                setBase((Expression)base.accept(visitor)).
+                setIndex((Expression)index.accept(visitor)));
         }
         return this;
     }
@@ -95,11 +95,11 @@
      * Get the index expression for this IndexNode
      * @return the index
      */
-    public Node getIndex() {
+    public Expression getIndex() {
         return index;
     }
 
-    private IndexNode setBase(final Node base) {
+    private IndexNode setBase(final Expression base) {
         if (this.base == base) {
             return this;
         }
@@ -111,7 +111,7 @@
      * @param index new index expression
      * @return a node equivalent to this one except for the requested change.
      */
-    public IndexNode setIndex(Node index) {
+    public IndexNode setIndex(Expression index) {
         if(this.index == index) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/LabelNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LabelNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,7 +32,7 @@
  * IR representation for a labeled statement.
  */
 @Immutable
-public final class LabelNode extends LexicalContextNode {
+public final class LabelNode extends LexicalContextStatement {
     /** Label ident. */
     private final IdentNode label;
 
--- a/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContext.java	Fri Jul 26 14:07:32 2013 -0700
@@ -54,13 +54,16 @@
 
     /**
      * Set the flags for a lexical context node on the stack. Does not
-     * replace the flags, but rather adds to them
+     * replace the flags, but rather adds to them.
      *
      * @param node  node
      * @param flag  new flag to set
      */
     public void setFlag(final LexicalContextNode node, final int flag) {
         if (flag != 0) {
+            // Use setBlockNeedsScope() instead
+            assert !(flag == Block.NEEDS_SCOPE && node instanceof Block);
+
             for (int i = sp - 1; i >= 0; i--) {
                 if (stack[i] == node) {
                     flags[i] |= flag;
@@ -72,6 +75,29 @@
     }
 
     /**
+     * Marks the block as one that creates a scope. Note that this method must
+     * be used instead of {@link #setFlag(LexicalContextNode, int)} with
+     * {@link Block#NEEDS_SCOPE} because it atomically also sets the
+     * {@link FunctionNode#HAS_SCOPE_BLOCK} flag on the block's containing
+     * function.
+     * @param block the block that needs to be marked as creating a scope.
+     */
+    public void setBlockNeedsScope(final Block block) {
+        for (int i = sp - 1; i >= 0; i--) {
+            if (stack[i] == block) {
+                flags[i] |= Block.NEEDS_SCOPE;
+                for(int j = i - 1; j >=0; j --) {
+                    if(stack[j] instanceof FunctionNode) {
+                        flags[j] |= FunctionNode.HAS_SCOPE_BLOCK;
+                        return;
+                    }
+                }
+            }
+        }
+        assert false;
+    }
+
+    /**
      * Get the flags for a lexical context node on the stack
      * @param node node
      * @return the flags for the node
@@ -550,19 +576,20 @@
         final StringBuffer sb = new StringBuffer();
         sb.append("[ ");
         for (int i = 0; i < sp; i++) {
-            final Node node = stack[i];
+            final Object node = stack[i];
             sb.append(node.getClass().getSimpleName());
             sb.append('@');
             sb.append(Debug.id(node));
             sb.append(':');
             if (node instanceof FunctionNode) {
-                final Source source = ((FunctionNode)node).getSource();
+                final FunctionNode fn = (FunctionNode)node;
+                final Source source = fn.getSource();
                 String src = source.toString();
                 if (src.indexOf(File.pathSeparator) != -1) {
                     src = src.substring(src.lastIndexOf(File.pathSeparator));
                 }
                 src += ' ';
-                src += source.getLine(node.getStart());
+                src += source.getLine(fn.getStart());
                 sb.append(src);
             }
             sb.append(' ');
@@ -605,7 +632,7 @@
 
         private T findNext() {
             for (int i = index; i >= 0; i--) {
-                final Node node = stack[i];
+                final Object node = stack[i];
                 if (node == until) {
                     return null;
                 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContextExpression.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+abstract class LexicalContextExpression extends Expression implements LexicalContextNode {
+
+    LexicalContextExpression(LexicalContextExpression expr) {
+        super(expr);
+    }
+
+    LexicalContextExpression(long token, int start, int finish) {
+        super(token, start, finish);
+    }
+
+    LexicalContextExpression(long token, int finish) {
+        super(token, finish);
+    }
+
+    @Override
+    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+        return Acceptor.accept(this, visitor);
+    }
+
+    /**
+     * Set the symbol and replace in lexical context if applicable
+     * @param lc     lexical context
+     * @param symbol symbol
+     * @return new node if symbol changed
+     */
+    @Override
+    public Expression setSymbol(final LexicalContext lc, final Symbol symbol) {
+        return Node.replaceInLexicalContext(lc, this, (LexicalContextExpression)super.setSymbol(null, symbol));
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/ir/LexicalContextNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContextNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -26,31 +26,12 @@
 
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 
+
 /**
- * Superclass for nodes that can be part of the lexical context
+ * Interface for nodes that can be part of the lexical context.
  * @see LexicalContext
  */
-public abstract class LexicalContextNode extends Statement {
-    /**
-     * Constructor
-     *
-     * @param lineNumber line number
-     * @param token      token
-     * @param finish     finish
-     */
-    protected LexicalContextNode(final int lineNumber, final long token, final int finish) {
-        super(lineNumber, token, finish);
-    }
-
-    /**
-     * Copy constructor
-     *
-     * @param node source node
-     */
-    protected LexicalContextNode(final LexicalContextNode node) {
-        super(node);
-    }
-
+public interface LexicalContextNode {
     /**
      * Accept function for the node given a lexical context. It must be prepared
      * to replace itself if present in the lexical context
@@ -60,25 +41,15 @@
      *
      * @return new node or same node depending on state change
      */
-    protected abstract Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor);
-
-    @Override
-    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
-        final LexicalContext lc = visitor.getLexicalContext();
-        lc.push(this);
-        final LexicalContextNode newNode = (LexicalContextNode)accept(lc, visitor);
-        return lc.pop(newNode);
-    }
+    Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor);
 
-    /**
-     * Set the symbol and replace in lexical context if applicable
-     * @param lc     lexical context
-     * @param symbol symbol
-     * @return new node if symbol changed
-     */
-    @Override
-    public Node setSymbol(final LexicalContext lc, final Symbol symbol) {
-        return Node.replaceInLexicalContext(lc, this, (LexicalContextNode)super.setSymbol(null, symbol));
+    // Would be a default method on Java 8
+    static class Acceptor {
+        static Node accept(LexicalContextNode node, final NodeVisitor<? extends LexicalContext> visitor) {
+            final LexicalContext lc = visitor.getLexicalContext();
+            lc.push(node);
+            final LexicalContextNode newNode = (LexicalContextNode)node.accept(lc, visitor);
+            return (Node)lc.pop(newNode);
+        }
     }
-
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContextStatement.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.ir;
+
+import jdk.nashorn.internal.ir.visitor.NodeVisitor;
+
+abstract class LexicalContextStatement extends Statement implements LexicalContextNode {
+    /**
+     * Constructor
+     *
+     * @param lineNumber line number
+     * @param token      token
+     * @param finish     finish
+     */
+    protected LexicalContextStatement(final int lineNumber, final long token, final int finish) {
+        super(lineNumber, token, finish);
+    }
+
+    /**
+     * Copy constructor
+     *
+     * @param node source node
+     */
+    protected LexicalContextStatement(final LexicalContextStatement node) {
+        super(node);
+    }
+
+    @Override
+    public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
+        return Acceptor.accept(this, visitor);
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -45,10 +45,13 @@
  * @param <T> the literal type
  */
 @Immutable
-public abstract class LiteralNode<T> extends Node implements PropertyKey {
+public abstract class LiteralNode<T> extends Expression implements PropertyKey {
     /** Literal value */
     protected final T value;
 
+    /** Marker for values that must be computed at runtime */
+    public static final Object POSTSET_MARKER = new Object();
+
     /**
      * Constructor
      *
@@ -495,6 +498,30 @@
         return new LexerTokenLiteralNode(parent.getToken(), parent.getFinish(), value);
     }
 
+    /**
+     * Get the constant value for an object, or {@link #POSTSET_MARKER} if the value can't be statically computed.
+     *
+     * @param object a node or value object
+     * @return the constant value or {@code POSTSET_MARKER}
+     */
+    public static Object objectAsConstant(final Object object) {
+        if (object == null) {
+            return null;
+        } else if (object instanceof Number || object instanceof String || object instanceof Boolean) {
+            return object;
+        } else if (object instanceof LiteralNode) {
+            return objectAsConstant(((LiteralNode<?>)object).getValue());
+        } else if (object instanceof UnaryNode) {
+            final UnaryNode unaryNode = (UnaryNode)object;
+
+            if (unaryNode.isTokenType(TokenType.CONVERT) && unaryNode.getType().isObject()) {
+                return objectAsConstant(unaryNode.rhs());
+            }
+        }
+
+        return POSTSET_MARKER;
+    }
+
     private static final class NullLiteralNode extends LiteralNode<Object> {
 
         private NullLiteralNode(final long token, final int finish) {
@@ -524,12 +551,7 @@
     /**
      * Array literal node class.
      */
-    public static final class ArrayLiteralNode extends LiteralNode<Node[]> {
-        private static class PostsetMarker {
-            //empty
-        }
-
-        private static PostsetMarker POSTSET_MARKER = new PostsetMarker();
+    public static final class ArrayLiteralNode extends LiteralNode<Expression[]> {
 
         /** Array element type. */
         private Type elementType;
@@ -597,7 +619,7 @@
          * @param finish  finish
          * @param value   array literal value, a Node array
          */
-        protected ArrayLiteralNode(final long token, final int finish, final Node[] value) {
+        protected ArrayLiteralNode(final long token, final int finish, final Expression[] value) {
             super(Token.recast(token, TokenType.ARRAY), finish, value);
             this.elementType = Type.UNKNOWN;
         }
@@ -606,7 +628,7 @@
          * Copy constructor
          * @param node source array literal node
          */
-        private ArrayLiteralNode(final ArrayLiteralNode node, final Node[] value) {
+        private ArrayLiteralNode(final ArrayLiteralNode node, final Expression[] value) {
             super(node, value);
             this.elementType = node.elementType;
             this.presets     = node.presets;
@@ -715,7 +737,7 @@
         }
 
         private void analyzeElements() {
-            for (final Node node : value) {
+            for (final Expression node : value) {
                 if (node == null) {
                     elementType = elementType.widest(Type.OBJECT); //no way to represent undefined as number
                     break;
@@ -740,24 +762,6 @@
             }
         }
 
-        private Object objectAsConstant(final Object object) {
-            if (object == null) {
-                return null;
-            } else if (object instanceof Number || object instanceof String || object instanceof Boolean) {
-                return object;
-            } else if (object instanceof LiteralNode) {
-                return objectAsConstant(((LiteralNode<?>)object).getValue());
-            } else if (object instanceof UnaryNode) {
-                final UnaryNode unaryNode = (UnaryNode)object;
-
-                if (unaryNode.isTokenType(TokenType.CONVERT) && unaryNode.getType().isObject()) {
-                    return objectAsConstant(unaryNode.rhs());
-                }
-            }
-
-            return POSTSET_MARKER;
-        }
-
         @Override
         public Node[] getArray() {
             return value;
@@ -822,15 +826,15 @@
         @Override
         public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
             if (visitor.enterLiteralNode(this)) {
-                final List<Node> oldValue = Arrays.asList(value);
-                final List<Node> newValue = Node.accept(visitor, Node.class, oldValue);
+                final List<Expression> oldValue = Arrays.asList(value);
+                final List<Expression> newValue = Node.accept(visitor, Expression.class, oldValue);
                 return visitor.leaveLiteralNode(oldValue != newValue ? setValue(newValue) : this);
             }
             return this;
         }
 
-        private ArrayLiteralNode setValue(final List<Node> value) {
-            return new ArrayLiteralNode(this, value.toArray(new Node[value.size()]));
+        private ArrayLiteralNode setValue(final List<Expression> value) {
+            return new ArrayLiteralNode(this, value.toArray(new Expression[value.size()]));
         }
 
         @Override
@@ -862,8 +866,8 @@
      *
      * @return the new literal node
      */
-    public static LiteralNode<Node[]> newInstance(final long token, final int finish, final List<Node> value) {
-        return new ArrayLiteralNode(token, finish, value.toArray(new Node[value.size()]));
+    public static LiteralNode<Expression[]> newInstance(final long token, final int finish, final List<Expression> value) {
+        return new ArrayLiteralNode(token, finish, value.toArray(new Expression[value.size()]));
     }
 
 
@@ -875,8 +879,8 @@
      *
      * @return the new literal node
      */
-    public static LiteralNode<?> newInstance(final Node parent, final List<Node> value) {
-        return new ArrayLiteralNode(parent.getToken(), parent.getFinish(), value.toArray(new Node[value.size()]));
+    public static LiteralNode<?> newInstance(final Node parent, final List<Expression> value) {
+        return new ArrayLiteralNode(parent.getToken(), parent.getFinish(), value.toArray(new Expression[value.size()]));
     }
 
     /**
@@ -888,7 +892,7 @@
      *
      * @return the new literal node
      */
-    public static LiteralNode<Node[]> newInstance(final long token, final int finish, final Node[] value) {
+    public static LiteralNode<Expression[]> newInstance(final long token, final int finish, final Expression[] value) {
         return new ArrayLiteralNode(token, finish, value);
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/LoopNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LoopNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,18 +27,17 @@
 
 import java.util.Arrays;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.Label;
 
 /**
  * A loop node, for example a while node, do while node or for node
  */
-public abstract class LoopNode extends BreakableNode {
+public abstract class LoopNode extends BreakableStatement {
     /** loop continue label. */
     protected final Label continueLabel;
 
     /** Loop test node, null if infinite */
-    protected final Node test;
+    protected final Expression test;
 
     /** Loop body */
     protected final Block body;
@@ -56,7 +55,7 @@
      * @param body               loop body
      * @param controlFlowEscapes controlFlowEscapes
      */
-    protected LoopNode(final int lineNumber, final long token, final int finish, final Node test, final Block body, final boolean controlFlowEscapes) {
+    protected LoopNode(final int lineNumber, final long token, final int finish, final Expression test, final Block body, final boolean controlFlowEscapes) {
         super(lineNumber, token, finish, new Label("while_break"));
         this.continueLabel = new Label("while_continue");
         this.test = test;
@@ -72,7 +71,7 @@
      * @param body     new body
      * @param controlFlowEscapes controlFlowEscapes
      */
-    protected LoopNode(final LoopNode loopNode, final Node test, final Block body, final boolean controlFlowEscapes) {
+    protected LoopNode(final LoopNode loopNode, final Expression test, final Block body, final boolean controlFlowEscapes) {
         super(loopNode);
         this.continueLabel = new Label(loopNode.continueLabel);
         this.test = test;
@@ -151,7 +150,7 @@
      * Get the test for this for node
      * @return the test
      */
-    public abstract Node getTest();
+    public abstract Expression getTest();
 
     /**
      * Set the test for this for node
@@ -160,7 +159,7 @@
      * @param test new test
      * @return same or new node depending on if test was changed
      */
-    public abstract LoopNode setTest(final LexicalContext lc, final Node test);
+    public abstract LoopNode setTest(final LexicalContext lc, final Expression test);
 
     /**
      * Set the control flow escapes flag for this node.
--- a/nashorn/src/jdk/nashorn/internal/ir/Node.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/Node.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,7 +27,6 @@
 
 import java.util.ArrayList;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 import jdk.nashorn.internal.parser.Token;
@@ -37,9 +36,6 @@
  * Nodes are used to compose Abstract Syntax Trees.
  */
 public abstract class Node implements Cloneable {
-    /** Node symbol. */
-    private Symbol symbol;
-
     /** Start of source range. */
     protected final int start;
 
@@ -81,34 +77,11 @@
      */
     protected Node(final Node node) {
         this.token  = node.token;
-        this.symbol = node.symbol;
         this.start  = node.start;
         this.finish = node.finish;
     }
 
     /**
-     * Check if the node has a type. The default behavior is to go into the symbol
-     * and check the symbol type, but there may be overrides, for example in
-     * getters that require a different type than the internal representation
-     *
-     * @return true if a type exists
-     */
-    public boolean hasType() {
-        return getSymbol() != null;
-    }
-
-    /**
-     * Returns the type of the node. Typically this is the symbol type. No types
-     * are stored in the node itself, unless it implements TypeOverride
-     *
-     * @return the type of the node.
-     */
-    public Type getType() {
-        assert hasType() : this + " has no type";
-        return symbol.getSymbolType();
-    }
-
-    /**
      * Is this an atom node - for example a literal or an identity
      *
      * @return true if atom
@@ -235,16 +208,6 @@
         return start;
     }
 
-    /**
-     * Return the Symbol the compiler has assigned to this Node. The symbol
-     * is the place where it's expression value is stored after evaluation
-     *
-     * @return the symbol
-     */
-    public Symbol getSymbol() {
-        return symbol;
-    }
-
     @Override
     protected Object clone() {
         try {
@@ -254,24 +217,6 @@
         }
     }
 
-    /**
-     * Assign a symbol to this node. See {@link Node#getSymbol()} for explanation
-     * of what a symbol is
-     *
-     * @param lc lexical context
-     * @param symbol the symbol
-     * @return new node
-     */
-    public Node setSymbol(final LexicalContext lc, final Symbol symbol) {
-        if (this.symbol == symbol) {
-            return this;
-        }
-        final Node newNode = (Node)clone();
-        newNode.symbol = symbol;
-        return newNode;
-    }
-
-
     @Override
     public final boolean equals(final Object other) {
         return super.equals(other);
--- a/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/ObjectNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,7 +34,7 @@
  * IR representation of an object literal.
  */
 @Immutable
-public final class ObjectNode extends Node {
+public final class ObjectNode extends Expression {
 
     /** Literal elements. */
     private final List<PropertyNode> elements;
--- a/nashorn/src/jdk/nashorn/internal/ir/PropertyNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/PropertyNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -38,7 +38,7 @@
     private final PropertyKey key;
 
     /** Property value. */
-    private final Node value;
+    private final Expression value;
 
     /** Property getter. */
     private final FunctionNode getter;
@@ -56,7 +56,7 @@
      * @param getter  getter function body
      * @param setter  setter function body
      */
-    public PropertyNode(final long token, final int finish, final PropertyKey key, final Node value, final FunctionNode getter, final FunctionNode setter) {
+    public PropertyNode(final long token, final int finish, final PropertyKey key, final Expression value, final FunctionNode getter, final FunctionNode setter) {
         super(token, finish);
         this.key    = key;
         this.value  = value;
@@ -64,7 +64,7 @@
         this.setter = setter;
     }
 
-    private PropertyNode(final PropertyNode propertyNode, final PropertyKey key, final Node value, final FunctionNode getter, final FunctionNode setter) {
+    private PropertyNode(final PropertyNode propertyNode, final PropertyKey key, final Expression value, final FunctionNode getter, final FunctionNode setter) {
         super(propertyNode);
         this.key    = key;
         this.value  = value;
@@ -85,7 +85,7 @@
         if (visitor.enterPropertyNode(this)) {
             return visitor.leavePropertyNode(
                 setKey((PropertyKey)((Node)key).accept(visitor)).
-                setValue(value == null ? null : value.accept(visitor)).
+                setValue(value == null ? null : (Expression)value.accept(visitor)).
                 setGetter(getter == null ? null : (FunctionNode)getter.accept(visitor)).
                 setSetter(setter == null ? null : (FunctionNode)setter.accept(visitor)));
         }
@@ -140,8 +140,8 @@
      * Return the key for this property node
      * @return the key
      */
-    public Node getKey() {
-        return (Node)key;
+    public Expression getKey() {
+        return (Expression)key;
     }
 
     private PropertyNode setKey(final PropertyKey key) {
@@ -175,7 +175,7 @@
      * Get the value of this property
      * @return property value
      */
-    public Node getValue() {
+    public Expression getValue() {
         return value;
     }
 
@@ -184,7 +184,7 @@
      * @param value new value
      * @return same node or new node if state changed
      */
-    public PropertyNode setValue(final Node value) {
+    public PropertyNode setValue(final Expression value) {
         if (this.value == value) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/ReturnNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/ReturnNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,6 +27,7 @@
 
 import static jdk.nashorn.internal.parser.TokenType.RETURN;
 import static jdk.nashorn.internal.parser.TokenType.YIELD;
+
 import jdk.nashorn.internal.ir.annotations.Immutable;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
 
@@ -36,7 +37,7 @@
 @Immutable
 public class ReturnNode extends Statement {
     /** Optional expression. */
-    private final Node expression;
+    private final Expression expression;
 
     /**
      * Constructor
@@ -46,12 +47,12 @@
      * @param finish     finish
      * @param expression expression to return
      */
-    public ReturnNode(final int lineNumber, final long token, final int finish, final Node expression) {
+    public ReturnNode(final int lineNumber, final long token, final int finish, final Expression expression) {
         super(lineNumber, token, finish);
         this.expression = expression;
     }
 
-    private ReturnNode(final ReturnNode returnNode, final Node expression) {
+    private ReturnNode(final ReturnNode returnNode, final Expression expression) {
         super(returnNode);
         this.expression = expression;
     }
@@ -89,7 +90,7 @@
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterReturnNode(this)) {
             if (expression != null) {
-                return visitor.leaveReturnNode(setExpression(expression.accept(visitor)));
+                return visitor.leaveReturnNode(setExpression((Expression)expression.accept(visitor)));
             }
             return visitor.leaveReturnNode(this);
         }
@@ -111,7 +112,7 @@
      * Get the expression this node returns
      * @return return expression, or null if void return
      */
-    public Node getExpression() {
+    public Expression getExpression() {
         return expression;
     }
 
@@ -120,7 +121,7 @@
      * @param expression new expression, or null if void return
      * @return new or same return node
      */
-    public ReturnNode setExpression(final Node expression) {
+    public ReturnNode setExpression(final Expression expression) {
         if (this.expression == expression) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/RuntimeNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/RuntimeNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,7 +29,6 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.annotations.Immutable;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
@@ -39,7 +38,7 @@
  * IR representation for a runtime call.
  */
 @Immutable
-public class RuntimeNode extends Node implements TypeOverride<RuntimeNode> {
+public class RuntimeNode extends Expression implements TypeOverride<RuntimeNode> {
 
     /**
      * Request enum used for meta-information about the runtime request
@@ -53,8 +52,6 @@
         NEW,
         /** Typeof operator */
         TYPEOF,
-        /** void type */
-        VOID,
         /** Reference error type */
         REFERENCE_ERROR,
         /** Delete operator */
@@ -269,7 +266,7 @@
     private final Request request;
 
     /** Call arguments. */
-    private final List<Node> args;
+    private final List<Expression> args;
 
     /** Call site override - e.g. we know that a ScriptRuntime.ADD will return an int */
     private final Type callSiteType;
@@ -285,7 +282,7 @@
      * @param request the request
      * @param args    arguments to request
      */
-    public RuntimeNode(final long token, final int finish, final Request request, final List<Node> args) {
+    public RuntimeNode(final long token, final int finish, final Request request, final List<Expression> args) {
         super(token, finish);
 
         this.request      = request;
@@ -294,7 +291,7 @@
         this.isFinal      = false;
     }
 
-    private RuntimeNode(final RuntimeNode runtimeNode, final Request request, final Type callSiteType, final boolean isFinal, final List<Node> args) {
+    private RuntimeNode(final RuntimeNode runtimeNode, final Request request, final Type callSiteType, final boolean isFinal, final List<Expression> args) {
         super(runtimeNode);
 
         this.request      = request;
@@ -311,7 +308,7 @@
      * @param request the request
      * @param args    arguments to request
      */
-    public RuntimeNode(final long token, final int finish, final Request request, final Node... args) {
+    public RuntimeNode(final long token, final int finish, final Request request, final Expression... args) {
         this(token, finish, request, Arrays.asList(args));
     }
 
@@ -322,7 +319,7 @@
      * @param request the request
      * @param args    arguments to request
      */
-    public RuntimeNode(final Node parent, final Request request, final Node... args) {
+    public RuntimeNode(final Expression parent, final Request request, final Expression... args) {
         this(parent, request, Arrays.asList(args));
     }
 
@@ -333,7 +330,7 @@
      * @param request the request
      * @param args    arguments to request
      */
-    public RuntimeNode(final Node parent, final Request request, final List<Node> args) {
+    public RuntimeNode(final Expression parent, final Request request, final List<Expression> args) {
         super(parent);
 
         this.request      = request;
@@ -410,9 +407,9 @@
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterRuntimeNode(this)) {
-            final List<Node> newArgs = new ArrayList<>();
+            final List<Expression> newArgs = new ArrayList<>();
             for (final Node arg : args) {
-                newArgs.add(arg.accept(visitor));
+                newArgs.add((Expression)arg.accept(visitor));
             }
             return visitor.leaveRuntimeNode(setArgs(newArgs));
         }
@@ -445,11 +442,11 @@
      * Get the arguments for this runtime node
      * @return argument list
      */
-    public List<Node> getArgs() {
+    public List<Expression> getArgs() {
         return Collections.unmodifiableList(args);
     }
 
-    private RuntimeNode setArgs(final List<Node> args) {
+    private RuntimeNode setArgs(final List<Expression> args) {
         if (this.args == args) {
             return this;
         }
@@ -472,7 +469,7 @@
      * @return true if all arguments now are primitive
      */
     public boolean isPrimitive() {
-        for (final Node arg : args) {
+        for (final Expression arg : args) {
             if (arg.getType().isObject()) {
                 return false;
             }
--- a/nashorn/src/jdk/nashorn/internal/ir/SplitNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/SplitNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -33,7 +33,7 @@
  * Node indicating code is split across classes.
  */
 @Immutable
-public class SplitNode extends LexicalContextNode {
+public class SplitNode extends LexicalContextStatement {
     /** Split node method name. */
     private final String name;
 
@@ -46,13 +46,12 @@
     /**
      * Constructor
      *
-     * @param lineNumber  lineNumber
      * @param name        name of split node
      * @param body        body of split code
      * @param compileUnit compile unit to use for the body
      */
-    public SplitNode(final int lineNumber, final String name, final Node body, final CompileUnit compileUnit) {
-        super(lineNumber, body.getToken(), body.getFinish());
+    public SplitNode(final String name, final Node body, final CompileUnit compileUnit) {
+        super(-1, body.getToken(), body.getFinish());
         this.name        = name;
         this.body        = body;
         this.compileUnit = compileUnit;
--- a/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/SwitchNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,7 +28,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.Label;
 import jdk.nashorn.internal.ir.annotations.Immutable;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
@@ -37,9 +36,9 @@
  * IR representation of a SWITCH statement.
  */
 @Immutable
-public final class SwitchNode extends BreakableNode {
+public final class SwitchNode extends BreakableStatement {
     /** Switch expression. */
-    private final Node expression;
+    private final Expression expression;
 
     /** Switch cases. */
     private final List<CaseNode> cases;
@@ -60,14 +59,14 @@
      * @param cases       cases
      * @param defaultCase the default case node - null if none, otherwise has to be present in cases list
      */
-    public SwitchNode(final int lineNumber, final long token, final int finish, final Node expression, final List<CaseNode> cases, final CaseNode defaultCase) {
+    public SwitchNode(final int lineNumber, final long token, final int finish, final Expression expression, final List<CaseNode> cases, final CaseNode defaultCase) {
         super(lineNumber, token, finish, new Label("switch_break"));
         this.expression       = expression;
         this.cases            = cases;
         this.defaultCaseIndex = defaultCase == null ? -1 : cases.indexOf(defaultCase);
     }
 
-    private SwitchNode(final SwitchNode switchNode, final Node expression, final List<CaseNode> cases, final int defaultCase) {
+    private SwitchNode(final SwitchNode switchNode, final Expression expression, final List<CaseNode> cases, final int defaultCase) {
         super(switchNode);
         this.expression       = expression;
         this.cases            = cases;
@@ -103,7 +102,7 @@
     public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterSwitchNode(this)) {
             return visitor.leaveSwitchNode(
-                setExpression(lc, expression.accept(visitor)).
+                setExpression(lc, (Expression)expression.accept(visitor)).
                 setCases(lc, Node.accept(visitor, CaseNode.class, cases), defaultCaseIndex));
         }
 
@@ -167,7 +166,7 @@
      * Return the expression to switch on
      * @return switch expression
      */
-    public Node getExpression() {
+    public Expression getExpression() {
         return expression;
     }
 
@@ -177,7 +176,7 @@
      * @param expression switch expression
      * @return new switch node or same if no state was changed
      */
-    public SwitchNode setExpression(final LexicalContext lc, final Node expression) {
+    public SwitchNode setExpression(final LexicalContext lc, final Expression expression) {
         if (this.expression == expression) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/Symbol.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/Symbol.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,7 +29,6 @@
 import java.util.HashSet;
 import java.util.Set;
 import java.util.StringTokenizer;
-
 import jdk.nashorn.internal.codegen.types.Range;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.runtime.Context;
@@ -705,7 +704,7 @@
     public static void setSymbolIsScope(final LexicalContext lc, final Symbol symbol) {
         symbol.setIsScope();
         if (!symbol.isGlobal()) {
-            lc.setFlag(lc.getDefiningBlock(symbol), Block.NEEDS_SCOPE);
+            lc.setBlockNeedsScope(lc.getDefiningBlock(symbol));
         }
     }
 
--- a/nashorn/src/jdk/nashorn/internal/ir/TemporarySymbols.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/TemporarySymbols.java	Fri Jul 26 14:07:32 2013 -0700
@@ -49,7 +49,7 @@
      * @param node the node
      * @return the node that is guaranteed to have a symbol.
      */
-    public Node ensureSymbol(final LexicalContext lc, final Type type, final Node node) {
+    public Expression ensureSymbol(final LexicalContext lc, final Type type, final Expression node) {
         final Symbol symbol = node.getSymbol();
         if (symbol != null) {
             return node;
--- a/nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/TernaryNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,43 +32,43 @@
  * TernaryNode nodes represent three operand operations (?:).
  */
 @Immutable
-public final class TernaryNode extends Node {
-    private final Node lhs;
+public final class TernaryNode extends Expression {
+    private final Expression test;
 
-    private final Node rhs;
+    private final Expression trueExpr;
 
     /** Third argument. */
-    private final Node third;
+    private final Expression falseExpr;
 
     /**
      * Constructor
      *
-     * @param token  token
-     * @param lhs    left hand side node
-     * @param rhs    right hand side node
-     * @param third  third node
+     * @param token     token
+     * @param test      test expression
+     * @param trueExpr  expression evaluated when test evaluates to true
+     * @param falseExpr expression evaluated when test evaluates to true
      */
-    public TernaryNode(final long token, final Node lhs, final Node rhs, final Node third) {
-        super(token, third.getFinish());
-        this.lhs = lhs;
-        this.rhs = rhs;
-        this.third = third;
+    public TernaryNode(final long token, final Expression test, final Expression trueExpr, final Expression falseExpr) {
+        super(token, falseExpr.getFinish());
+        this.test = test;
+        this.trueExpr = trueExpr;
+        this.falseExpr = falseExpr;
     }
 
-    private TernaryNode(final TernaryNode ternaryNode, final Node lhs, final Node rhs, final Node third) {
+    private TernaryNode(final TernaryNode ternaryNode, final Expression test, final Expression trueExpr, final Expression falseExpr) {
         super(ternaryNode);
-        this.lhs = lhs;
-        this.rhs = rhs;
-        this.third = third;
+        this.test = test;
+        this.trueExpr = trueExpr;
+        this.falseExpr = falseExpr;
     }
 
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterTernaryNode(this)) {
-            final Node newLhs = lhs().accept(visitor);
-            final Node newRhs = rhs().accept(visitor);
-            final Node newThird = third.accept(visitor);
-            return visitor.leaveTernaryNode(setThird(newThird).setLHS(newLhs).setRHS(newRhs));
+            final Expression newTest = (Expression)getTest().accept(visitor);
+            final Expression newTrueExpr = (Expression)getTrueExpression().accept(visitor);
+            final Expression newFalseExpr = (Expression)falseExpr.accept(visitor);
+            return visitor.leaveTernaryNode(setTest(newTest).setTrueExpression(newTrueExpr).setFalseExpression1(newFalseExpr));
         }
 
         return this;
@@ -76,96 +76,96 @@
 
     @Override
     public void toString(final StringBuilder sb) {
-        final boolean lhsParen   = tokenType().needsParens(lhs().tokenType(), true);
-        final boolean rhsParen   = tokenType().needsParens(rhs().tokenType(), false);
-        final boolean thirdParen = tokenType().needsParens(third().tokenType(), false);
+        final boolean testParen  = tokenType().needsParens(getTest().tokenType(), true);
+        final boolean trueParen  = tokenType().needsParens(getTrueExpression().tokenType(), false);
+        final boolean falseParen = tokenType().needsParens(getFalseExpression().tokenType(), false);
 
-        if (lhsParen) {
+        if (testParen) {
             sb.append('(');
         }
-        lhs().toString(sb);
-        if (lhsParen) {
+        getTest().toString(sb);
+        if (testParen) {
             sb.append(')');
         }
 
         sb.append(" ? ");
 
-        if (rhsParen) {
+        if (trueParen) {
             sb.append('(');
         }
-        rhs().toString(sb);
-        if (rhsParen) {
+        getTrueExpression().toString(sb);
+        if (trueParen) {
             sb.append(')');
         }
 
         sb.append(" : ");
 
-        if (thirdParen) {
+        if (falseParen) {
             sb.append('(');
         }
-        third().toString(sb);
-        if (thirdParen) {
+        getFalseExpression().toString(sb);
+        if (falseParen) {
             sb.append(')');
         }
     }
 
     /**
-     * Get the lhs node for this ternary expression, i.e. "x" in x ? y : z
-     * @return a node
+     * Get the test expression for this ternary expression, i.e. "x" in x ? y : z
+     * @return the test expression
      */
-    public Node lhs() {
-        return lhs;
+    public Expression getTest() {
+        return test;
     }
 
     /**
-     * Get the rhs node for this ternary expression, i.e. "y" in x ? y : z
-     * @return a node
+     * Get the true expression for this ternary expression, i.e. "y" in x ? y : z
+     * @return the true expression
      */
-    public Node rhs() {
-        return rhs;
+    public Expression getTrueExpression() {
+        return trueExpr;
     }
 
     /**
-     * Get the "third" node for this ternary expression, i.e. "z" in x ? y : z
-     * @return a node
+     * Get the false expression for this ternary expression, i.e. "z" in x ? y : z
+     * @return the false expression
      */
-    public Node third() {
-        return third;
+    public Expression getFalseExpression() {
+        return falseExpr;
     }
 
     /**
-     * Set the left hand side expression for this node
-     * @param lhs new left hand side expression
+     * Set the test expression for this node
+     * @param test new test expression
      * @return a node equivalent to this one except for the requested change.
      */
-    public TernaryNode setLHS(final Node lhs) {
-        if (this.lhs == lhs) {
+    public TernaryNode setTest(final Expression test) {
+        if (this.test == test) {
             return this;
         }
-        return new TernaryNode(this, lhs, rhs, third);
+        return new TernaryNode(this, test, trueExpr, falseExpr);
     }
 
     /**
-     * Set the right hand side expression for this node
-     * @param rhs new left hand side expression
+     * Set the true expression for this node
+     * @param trueExpr new true expression
      * @return a node equivalent to this one except for the requested change.
      */
-    public TernaryNode setRHS(final Node rhs) {
-        if (this.rhs == rhs) {
+    public TernaryNode setTrueExpression(final Expression trueExpr) {
+        if (this.trueExpr == trueExpr) {
             return this;
         }
-        return new TernaryNode(this, lhs, rhs, third);
+        return new TernaryNode(this, test, trueExpr, falseExpr);
     }
 
     /**
-     * Reset the "third" node for this ternary expression, i.e. "z" in x ? y : z
-     * @param third a node
+     * Set the false expression for this node
+     * @param falseExpr new false expression
      * @return a node equivalent to this one except for the requested change.
      */
-    public TernaryNode setThird(final Node third) {
-        if (this.third == third) {
+    public TernaryNode setFalseExpression1(final Expression falseExpr) {
+        if (this.falseExpr == falseExpr) {
             return this;
         }
-        return new TernaryNode(this, lhs, rhs, third);
+        return new TernaryNode(this, test, trueExpr, falseExpr);
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/ThrowNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/ThrowNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,7 +34,7 @@
 @Immutable
 public final class ThrowNode extends Statement {
     /** Exception expression. */
-    private final Node expression;
+    private final Expression expression;
 
     private final int flags;
 
@@ -50,13 +50,13 @@
      * @param expression expression to throw
      * @param flags      flags
      */
-    public ThrowNode(final int lineNumber, final long token, final int finish, final Node expression, final int flags) {
+    public ThrowNode(final int lineNumber, final long token, final int finish, final Expression expression, final int flags) {
         super(lineNumber, token, finish);
         this.expression = expression;
         this.flags = flags;
     }
 
-    private ThrowNode(final ThrowNode node, final Node expression, final int flags) {
+    private ThrowNode(final ThrowNode node, final Expression expression, final int flags) {
         super(node);
         this.expression = expression;
         this.flags = flags;
@@ -74,7 +74,7 @@
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterThrowNode(this)) {
-            return visitor.leaveThrowNode(setExpression(expression.accept(visitor)));
+            return visitor.leaveThrowNode(setExpression((Expression)expression.accept(visitor)));
         }
 
         return this;
@@ -93,7 +93,7 @@
      * Get the expression that is being thrown by this node
      * @return expression
      */
-    public Node getExpression() {
+    public Expression getExpression() {
         return expression;
     }
 
@@ -102,7 +102,7 @@
      * @param expression new expression
      * @return new or same thrownode
      */
-    public ThrowNode setExpression(final Node expression) {
+    public ThrowNode setExpression(final Expression expression) {
         if (this.expression == expression) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/UnaryNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,6 +29,7 @@
 import static jdk.nashorn.internal.parser.TokenType.CONVERT;
 import static jdk.nashorn.internal.parser.TokenType.DECPOSTFIX;
 import static jdk.nashorn.internal.parser.TokenType.INCPOSTFIX;
+
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.annotations.Immutable;
 import jdk.nashorn.internal.ir.visitor.NodeVisitor;
@@ -39,9 +40,9 @@
  * UnaryNode nodes represent single operand operations.
  */
 @Immutable
-public final class UnaryNode extends Node implements Assignment<Node> {
+public final class UnaryNode extends Expression implements Assignment<Expression> {
     /** Right hand side argument. */
-    private final Node rhs;
+    private final Expression rhs;
 
     /**
      * Constructor
@@ -49,7 +50,7 @@
      * @param token  token
      * @param rhs    expression
      */
-    public UnaryNode(final long token, final Node rhs) {
+    public UnaryNode(final long token, final Expression rhs) {
         this(token, Math.min(rhs.getStart(), Token.descPosition(token)), Math.max(Token.descPosition(token) + Token.descLength(token), rhs.getFinish()), rhs);
     }
 
@@ -61,13 +62,13 @@
      * @param finish finish
      * @param rhs    expression
      */
-    public UnaryNode(final long token, final int start, final int finish, final Node rhs) {
+    public UnaryNode(final long token, final int start, final int finish, final Expression rhs) {
         super(token, start, finish);
         this.rhs = rhs;
     }
 
 
-    private UnaryNode(final UnaryNode unaryNode, final Node rhs) {
+    private UnaryNode(final UnaryNode unaryNode, final Expression rhs) {
         super(unaryNode);
         this.rhs = rhs;
     }
@@ -101,17 +102,17 @@
     }
 
     @Override
-    public Node getAssignmentDest() {
+    public Expression getAssignmentDest() {
         return isAssignment() ? rhs() : null;
     }
 
     @Override
-    public Node setAssignmentDest(Node n) {
+    public UnaryNode setAssignmentDest(Expression n) {
         return setRHS(n);
     }
 
     @Override
-    public Node getAssignmentSource() {
+    public Expression getAssignmentSource() {
         return getAssignmentDest();
     }
 
@@ -122,7 +123,7 @@
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterUnaryNode(this)) {
-            return visitor.leaveUnaryNode(setRHS(rhs.accept(visitor)));
+            return visitor.leaveUnaryNode(setRHS((Expression)rhs.accept(visitor)));
         }
 
         return this;
@@ -130,6 +131,22 @@
 
     @Override
     public void toString(final StringBuilder sb) {
+        toString(sb, new Runnable() {
+            @Override
+            public void run() {
+                sb.append(rhs().toString());
+            }
+        });
+    }
+
+    /**
+     * Creates the string representation of this unary node, delegating the creation of the string representation of its
+     * operand to a specified runnable.
+     * @param sb the string builder to use
+     * @param rhsStringBuilder the runnable that appends the string representation of the operand to the string builder
+     * when invoked.
+     */
+    public void toString(final StringBuilder sb, final Runnable rhsStringBuilder) {
         final TokenType type      = tokenType();
         final String    name      = type.getName();
         final boolean   isPostfix = type == DECPOSTFIX || type == INCPOSTFIX;
@@ -161,7 +178,7 @@
         if (rhsParen) {
             sb.append('(');
         }
-        rhs().toString(sb);
+        rhsStringBuilder.run();
         if (rhsParen) {
             sb.append(')');
         }
@@ -189,7 +206,7 @@
      *
      * @return right hand side or expression node
      */
-    public Node rhs() {
+    public Expression rhs() {
         return rhs;
     }
 
@@ -202,7 +219,7 @@
      * @param rhs right hand side or expression node
      * @return a node equivalent to this one except for the requested change.
      */
-    public UnaryNode setRHS(final Node rhs) {
+    public UnaryNode setRHS(final Expression rhs) {
         if (this.rhs == rhs) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/VarNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/VarNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -37,7 +37,7 @@
     private final IdentNode name;
 
     /** Initialization expression. */
-    private final Node init;
+    private final Expression init;
 
     /** Is this a var statement (as opposed to a "var" in a for loop statement) */
     private final int flags;
@@ -59,11 +59,11 @@
      * @param name       name of variable
      * @param init       init node or null if just a declaration
      */
-    public VarNode(final int lineNumber, final long token, final int finish, final IdentNode name, final Node init) {
+    public VarNode(final int lineNumber, final long token, final int finish, final IdentNode name, final Expression init) {
         this(lineNumber, token, finish, name, init, IS_STATEMENT);
     }
 
-    private VarNode(final VarNode varNode, final IdentNode name, final Node init, final int flags) {
+    private VarNode(final VarNode varNode, final IdentNode name, final Expression init, final int flags) {
         super(varNode);
         this.name = init == null ? name : name.setIsInitializedHere();
         this.init = init;
@@ -80,7 +80,7 @@
      * @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 Node init, final int flags) {
+    public VarNode(final int lineNumber, final long token, final int finish, final IdentNode name, final Expression init, final int flags) {
         super(lineNumber, token, finish);
 
         this.name  = init == null ? name : name.setIsInitializedHere();
@@ -99,12 +99,12 @@
     }
 
     @Override
-    public Node setAssignmentDest(IdentNode n) {
+    public VarNode setAssignmentDest(IdentNode n) {
         return setName(n);
     }
 
     @Override
-    public Node getAssignmentSource() {
+    public Expression getAssignmentSource() {
         return isAssignment() ? getInit() : null;
     }
 
@@ -123,9 +123,9 @@
     @Override
     public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterVarNode(this)) {
-            final IdentNode newName = (IdentNode)name.accept(visitor);
-            final Node      newInit = init == null ? null : init.accept(visitor);
-            final VarNode   newThis;
+            final IdentNode  newName = (IdentNode)name.accept(visitor);
+            final Expression newInit = init == null ? null : (Expression)init.accept(visitor);
+            final VarNode    newThis;
             if (name != newName || init != newInit) {
                 newThis = new VarNode(this, newName, newInit, flags);
             } else {
@@ -151,7 +151,7 @@
      * If this is an assignment of the form {@code var x = init;}, get the init part.
      * @return the expression to initialize the variable to, null if just a declaration
      */
-    public Node getInit() {
+    public Expression getInit() {
         return init;
     }
 
@@ -160,7 +160,7 @@
      * @param init new initialization expression
      * @return a node equivalent to this one except for the requested change.
      */
-    public VarNode setInit(final Node init) {
+    public VarNode setInit(final Expression init) {
         if (this.init == init) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/WhileNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/WhileNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -59,7 +59,7 @@
      * @param body      body
      * @param controlFlowEscapes control flow escapes?
      */
-    protected WhileNode(final WhileNode whileNode, final Node test, final Block body, final boolean controlFlowEscapes) {
+    protected WhileNode(final WhileNode whileNode, final Expression test, final Block body, final boolean controlFlowEscapes) {
         super(whileNode, test, body, controlFlowEscapes);
         this.isDoWhile = whileNode.isDoWhile;
     }
@@ -75,28 +75,28 @@
     }
 
     @Override
-    protected Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
+    public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterWhileNode(this)) {
             if (isDoWhile()) {
                 return visitor.leaveWhileNode(
-                        setTest(lc, test.accept(visitor)).
+                        setTest(lc, (Expression)test.accept(visitor)).
                         setBody(lc, (Block)body.accept(visitor)));
             }
             return visitor.leaveWhileNode(
                     setBody(lc, (Block)body.accept(visitor)).
-                    setTest(lc, test.accept(visitor)));
+                    setTest(lc, (Expression)test.accept(visitor)));
 
         }
         return this;
     }
 
     @Override
-    public Node getTest() {
+    public Expression getTest() {
         return test;
     }
 
     @Override
-    public WhileNode setTest(final LexicalContext lc, final Node test) {
+    public WhileNode setTest(final LexicalContext lc, final Expression test) {
         if (this.test == test) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/WithNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/WithNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,9 +32,9 @@
  * IR representation for {@code with} statements.
  */
 @Immutable
-public final class WithNode extends LexicalContextNode {
+public final class WithNode extends LexicalContextStatement {
    /** This expression. */
-    private final Node expression;
+    private final Expression expression;
 
     /** Statements. */
     private final Block body;
@@ -52,7 +52,7 @@
         this.body       = null;
     }
 
-    private WithNode(final WithNode node, final Node expression, final Block body) {
+    private WithNode(final WithNode node, final Expression expression, final Block body) {
         super(node);
         this.expression = expression;
         this.body       = body;
@@ -67,7 +67,7 @@
     public Node accept(final LexicalContext lc, final NodeVisitor<? extends LexicalContext> visitor) {
         if (visitor.enterWithNode(this)) {
              return visitor.leaveWithNode(
-                setExpression(lc, expression.accept(visitor)).
+                setExpression(lc, (Expression)expression.accept(visitor)).
                 setBody(lc, (Block)body.accept(visitor)));
         }
         return this;
@@ -110,7 +110,7 @@
      * Get the expression of this WithNode
      * @return the expression
      */
-    public Node getExpression() {
+    public Expression getExpression() {
         return expression;
     }
 
@@ -120,7 +120,7 @@
      * @param expression new expression
      * @return new or same withnode
      */
-    public WithNode setExpression(final LexicalContext lc, final Node expression) {
+    public WithNode setExpression(final LexicalContext lc, final Expression expression) {
         if (this.expression == expression) {
             return this;
         }
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/ASTWriter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/ASTWriter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -33,10 +33,11 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.Node;
+import jdk.nashorn.internal.ir.Symbol;
 import jdk.nashorn.internal.ir.TernaryNode;
 import jdk.nashorn.internal.ir.annotations.Ignore;
 import jdk.nashorn.internal.ir.annotations.Reference;
@@ -111,8 +112,15 @@
             type = "ref: " + type;
         }
         type += "@" + Debug.id(node);
-        if (node.getSymbol() != null) {
-            type += "#" + node.getSymbol();
+        final Symbol symbol;
+        if(node instanceof Expression) {
+            symbol = ((Expression)node).getSymbol();
+        } else {
+            symbol = null;
+        }
+
+        if (symbol != null) {
+            type += "#" + symbol;
         }
 
         if (node instanceof Block && ((Block)node).needsScope()) {
@@ -135,8 +143,8 @@
             status += " Goto ";
         }
 
-        if (node.getSymbol() != null) {
-            status += node.getSymbol();
+        if (symbol != null) {
+            status += symbol;
         }
 
         status = status.trim();
@@ -144,8 +152,8 @@
             status = " [" + status + "]";
         }
 
-        if (node.getSymbol() != null) {
-            String tname = node.getType().toString();
+        if (symbol != null) {
+            String tname = ((Expression)node).getType().toString();
             if (tname.indexOf('.') != -1) {
                 tname = tname.substring(tname.lastIndexOf('.') + 1, tname.length());
             }
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/JSONWriter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/JSONWriter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,18 +27,18 @@
 
 import java.util.Arrays;
 import java.util.List;
-
 import jdk.nashorn.internal.codegen.CompilerConstants;
 import jdk.nashorn.internal.ir.AccessNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.BlockStatement;
 import jdk.nashorn.internal.ir.BreakNode;
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.CaseNode;
 import jdk.nashorn.internal.ir.CatchNode;
 import jdk.nashorn.internal.ir.ContinueNode;
 import jdk.nashorn.internal.ir.EmptyNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.IdentNode;
@@ -298,14 +298,27 @@
     }
 
     @Override
-    public boolean enterExecuteNode(final ExecuteNode executeNode) {
-        enterDefault(executeNode);
+    public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
+        enterDefault(expressionStatement);
 
         type("ExpressionStatement");
         comma();
 
         property("expression");
-        executeNode.getExpression().accept(this);
+        expressionStatement.getExpression().accept(this);
+
+        return leave();
+    }
+
+    @Override
+    public boolean enterBlockStatement(BlockStatement blockStatement) {
+        enterDefault(blockStatement);
+
+        type("BlockStatement");
+        comma();
+
+        property("block");
+        blockStatement.getBlock().accept(this);
 
         return leave();
     }
@@ -514,7 +527,7 @@
             type("ArrayExpression");
             comma();
 
-            final Node[] value = (Node[])literalNode.getValue();
+            final Node[] value = literalNode.getArray();
             array("elements", Arrays.asList(value));
         } else {
             type("Literal");
@@ -680,15 +693,15 @@
         comma();
 
         property("test");
-        ternaryNode.lhs().accept(this);
+        ternaryNode.getTest().accept(this);
         comma();
 
         property("consequent");
-        ternaryNode.rhs().accept(this);
+        ternaryNode.getTrueExpression().accept(this);
         comma();
 
         property("alternate");
-        ternaryNode.third().accept(this);
+        ternaryNode.getFalseExpression().accept(this);
 
         return leave();
     }
--- a/nashorn/src/jdk/nashorn/internal/ir/debug/PrintVisitor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/debug/PrintVisitor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -26,12 +26,11 @@
 package jdk.nashorn.internal.ir.debug;
 
 import java.util.List;
-
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.CaseNode;
 import jdk.nashorn.internal.ir.CatchNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.IfNode;
@@ -41,8 +40,8 @@
 import jdk.nashorn.internal.ir.SplitNode;
 import jdk.nashorn.internal.ir.Statement;
 import jdk.nashorn.internal.ir.SwitchNode;
-import jdk.nashorn.internal.ir.Symbol;
 import jdk.nashorn.internal.ir.TryNode;
+import jdk.nashorn.internal.ir.UnaryNode;
 import jdk.nashorn.internal.ir.VarNode;
 import jdk.nashorn.internal.ir.WhileNode;
 import jdk.nashorn.internal.ir.WithNode;
@@ -167,14 +166,6 @@
                 continue;
             }
 
-            final Symbol symbol = statement.getSymbol();
-
-            if (symbol != null) {
-                sb.append("  [");
-                sb.append(symbol.toString());
-                sb.append(']');
-            }
-
             int  lastIndex = sb.length() - 1;
             char lastChar  = sb.charAt(lastIndex);
             while (Character.isWhitespace(lastChar) && lastIndex >= 0) {
@@ -215,8 +206,19 @@
     }
 
     @Override
-    public boolean enterExecuteNode(final ExecuteNode executeNode) {
-        executeNode.getExpression().accept(this);
+    public boolean enterUnaryNode(final UnaryNode unaryNode) {
+        unaryNode.toString(sb, new Runnable() {
+            @Override
+            public void run() {
+                unaryNode.rhs().accept(PrintVisitor.this);
+            }
+        });
+        return false;
+    }
+
+    @Override
+    public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
+        expressionStatement.getExpression().accept(this);
         return false;
     }
 
--- a/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1263,6 +1263,4 @@
     public Node leaveSUB(final BinaryNode binaryNode) {
         return leaveDefault(binaryNode);
     }
-
-
 }
--- a/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeVisitor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/visitor/NodeVisitor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,13 +28,14 @@
 import jdk.nashorn.internal.ir.AccessNode;
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
+import jdk.nashorn.internal.ir.BlockStatement;
 import jdk.nashorn.internal.ir.BreakNode;
 import jdk.nashorn.internal.ir.CallNode;
 import jdk.nashorn.internal.ir.CaseNode;
 import jdk.nashorn.internal.ir.CatchNode;
 import jdk.nashorn.internal.ir.ContinueNode;
 import jdk.nashorn.internal.ir.EmptyNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.IdentNode;
@@ -308,23 +309,43 @@
     }
 
     /**
-     * Callback for entering an ExecuteNode
+     * Callback for entering an ExpressionStatement
      *
-     * @param  executeNode the node
+     * @param  expressionStatement the node
      * @return true if traversal should continue and node children be traversed, false otherwise
      */
-    public boolean enterExecuteNode(final ExecuteNode executeNode) {
-        return enterDefault(executeNode);
+    public boolean enterExpressionStatement(final ExpressionStatement expressionStatement) {
+        return enterDefault(expressionStatement);
     }
 
     /**
-     * Callback for leaving an ExecuteNode
+     * Callback for leaving an ExpressionStatement
      *
-     * @param  executeNode the node
+     * @param  expressionStatement the node
      * @return processed node, which will replace the original one, or the original node
      */
-    public Node leaveExecuteNode(final ExecuteNode executeNode) {
-        return leaveDefault(executeNode);
+    public Node leaveExpressionStatement(final ExpressionStatement expressionStatement) {
+        return leaveDefault(expressionStatement);
+    }
+
+    /**
+     * Callback for entering a BlockStatement
+     *
+     * @param  blockStatement the node
+     * @return true if traversal should continue and node children be traversed, false otherwise
+     */
+    public boolean enterBlockStatement(final BlockStatement blockStatement) {
+        return enterDefault(blockStatement);
+    }
+
+    /**
+     * Callback for leaving a BlockStatement
+     *
+     * @param  blockStatement the node
+     * @return processed node, which will replace the original one, or the original node
+     */
+    public Node leaveBlockStatement(final BlockStatement blockStatement) {
+        return leaveDefault(blockStatement);
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/lookup/Lookup.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/lookup/Lookup.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,8 +32,6 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import jdk.nashorn.internal.runtime.JSType;
-import jdk.nashorn.internal.runtime.Property;
-import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptRuntime;
 
 /**
@@ -125,44 +123,6 @@
     }
 
     /**
-     * Create a new {@link Property}
-     *
-     * @param map             property map
-     * @param key             property key
-     * @param flags           property flags
-     * @param propertyGetter  getter for property if available, null otherwise
-     * @param propertySetter  setter for property if available, null otherwise
-     *
-     * @return new property map, representing {@code PropertyMap} with the new property added to it
-     */
-    @SuppressWarnings("fallthrough")
-    public static PropertyMap newProperty(final PropertyMap map, final String key, final int flags, final MethodHandle propertyGetter, final MethodHandle propertySetter) {
-        MethodHandle getter = propertyGetter;
-        MethodHandle setter = propertySetter;
-
-        // TODO: this is temporary code. This code exists to support reflective
-        // field reader/writer handles generated by "unreflect" lookup.
-
-        switch (getter.type().parameterCount()) {
-        case 0:
-            // A static field reader, so drop the 'self' argument.
-            getter = MH.dropArguments(getter, 0, Object.class);
-            if (setter != null) {
-                setter = MH.dropArguments(setter, 0, Object.class);
-            }
-        // fall through
-        case 1:
-            // standard getter that accepts 'self'.
-            break;
-        default:
-            // Huh!! something wrong..
-            throw new IllegalArgumentException("getter/setter has wrong arguments");
-        }
-
-        return map.newProperty(key, flags, -1, getter, setter);
-    }
-
-    /**
      * This method filters primitive return types using JavaScript semantics. For example,
      * an (int) cast of a double in Java land is not the same thing as invoking toInt32 on it.
      * If you are returning values to JavaScript that have to be of a specific type, this is
--- a/nashorn/src/jdk/nashorn/internal/objects/AccessorPropertyDescriptor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/AccessorPropertyDescriptor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -67,12 +67,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    AccessorPropertyDescriptor() {
-        this(false, false, UNDEFINED, UNDEFINED);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
     }
 
-    AccessorPropertyDescriptor(final boolean configurable, final boolean enumerable, final Object get, final Object set) {
-        super(Global.objectPrototype(), $nasgenmap$);
+    AccessorPropertyDescriptor(final boolean configurable, final boolean enumerable, final Object get, final Object set, final Global global) {
+        super(global.getObjectPrototype(), global.getAccessorPropertyDescriptorMap());
         this.configurable = configurable;
         this.enumerable   = enumerable;
         this.get          = get;
--- a/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,6 +25,8 @@
 
 package jdk.nashorn.internal.objects;
 
+import static jdk.nashorn.internal.runtime.ECMAErrors.rangeError;
+
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Getter;
 import jdk.nashorn.internal.objects.annotations.ScriptClass;
@@ -34,20 +36,27 @@
 import jdk.nashorn.internal.runtime.ScriptRuntime;
 import jdk.nashorn.internal.runtime.arrays.ArrayData;
 
-import static jdk.nashorn.internal.runtime.ECMAErrors.rangeError;
-
 @ScriptClass("ArrayBufferView")
 abstract class ArrayBufferView extends ScriptObject {
 
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    ArrayBufferView(final NativeArrayBuffer buffer, final int byteOffset, final int elementLength) {
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    private ArrayBufferView(final NativeArrayBuffer buffer, final int byteOffset, final int elementLength, final Global global) {
+        super(global.getArrayBufferViewMap());
         checkConstructorArgs(buffer, byteOffset, elementLength);
-        this.setProto(getPrototype());
+        this.setProto(getPrototype(global));
         this.setArray(factory().createArrayData(buffer, byteOffset, elementLength));
     }
 
+    ArrayBufferView(final NativeArrayBuffer buffer, final int byteOffset, final int elementLength) {
+        this(buffer, byteOffset, elementLength, Global.instance());
+    }
+
     private void checkConstructorArgs(final NativeArrayBuffer buffer, final int byteOffset, final int elementLength) {
         if (byteOffset < 0 || elementLength < 0) {
             throw new RuntimeException("byteOffset or length must not be negative");
@@ -266,12 +275,17 @@
 
     protected static abstract class Factory {
         final int bytesPerElement;
+        final int maxElementLength;
 
         public Factory(final int bytesPerElement) {
             this.bytesPerElement = bytesPerElement;
+            this.maxElementLength = Integer.MAX_VALUE / bytesPerElement;
         }
 
         public final ArrayBufferView construct(final int elementLength) {
+            if(elementLength > maxElementLength) {
+                throw rangeError("inappropriate.array.buffer.length", JSType.toString(elementLength));
+            }
             return construct(new NativeArrayBuffer(elementLength * bytesPerElement), 0, elementLength);
         }
 
@@ -282,7 +296,7 @@
 
     protected abstract Factory factory();
 
-    protected abstract ScriptObject getPrototype();
+    protected abstract ScriptObject getPrototype(final Global global);
 
     protected boolean isFloatArray() {
         return false;
--- a/nashorn/src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -39,7 +39,7 @@
     private final ScriptFunction targetFunction;
 
     BoundScriptFunctionImpl(ScriptFunctionData data, ScriptFunction targetFunction) {
-        super(data);
+        super(data, Global.instance());
         setPrototype(ScriptRuntime.UNDEFINED);
         this.targetFunction = targetFunction;
     }
--- a/nashorn/src/jdk/nashorn/internal/objects/DataPropertyDescriptor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/DataPropertyDescriptor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,7 +25,6 @@
 
 package jdk.nashorn.internal.objects;
 
-import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.sameValue;
 
 import java.util.Objects;
@@ -65,12 +64,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    DataPropertyDescriptor() {
-        this(false, false, false, UNDEFINED);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
     }
 
-    DataPropertyDescriptor(final boolean configurable, final boolean enumerable, final boolean writable, final Object value) {
-        super(Global.objectPrototype(), $nasgenmap$);
+    DataPropertyDescriptor(final boolean configurable, final boolean enumerable, final boolean writable, final Object value, final Global global) {
+        super(global.getObjectPrototype(), global.getDataPropertyDescriptorMap());
         this.configurable = configurable;
         this.enumerable   = enumerable;
         this.writable     = writable;
--- a/nashorn/src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -55,12 +55,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    GenericPropertyDescriptor() {
-        this(false, false);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
     }
 
-    GenericPropertyDescriptor(final boolean configurable, final boolean enumerable) {
-        super(Global.objectPrototype(), $nasgenmap$);
+    GenericPropertyDescriptor(final boolean configurable, final boolean enumerable, final Global global) {
+        super(global.getObjectPrototype(), global.getGenericPropertyDescriptorMap());
         this.configurable = configurable;
         this.enumerable   = enumerable;
     }
--- a/nashorn/src/jdk/nashorn/internal/objects/Global.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java	Fri Jul 26 14:07:32 2013 -0700
@@ -43,7 +43,6 @@
 import java.util.Map;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Property;
 import jdk.nashorn.internal.objects.annotations.ScriptClass;
@@ -363,6 +362,36 @@
     private ScriptObject   builtinFloat32Array;
     private ScriptObject   builtinFloat64Array;
 
+    private PropertyMap    accessorPropertyDescriptorMap;
+    private PropertyMap    arrayBufferViewMap;
+    private PropertyMap    dataPropertyDescriptorMap;
+    private PropertyMap    genericPropertyDescriptorMap;
+    private PropertyMap    nativeArgumentsMap;
+    private PropertyMap    nativeArrayMap;
+    private PropertyMap    nativeArrayBufferMap;
+    private PropertyMap    nativeBooleanMap;
+    private PropertyMap    nativeDateMap;
+    private PropertyMap    nativeErrorMap;
+    private PropertyMap    nativeEvalErrorMap;
+    private PropertyMap    nativeJSAdapterMap;
+    private PropertyMap    nativeJavaImporterMap;
+    private PropertyMap    nativeNumberMap;
+    private PropertyMap    nativeRangeErrorMap;
+    private PropertyMap    nativeReferenceErrorMap;
+    private PropertyMap    nativeRegExpMap;
+    private PropertyMap    nativeRegExpExecResultMap;
+    private PropertyMap    nativeStrictArgumentsMap;
+    private PropertyMap    nativeStringMap;
+    private PropertyMap    nativeSyntaxErrorMap;
+    private PropertyMap    nativeTypeErrorMap;
+    private PropertyMap    nativeURIErrorMap;
+    private PropertyMap    prototypeObjectMap;
+    private PropertyMap    objectMap;
+    private PropertyMap    functionMap;
+    private PropertyMap    anonymousFunctionMap;
+    private PropertyMap    strictFunctionMap;
+    private PropertyMap    boundFunctionMap;
+
     // Flag to indicate that a split method issued a return statement
     private int splitState = -1;
 
@@ -379,8 +408,6 @@
     private static final MethodHandle LOADWITHNEWGLOBAL = findOwnMH("loadWithNewGlobal", Object.class, Object.class, Object[].class);
     private static final MethodHandle EXIT              = findOwnMH("exit",              Object.class, Object.class, Object.class);
 
-    private final Context context;
-
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
@@ -390,14 +417,14 @@
      * @param context the context
      */
     public Global(final Context context) {
-        this.context = context;
-        this.setIsScope();
         /*
          * Duplicate global's map and use it. This way the initial Map filled
          * by nasgen (referenced from static field in this class) is retained
-         * 'as is'. This allows multiple globals to be used within a context.
+         * 'as is' (as that one is process wide singleton.
          */
-        this.setMap(getMap().duplicate());
+        super($nasgenmap$.duplicate());
+        this.setContext(context);
+        this.setIsScope();
 
         final int cacheSize = context.getEnv()._class_cache_size;
         if (cacheSize > 0) {
@@ -424,7 +451,7 @@
      * @return the script environment
      */
     static ScriptEnvironment getEnv() {
-        return instance().context.getEnv();
+        return instance().getContext().getEnv();
     }
 
     /**
@@ -433,7 +460,7 @@
      * @return the context
      */
     static Context getThisContext() {
-        return instance().context;
+        return instance().getContext();
     }
 
     // GlobalObject interface implementation
@@ -456,11 +483,11 @@
     @Override
     public Object wrapAsObject(final Object obj) {
         if (obj instanceof Boolean) {
-            return new NativeBoolean((Boolean)obj);
+            return new NativeBoolean((Boolean)obj, this);
         } else if (obj instanceof Number) {
-            return new NativeNumber(((Number)obj).doubleValue());
+            return new NativeNumber(((Number)obj).doubleValue(), this);
         } else if (obj instanceof String || obj instanceof ConsString) {
-            return new NativeString((CharSequence)obj);
+            return new NativeString((CharSequence)obj, this);
         } else if (obj instanceof Object[]) { // extension
             return new NativeArray((Object[])obj);
         } else if (obj instanceof double[]) { // extension
@@ -489,7 +516,7 @@
 
     @Override
     public ScriptObject newObject() {
-        return new JO(getObjectPrototype());
+        return new JO(getObjectPrototype(), getObjectMap());
     }
 
     @Override
@@ -566,52 +593,52 @@
 
     @Override
     public ScriptObject newError(final String msg) {
-        return new NativeError(msg);
+        return new NativeError(msg, this);
     }
 
     @Override
     public ScriptObject newEvalError(final String msg) {
-        return new NativeEvalError(msg);
+        return new NativeEvalError(msg, this);
     }
 
     @Override
     public ScriptObject newRangeError(final String msg) {
-        return new NativeRangeError(msg);
+        return new NativeRangeError(msg, this);
     }
 
     @Override
     public ScriptObject newReferenceError(final String msg) {
-        return new NativeReferenceError(msg);
+        return new NativeReferenceError(msg, this);
     }
 
     @Override
     public ScriptObject newSyntaxError(final String msg) {
-        return new NativeSyntaxError(msg);
+        return new NativeSyntaxError(msg, this);
     }
 
     @Override
     public ScriptObject newTypeError(final String msg) {
-        return new NativeTypeError(msg);
+        return new NativeTypeError(msg, this);
     }
 
     @Override
     public ScriptObject newURIError(final String msg) {
-        return new NativeURIError(msg);
+        return new NativeURIError(msg, this);
     }
 
     @Override
     public PropertyDescriptor newGenericDescriptor(final boolean configurable, final boolean enumerable) {
-        return new GenericPropertyDescriptor(configurable, enumerable);
+        return new GenericPropertyDescriptor(configurable, enumerable, this);
     }
 
     @Override
     public PropertyDescriptor newDataDescriptor(final Object value, final boolean configurable, final boolean enumerable, final boolean writable) {
-        return new DataPropertyDescriptor(configurable, enumerable, writable, value);
+        return new DataPropertyDescriptor(configurable, enumerable, writable, value, this);
     }
 
     @Override
     public PropertyDescriptor newAccessorDescriptor(final Object get, final Object set, final boolean configurable, final boolean enumerable) {
-        final AccessorPropertyDescriptor desc = new AccessorPropertyDescriptor(configurable, enumerable, get == null ? UNDEFINED : get, set == null ? UNDEFINED : set);
+        final AccessorPropertyDescriptor desc = new AccessorPropertyDescriptor(configurable, enumerable, get == null ? UNDEFINED : get, set == null ? UNDEFINED : set, this);
 
         if (get == null) {
             desc.delete(PropertyDescriptor.GET, false);
@@ -700,7 +727,7 @@
         final Global global = Global.instance();
         final ScriptObject scope = (self instanceof ScriptObject) ? (ScriptObject)self : global;
 
-        return global.context.eval(scope, str.toString(), callThis, location, Boolean.TRUE.equals(strict));
+        return global.getContext().eval(scope, str.toString(), callThis, location, Boolean.TRUE.equals(strict));
     }
 
     /**
@@ -740,7 +767,7 @@
     public static Object load(final Object self, final Object source) throws IOException {
         final Global global = Global.instance();
         final ScriptObject scope = (self instanceof ScriptObject) ? (ScriptObject)self : global;
-        return global.context.load(scope, source);
+        return global.getContext().load(scope, source);
     }
 
     /**
@@ -760,7 +787,7 @@
         final Object from = hasArgs ? args[0] : UNDEFINED;
         final Object[] arguments = hasArgs ? Arrays.copyOfRange(args, 1, length) : args;
 
-        return global.context.loadWithNewGlobal(from, arguments);
+        return global.getContext().loadWithNewGlobal(from, arguments);
     }
 
     /**
@@ -776,6 +803,7 @@
         return UNDEFINED;
     }
 
+    // builtin prototype accessors
     ScriptObject getFunctionPrototype() {
         return ScriptFunction.getPrototype(builtinFunction);
     }
@@ -884,11 +912,127 @@
         return ScriptFunction.getPrototype(builtinFloat64Array);
     }
 
+    // Builtin PropertyMap accessors
+    PropertyMap getAccessorPropertyDescriptorMap() {
+        return accessorPropertyDescriptorMap;
+    }
+
+    PropertyMap getArrayBufferViewMap() {
+        return arrayBufferViewMap;
+    }
+
+    PropertyMap getDataPropertyDescriptorMap() {
+        return dataPropertyDescriptorMap;
+    }
+
+    PropertyMap getGenericPropertyDescriptorMap() {
+        return genericPropertyDescriptorMap;
+    }
+
+    PropertyMap getArgumentsMap() {
+        return nativeArgumentsMap;
+    }
+
+    PropertyMap getArrayMap() {
+        return nativeArrayMap;
+    }
+
+    PropertyMap getArrayBufferMap() {
+        return nativeArrayBufferMap;
+    }
+
+    PropertyMap getBooleanMap() {
+        return nativeBooleanMap;
+    }
+
+    PropertyMap getDateMap() {
+        return nativeDateMap;
+    }
+
+    PropertyMap getErrorMap() {
+        return nativeErrorMap;
+    }
+
+    PropertyMap getEvalErrorMap() {
+        return nativeEvalErrorMap;
+    }
+
+    PropertyMap getJSAdapterMap() {
+        return nativeJSAdapterMap;
+    }
+
+    PropertyMap getJavaImporterMap() {
+        return nativeJavaImporterMap;
+    }
+
+    PropertyMap getNumberMap() {
+        return nativeNumberMap;
+    }
+
+    PropertyMap getRangeErrorMap() {
+        return nativeRangeErrorMap;
+    }
+
+    PropertyMap getReferenceErrorMap() {
+        return nativeReferenceErrorMap;
+    }
+
+    PropertyMap getRegExpMap() {
+        return nativeRegExpMap;
+    }
+
+    PropertyMap getRegExpExecResultMap() {
+        return nativeRegExpExecResultMap;
+    }
+
+    PropertyMap getStrictArgumentsMap() {
+        return nativeStrictArgumentsMap;
+    }
+
+    PropertyMap getStringMap() {
+        return nativeStringMap;
+    }
+
+    PropertyMap getSyntaxErrorMap() {
+        return nativeSyntaxErrorMap;
+    }
+
+    PropertyMap getTypeErrorMap() {
+        return nativeTypeErrorMap;
+    }
+
+    PropertyMap getURIErrorMap() {
+        return nativeURIErrorMap;
+    }
+
+    PropertyMap getPrototypeObjectMap() {
+        return prototypeObjectMap;
+    }
+
+    PropertyMap getObjectMap() {
+        return objectMap;
+    }
+
+    PropertyMap getFunctionMap() {
+        return functionMap;
+    }
+
+    PropertyMap getAnonymousFunctionMap() {
+        return anonymousFunctionMap;
+    }
+
+    PropertyMap getStrictFunctionMap() {
+        return strictFunctionMap;
+    }
+
+    PropertyMap getBoundFunctionMap() {
+        return boundFunctionMap;
+    }
+
     private ScriptFunction getBuiltinArray() {
         return builtinArray;
     }
 
-
     /**
      * Called from compiled script code to test if builtin has been overridden
      *
@@ -1394,7 +1538,11 @@
     private void init() {
         assert Context.getGlobal() == this : "this global is not set as current";
 
-        final ScriptEnvironment env = context.getEnv();
+        final ScriptEnvironment env = getContext().getEnv();
+
+        // duplicate PropertyMaps of Native* classes
+        copyInitialMaps(env);
+
         // initialize Function and Object constructor
         initFunctionAndObject();
 
@@ -1440,10 +1588,10 @@
         final ScriptObject arrayPrototype = getArrayPrototype();
         arrayPrototype.addOwnProperty("length", Attribute.NOT_ENUMERABLE|Attribute.NOT_CONFIGURABLE, 0.0);
 
-        this.DEFAULT_DATE = new NativeDate(Double.NaN);
+        this.DEFAULT_DATE = new NativeDate(Double.NaN, this);
 
         // initialize default regexp object
-        this.DEFAULT_REGEXP = new NativeRegExp("(?:)");
+        this.DEFAULT_REGEXP = new NativeRegExp("(?:)", this);
 
         // RegExp.prototype should behave like a RegExp object. So copy the
         // properties.
@@ -1454,12 +1602,16 @@
         initErrorObjects();
 
         // java access
-        initJavaAccess();
+        if (! env._no_java) {
+            initJavaAccess();
+        }
 
-        initTypedArray();
+        if (! env._no_typed_arrays) {
+            initTypedArray();
+        }
 
         if (env._scripting) {
-            initScripting();
+            initScripting(env);
         }
 
         if (Context.DEBUG && System.getSecurityManager() == null) {
@@ -1540,7 +1692,7 @@
         this.builtinJavaApi = initConstructor("Java");
     }
 
-    private void initScripting() {
+    private void initScripting(final ScriptEnvironment scriptEnv) {
         Object value;
         value = ScriptFunctionImpl.makeFunction("readLine", ScriptingFunctions.READLINE);
         addOwnProperty("readLine", Attribute.NOT_ENUMERABLE, value);
@@ -1559,7 +1711,6 @@
 
         // Nashorn extension: global.$OPTIONS (scripting-mode-only)
         final ScriptObject options = newObject();
-        final ScriptEnvironment scriptEnv = context.getEnv();
         copyOptions(options, scriptEnv);
         addOwnProperty("$OPTIONS", Attribute.NOT_ENUMERABLE, options);
 
@@ -1712,6 +1863,46 @@
         }
     }
 
+    private void copyInitialMaps(final ScriptEnvironment env) {
+        this.accessorPropertyDescriptorMap = AccessorPropertyDescriptor.getInitialMap().duplicate();
+        this.dataPropertyDescriptorMap = DataPropertyDescriptor.getInitialMap().duplicate();
+        this.genericPropertyDescriptorMap = GenericPropertyDescriptor.getInitialMap().duplicate();
+        this.nativeArgumentsMap = NativeArguments.getInitialMap().duplicate();
+        this.nativeArrayMap = NativeArray.getInitialMap().duplicate();
+        this.nativeBooleanMap = NativeBoolean.getInitialMap().duplicate();
+        this.nativeDateMap = NativeDate.getInitialMap().duplicate();
+        this.nativeErrorMap = NativeError.getInitialMap().duplicate();
+        this.nativeEvalErrorMap = NativeEvalError.getInitialMap().duplicate();
+        this.nativeJSAdapterMap = NativeJSAdapter.getInitialMap().duplicate();
+        this.nativeNumberMap = NativeNumber.getInitialMap().duplicate();
+        this.nativeRangeErrorMap = NativeRangeError.getInitialMap().duplicate();
+        this.nativeReferenceErrorMap = NativeReferenceError.getInitialMap().duplicate();
+        this.nativeRegExpMap = NativeRegExp.getInitialMap().duplicate();
+        this.nativeRegExpExecResultMap = NativeRegExpExecResult.getInitialMap().duplicate();
+        this.nativeStrictArgumentsMap = NativeStrictArguments.getInitialMap().duplicate();
+        this.nativeStringMap = NativeString.getInitialMap().duplicate();
+        this.nativeSyntaxErrorMap = NativeSyntaxError.getInitialMap().duplicate();
+        this.nativeTypeErrorMap = NativeTypeError.getInitialMap().duplicate();
+        this.nativeURIErrorMap = NativeURIError.getInitialMap().duplicate();
+        this.prototypeObjectMap = PrototypeObject.getInitialMap().duplicate();
+        this.objectMap = JO.getInitialMap().duplicate();
+        this.functionMap = ScriptFunctionImpl.getInitialMap().duplicate();
+        this.anonymousFunctionMap = ScriptFunctionImpl.getInitialAnonymousMap().duplicate();
+        this.strictFunctionMap = ScriptFunctionImpl.getInitialStrictMap().duplicate();
+        this.boundFunctionMap = ScriptFunctionImpl.getInitialBoundMap().duplicate();
+
+        // java
+        if (! env._no_java) {
+            this.nativeJavaImporterMap = NativeJavaImporter.getInitialMap().duplicate();
+        }
+
+        // typed arrays
+        if (! env._no_typed_arrays) {
+            this.arrayBufferViewMap = ArrayBufferView.getInitialMap().duplicate();
+            this.nativeArrayBufferMap = NativeArrayBuffer.getInitialMap().duplicate();
+        }
+    }
+
     // Function and Object constructors are inter-dependent. Also,
     // Function.prototype
     // functions are not properly initialized. We fix the references here.
@@ -1723,7 +1914,7 @@
         this.builtinFunction = (ScriptFunction)initConstructor("Function");
 
         // create global anonymous function
-        final ScriptFunction anon = ScriptFunctionImpl.newAnonymousFunction();
+        final ScriptFunction anon = ScriptFunctionImpl.newAnonymousFunction(this);
         // need to copy over members of Function.prototype to anon function
         anon.addBoundProperties(getFunctionPrototype());
 
@@ -1792,13 +1983,8 @@
         }
     }
 
-
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
-        try {
-            return MethodHandles.lookup().findStatic(Global.class, name, MH.type(rtype, types));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), Global.class, name, MH.type(rtype, types));
     }
 
     RegExpResult getLastRegExpResult() {
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java	Fri Jul 26 14:07:32 2013 -0700
@@ -31,8 +31,10 @@
 
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.BitSet;
+import jdk.nashorn.internal.runtime.AccessorProperty;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyDescriptor;
 import jdk.nashorn.internal.runtime.PropertyMap;
@@ -41,8 +43,6 @@
 import jdk.nashorn.internal.runtime.ScriptRuntime;
 import jdk.nashorn.internal.runtime.arrays.ArrayData;
 import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
-import jdk.nashorn.internal.lookup.Lookup;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 
 /**
  * ECMA 10.6 Arguments Object.
@@ -64,10 +64,14 @@
     private static final PropertyMap map$;
 
     static {
-        PropertyMap map = PropertyMap.newMap(NativeArguments.class);
-        map = Lookup.newProperty(map, "length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH);
-        map = Lookup.newProperty(map, "callee", Property.NOT_ENUMERABLE, G$CALLEE, S$CALLEE);
-        map$ = map;
+        final ArrayList<Property> properties = new ArrayList<>(2);
+        properties.add(AccessorProperty.create("length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH));
+        properties.add(AccessorProperty.create("callee", Property.NOT_ENUMERABLE, G$CALLEE, S$CALLEE));
+        map$ = PropertyMap.newMap(properties).setIsShared();
+    }
+
+    static PropertyMap getInitialMap() {
+        return map$;
     }
 
     private Object length;
@@ -76,8 +80,8 @@
     // This is lazily initialized - only when delete is invoked at all
     private BitSet deleted;
 
-    NativeArguments(final ScriptObject proto, final Object[] arguments, final Object callee, final int numParams) {
-        super(proto, map$);
+    NativeArguments(final Object[] arguments, final Object callee, final int numParams, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         setIsArguments();
 
         setArray(ArrayData.allocate(arguments));
@@ -550,8 +554,13 @@
     public static ScriptObject allocate(final Object[] arguments, final ScriptFunction callee, final int numParams) {
         // Strict functions won't always have a callee for arguments, and will pass null instead.
         final boolean isStrict = callee == null || callee.isStrict();
-        final ScriptObject proto = Global.objectPrototype();
-        return isStrict ? new NativeStrictArguments(proto, arguments, numParams) : new NativeArguments(proto, arguments, callee, numParams);
+        final Global global = Global.instance();
+        final ScriptObject proto = global.getObjectPrototype();
+        if (isStrict) {
+            return new NativeStrictArguments(arguments, numParams, proto, global.getStrictArgumentsMap());
+        } else {
+            return new NativeArguments(arguments, callee, numParams, proto, global.getArgumentsMap());
+        }
     }
 
     /**
@@ -623,11 +632,6 @@
     }
 
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
-        try {
-            return MethodHandles.lookup().findStatic(NativeArguments.class, name, MH.type(rtype, types));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), NativeArguments.class, name, MH.type(rtype, types));
     }
-
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Jul 26 14:07:32 2013 -0700
@@ -86,6 +86,10 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
     /*
      * Constructors.
      */
@@ -130,7 +134,11 @@
     }
 
     NativeArray(final ArrayData arrayData) {
-        super(Global.instance().getArrayPrototype(), $nasgenmap$);
+        this(arrayData, Global.instance());
+    }
+
+    NativeArray(final ArrayData arrayData, final Global global) {
+        super(global.getArrayPrototype(), global.getArrayMap());
         this.setArray(arrayData);
         this.setIsArray();
     }
@@ -544,35 +552,40 @@
     @Function(attributes = Attribute.NOT_ENUMERABLE, arity = 1)
     public static Object concat(final Object self, final Object... args) {
         final ArrayList<Object> list = new ArrayList<>();
-        final Object selfToObject = Global.toObject(self);
+        concatToList(list, Global.toObject(self));
+
+        for (final Object obj : args) {
+            concatToList(list, obj);
+        }
+
+        return new NativeArray(list.toArray());
+    }
 
-        if (isArray(selfToObject)) {
-            final Iterator<Object> iter = arrayLikeIterator(selfToObject, true);
-            while (iter.hasNext()) {
-                list.add(iter.next());
+    private static void concatToList(final ArrayList<Object> list, final Object obj) {
+        final boolean isScriptArray = isArray(obj);
+        final boolean isScriptObject = isScriptArray || obj instanceof ScriptObject;
+        if (isScriptArray || obj instanceof Iterable || (obj != null && obj.getClass().isArray())) {
+            final Iterator<Object> iter = arrayLikeIterator(obj, true);
+            if (iter.hasNext()) {
+                for(int i = 0; iter.hasNext(); ++i) {
+                    final Object value = iter.next();
+                    if(value == ScriptRuntime.UNDEFINED && isScriptObject && !((ScriptObject)obj).has(i)) {
+                        // TODO: eventually rewrite arrayLikeIterator to use a three-state enum for handling
+                        // UNDEFINED instead of an "includeUndefined" boolean with states SKIP, INCLUDE,
+                        // RETURN_EMPTY. Until then, this is how we'll make sure that empty elements don't make it
+                        // into the concatenated array.
+                        list.add(ScriptRuntime.EMPTY);
+                    } else {
+                        list.add(value);
+                    }
+                }
+            } else if (!isScriptArray) {
+                list.add(obj); // add empty object, but not an empty array
             }
         } else {
             // single element, add it
-            list.add(selfToObject);
+            list.add(obj);
         }
-
-        for (final Object obj : args) {
-            if (isArray(obj) || obj instanceof Iterable || (obj != null && obj.getClass().isArray())) {
-                final Iterator<Object> iter = arrayLikeIterator(obj, true);
-                if (iter.hasNext()) {
-                    while (iter.hasNext()) {
-                        list.add(iter.next());
-                    }
-                } else if (!isArray(obj)) {
-                    list.add(obj); // add empty object, but not an empty array
-                }
-            } else {
-                // single element, add it
-                list.add(obj);
-            }
-        }
-
-        return new NativeArray(list.toArray());
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -43,6 +43,10 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
     @Constructor(arity = 1)
     public static Object constructor(final boolean newObj, final Object self, final Object... args) {
         if (args.length == 0) {
@@ -52,9 +56,13 @@
         return new NativeArrayBuffer(JSType.toInt32(args[0]));
     }
 
+    protected NativeArrayBuffer(final byte[] byteArray, final Global global) {
+        super(global.getArrayBufferPrototype(), global.getArrayBufferMap());
+        this.buffer = byteArray;
+    }
+
     protected NativeArrayBuffer(final byte[] byteArray) {
-        super(Global.instance().getArrayBufferPrototype(), $nasgenmap$);
-        this.buffer = byteArray;
+        this(byteArray, Global.instance());
     }
 
     protected NativeArrayBuffer(final int byteLength) {
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeBoolean.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeBoolean.java	Fri Jul 26 14:07:32 2013 -0700
@@ -40,7 +40,6 @@
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.runtime.ScriptRuntime;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 import jdk.nashorn.internal.runtime.linker.PrimitiveLookup;
 
 /**
@@ -56,15 +55,23 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeBoolean(final boolean value) {
-        this(value, Global.instance().getBooleanPrototype());
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
     }
 
-    private NativeBoolean(final boolean value, final ScriptObject proto) {
-        super(proto, $nasgenmap$);
+    private NativeBoolean(final boolean value, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         this.value = value;
     }
 
+    NativeBoolean(final boolean flag, final Global global) {
+        this(flag, global.getBooleanPrototype(), global.getBooleanMap());
+    }
+
+    NativeBoolean(final boolean flag) {
+        this(flag, Global.instance());
+    }
+
     @Override
     public String safeToString() {
         return "[Boolean " + toString() + "]";
@@ -131,11 +138,7 @@
         final boolean flag = JSType.toBoolean(value);
 
         if (newObj) {
-            final ScriptObject proto = (self instanceof ScriptObject) ?
-                ((ScriptObject)self).getProto() :
-                Global.instance().getBooleanPrototype();
-
-            return new NativeBoolean(flag, proto);
+            return new NativeBoolean(flag);
         }
 
         return flag;
@@ -176,10 +179,6 @@
     }
 
     private static MethodHandle findWrapFilter() {
-        try {
-            return MethodHandles.lookup().findStatic(NativeBoolean.class, "wrapFilter", MH.type(NativeBoolean.class, Object.class));
-        } catch (NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), NativeBoolean.class, "wrapFilter", MH.type(NativeBoolean.class, Object.class));
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java	Fri Jul 26 14:07:32 2013 -0700
@@ -104,18 +104,30 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeDate() {
-        this(System.currentTimeMillis());
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
     }
 
-    NativeDate(final double time) {
-        super(Global.instance().getDatePrototype(), $nasgenmap$);
+    private NativeDate(final double time, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         final ScriptEnvironment env = Global.getEnv();
 
         this.time = time;
         this.timezone = env._timezone;
     }
 
+    NativeDate(final double time, final Global global) {
+        this(time, global.getDatePrototype(), global.getDateMap());
+    }
+
+    private NativeDate (final double time) {
+        this(time, Global.instance());
+    }
+
+    private NativeDate() {
+        this(System.currentTimeMillis());
+    }
+
     @Override
     public String getClassName() {
         return "Date";
@@ -153,6 +165,10 @@
      */
     @Constructor(arity = 7)
     public static Object construct(final boolean isNew, final Object self, final Object... args) {
+        if (! isNew) {
+            return toStringImpl(new NativeDate(), FORMAT_DATE_TIME);
+        }
+
         NativeDate result;
         switch (args.length) {
         case 0:
@@ -182,7 +198,7 @@
             break;
          }
 
-         return isNew ? result : toStringImpl(new NativeDate(), FORMAT_DATE_TIME);
+         return result;
     }
 
     @Override
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Fri Jul 26 14:07:32 2013 -0700
@@ -49,10 +49,12 @@
 public final class NativeDebug extends ScriptObject {
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
-    NativeDebug() {
-        super(Global.objectPrototype(), $nasgenmap$);
+    private NativeDebug() {
+        // don't create me!
+        throw new UnsupportedOperationException();
     }
 
     @Override
@@ -143,7 +145,7 @@
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
     public static Object equals(final Object self, final Object obj1, final Object obj2) {
-        return (obj1 != null) ? obj1.equals(obj2) : false;
+        return Objects.equals(obj1, obj2);
     }
 
     /**
@@ -176,6 +178,18 @@
     }
 
     /**
+     * Returns the property listener count for a script object
+     *
+     * @param self self reference
+     * @param obj  script object whose listener count is returned
+     * @return listener count
+     */
+    @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
+    public static Object getListenerCount(final Object self, final Object obj) {
+        return (obj instanceof ScriptObject)? ((ScriptObject)obj).getListenerCount() : 0;
+    }
+
+    /**
      * Dump all Nashorn debug mode counters. Calling this may be better if
      * you want to print all counters. This way you can avoid too many callsites
      * due to counter access itself!!
@@ -196,6 +210,8 @@
         out.println("ScriptFunction allocations " + ScriptFunction.getAllocations());
         out.println("PropertyMap count " + PropertyMap.getCount());
         out.println("PropertyMap cloned " + PropertyMap.getClonedCount());
+        out.println("PropertyMap shared " + PropertyMap.getSharedCount());
+        out.println("PropertyMap duplicated " + PropertyMap.getDuplicatedCount());
         out.println("PropertyMap history hit " + PropertyMap.getHistoryHit());
         out.println("PropertyMap proto invalidations " + PropertyMap.getProtoInvalidations());
         out.println("PropertyMap proto history hit " + PropertyMap.getProtoHistoryHit());
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeError.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeError.java	Fri Jul 26 14:07:32 2013 -0700
@@ -31,7 +31,6 @@
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import jdk.nashorn.api.scripting.NashornException;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
 import jdk.nashorn.internal.objects.annotations.Function;
@@ -87,8 +86,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeError(final Object msg) {
-        super(Global.instance().getErrorPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    private NativeError(final Object msg, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         if (msg != UNDEFINED) {
             this.instMessage = JSType.toString(msg);
         } else {
@@ -96,6 +99,14 @@
         }
     }
 
+    NativeError(final Object msg, final Global global) {
+        this(msg, global.getErrorPrototype(), global.getErrorMap());
+    }
+
+    private NativeError(final Object msg) {
+        this(msg, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "Error";
@@ -119,6 +130,7 @@
      * Nashorn extension: Error.captureStackTrace. Capture stack trace at the point of call into the Error object provided.
      *
      * @param self self reference
+     * @param errorObj the error object
      * @return undefined
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
@@ -286,9 +298,9 @@
         final Object exception = ECMAException.getException(sobj);
         if (exception instanceof Throwable) {
             return getScriptStackString(sobj, (Throwable)exception);
-        } else {
-            return "";
         }
+
+        return "";
     }
 
     /**
@@ -353,11 +365,7 @@
     }
 
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
-        try {
-            return MethodHandles.lookup().findStatic(NativeError.class, name, MH.type(rtype, types));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), NativeError.class, name, MH.type(rtype, types));
     }
 
     private static String getScriptStackString(final ScriptObject sobj, final Throwable exp) {
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java	Fri Jul 26 14:07:32 2013 -0700
@@ -58,8 +58,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeEvalError(final Object msg) {
-        super(Global.instance().getEvalErrorPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    private NativeEvalError(final Object msg, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         if (msg != UNDEFINED) {
             this.instMessage = JSType.toString(msg);
         } else {
@@ -67,12 +71,19 @@
         }
     }
 
+    NativeEvalError(final Object msg, final Global global) {
+        this(msg, global.getEvalErrorPrototype(), global.getEvalErrorMap());
+    }
+
+    private NativeEvalError(final Object msg) {
+        this(msg, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "Error";
     }
 
-
     /**
      * ECMA 15.11.6.1 EvalError
      *
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -48,6 +48,7 @@
     public static final int BYTES_PER_ELEMENT = 4;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -191,7 +192,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getFloat32ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getFloat32ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -48,6 +48,7 @@
     public static final int BYTES_PER_ELEMENT = 8;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -201,7 +202,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getFloat64ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getFloat64ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,6 +29,7 @@
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
 
 import java.util.List;
+
 import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
@@ -55,10 +56,12 @@
 public final class NativeFunction {
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     // do *not* create me!
     private NativeFunction() {
+        throw new UnsupportedOperationException();
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -42,6 +42,7 @@
 public final class NativeInt16Array extends ArrayBufferView {
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     /**
@@ -150,7 +151,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getInt16ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getInt16ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -47,6 +47,7 @@
     public static final int BYTES_PER_ELEMENT = 4;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -153,7 +154,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getInt32ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getInt32ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -47,6 +47,7 @@
     public static final int BYTES_PER_ELEMENT = 1;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -143,7 +144,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getInt8ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getInt8ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -48,7 +48,7 @@
 import jdk.nashorn.internal.runtime.ScriptRuntime;
 import jdk.nashorn.internal.runtime.arrays.ArrayLikeIterator;
 import jdk.nashorn.internal.lookup.Lookup;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
+import jdk.nashorn.internal.scripts.JO;
 
 /**
  * This class is the implementation of the Nashorn-specific global object named {@code JSAdapter}. It can be
@@ -146,8 +146,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeJSAdapter(final ScriptObject proto, final Object overrides, final ScriptObject adaptee) {
-        super(proto, $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    NativeJSAdapter(final Object overrides, final ScriptObject adaptee, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         this.adaptee = wrapAdaptee(adaptee);
         if (overrides instanceof ScriptObject) {
             this.overrides = true;
@@ -159,9 +163,7 @@
     }
 
     private static ScriptObject wrapAdaptee(final ScriptObject adaptee) {
-        final ScriptObject sobj = new jdk.nashorn.internal.scripts.JO();
-        sobj.setProto(adaptee);
-        return sobj;
+        return new JO(adaptee, Global.instance().getObjectMap());
     }
 
     @Override
@@ -570,11 +572,12 @@
             throw typeError("not.an.object", ScriptRuntime.safeToString(adaptee));
         }
 
+        final Global global = Global.instance();
         if (proto != null && !(proto instanceof ScriptObject)) {
-            proto = Global.instance().getJSAdapterPrototype();
+            proto = global.getJSAdapterPrototype();
         }
 
-        return new NativeJSAdapter((ScriptObject)proto, overrides, (ScriptObject)adaptee);
+        return new NativeJSAdapter(overrides, (ScriptObject)adaptee, (ScriptObject)proto, global.getJSAdapterMap());
     }
 
     @Override
@@ -619,12 +622,15 @@
         case "getMethod":
             final FindProperty find = adaptee.findProperty(__call__, true);
             if (find != null) {
-                final ScriptFunctionImpl func = (ScriptFunctionImpl)getObjectValue(find);
-                // TODO: It's a shame we need to produce a function bound to this and name, when we'd only need it bound
-                // to name. Probably not a big deal, but if we can ever make it leaner, it'd be nice.
-                return new GuardedInvocation(MH.dropArguments(MH.constant(Object.class,
-                        func.makeBoundFunction(this, new Object[] { name })), 0, Object.class),
-                        adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), __call__), testJSAdaptor(adaptee, null, null, null));
+                final Object value = getObjectValue(find);
+                if (value instanceof ScriptFunction) {
+                    final ScriptFunctionImpl func = (ScriptFunctionImpl)value;
+                    // TODO: It's a shame we need to produce a function bound to this and name, when we'd only need it bound
+                    // to name. Probably not a big deal, but if we can ever make it leaner, it'd be nice.
+                    return new GuardedInvocation(MH.dropArguments(MH.constant(Object.class,
+                            func.makeBoundFunction(this, new Object[] { name })), 0, Object.class),
+                            adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), __call__), testJSAdaptor(adaptee, null, null, null));
+                }
             }
             throw typeError("no.such.function", desc.getNameToken(2), ScriptRuntime.safeToString(this));
         default:
@@ -684,16 +690,19 @@
         final MethodType type = desc.getMethodType();
         if (findData != null) {
             final String name = desc.getNameTokenCount() > 2 ? desc.getNameToken(2) : null;
-            final ScriptFunction func = (ScriptFunction)getObjectValue(findData);
+            final Object value = getObjectValue(findData);
+            if (value instanceof ScriptFunction) {
+                final ScriptFunction func = (ScriptFunction)value;
 
-            final MethodHandle methodHandle = getCallMethodHandle(findData, type,
+                final MethodHandle methodHandle = getCallMethodHandle(findData, type,
                     useName ? name : null);
-            if (methodHandle != null) {
-                return new GuardedInvocation(
-                        methodHandle,
-                        adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), hook),
-                        testJSAdaptor(adaptee, findData.getGetter(Object.class), findData.getOwner(), func));
-            }
+                if (methodHandle != null) {
+                    return new GuardedInvocation(
+                            methodHandle,
+                            adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), hook),
+                            testJSAdaptor(adaptee, findData.getGetter(Object.class), findData.getOwner(), func));
+                }
+             }
         }
 
         switch (hook) {
@@ -736,10 +745,6 @@
     }
 
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
-        try {
-            return MethodHandles.lookup().findStatic(NativeJSAdapter.class, name, MH.type(rtype, types));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), NativeJSAdapter.class, name, MH.type(rtype, types));
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java	Fri Jul 26 14:07:32 2013 -0700
@@ -60,10 +60,12 @@
             ScriptFunction.class, ScriptObject.class, Object.class, Object.class);
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
-    NativeJSON() {
-        super(Global.objectPrototype(), $nasgenmap$);
+    private NativeJSON() {
+        // don't create me!!
+        throw new UnsupportedOperationException();
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java	Fri Jul 26 14:07:32 2013 -0700
@@ -32,12 +32,14 @@
 import java.util.Collection;
 import java.util.Deque;
 import java.util.List;
+
 import jdk.internal.dynalink.beans.StaticClass;
 import jdk.internal.dynalink.support.TypeUtilities;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Function;
 import jdk.nashorn.internal.objects.annotations.ScriptClass;
 import jdk.nashorn.internal.objects.annotations.Where;
+import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.ListAdapter;
 import jdk.nashorn.internal.runtime.PropertyMap;
@@ -54,9 +56,12 @@
 public final class NativeJava {
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private NativeJava() {
+        // don't create me
+        throw new UnsupportedOperationException();
     }
 
     /**
@@ -103,12 +108,22 @@
      * var anArrayList = new ArrayList
      * var anArrayListWithSize = new ArrayList(16)
      * </pre>
-     * In the special case of inner classes, you need to use the JVM fully qualified name, meaning using {@code $} sign
-     * in the class name:
+     * In the special case of inner classes, you can either use the JVM fully qualified name, meaning using {@code $}
+     * sign in the class name, or you can use the dot:
      * <pre>
      * var ftype = Java.type("java.awt.geom.Arc2D$Float")
      * </pre>
-     * However, once you retrieved the outer class, you can access the inner class as a property on it:
+     * and
+     * <pre>
+     * var ftype = Java.type("java.awt.geom.Arc2D.Float")
+     * </pre>
+     * both work. Note however that using the dollar sign is faster, as Java.type first tries to resolve the class name
+     * as it is originally specified, and the internal JVM names for inner classes use the dollar sign. If you use the
+     * dot, Java.type will internally get a ClassNotFoundException and subsequently retry by changing the last dot to
+     * dollar sign. As a matter of fact, it'll keep replacing dots with dollar signs until it either successfully loads
+     * the class or runs out of all dots in the name. This way it can correctly resolve and load even multiply nested
+     * inner classes with the dot notation. Again, this will be slower than using the dollar signs in the name. An
+     * alternative way to access the inner class is as a property of the outer class:
      * <pre>
      * var arctype = Java.type("java.awt.geom.Arc2D")
      * var ftype = arctype.Float
@@ -388,7 +403,33 @@
 
     private static Class<?> simpleType(final String typeName) throws ClassNotFoundException {
         final Class<?> primClass = TypeUtilities.getPrimitiveTypeByName(typeName);
-        return primClass != null ? primClass : Global.getThisContext().findClass(typeName);
+        if(primClass != null) {
+            return primClass;
+        }
+        final Context ctx = Global.getThisContext();
+        try {
+            return ctx.findClass(typeName);
+        } catch(ClassNotFoundException e) {
+            // The logic below compensates for a frequent user error - when people use dot notation to separate inner
+            // class names, i.e. "java.lang.Character.UnicodeBlock" vs."java.lang.Character$UnicodeBlock". The logic
+            // below will try alternative class names, replacing dots at the end of the name with dollar signs.
+            final StringBuilder nextName = new StringBuilder(typeName);
+            int lastDot = nextName.length();
+            for(;;) {
+                lastDot = nextName.lastIndexOf(".", lastDot - 1);
+                if(lastDot == -1) {
+                    // Exhausted the search space, class not found - rethrow the original exception.
+                    throw e;
+                }
+                nextName.setCharAt(lastDot, '$');
+                try {
+                    return ctx.findClass(nextName.toString());
+                } catch(ClassNotFoundException cnfe) {
+                    // Intentionally ignored, so the loop retries with the next name
+                }
+            }
+        }
+
     }
 
     private static Class<?> arrayType(final String typeName) throws ClassNotFoundException {
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -59,11 +59,23 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeJavaImporter(final Object[] args) {
-        super(Global.instance().getJavaImporterPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    private NativeJavaImporter(final Object[] args, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         this.args = args;
     }
 
+    private NativeJavaImporter(final Object[] args, final Global global) {
+        this(args, global.getJavaImporterPrototype(), global.getJavaImporterMap());
+    }
+
+    private NativeJavaImporter(final Object[] args) {
+        this(args, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "JavaImporter";
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java	Fri Jul 26 14:07:32 2013 -0700
@@ -43,10 +43,12 @@
 public final class NativeMath extends ScriptObject {
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
-    NativeMath() {
-        super(Global.objectPrototype(), $nasgenmap$);
+    private NativeMath() {
+        // don't create me!
+        throw new UnsupportedOperationException();
     }
 
     /** ECMA 15.8.1.1 - E, always a double constant. Not writable or configurable */
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeNumber.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeNumber.java	Fri Jul 26 14:07:32 2013 -0700
@@ -48,7 +48,6 @@
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.runtime.ScriptRuntime;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 import jdk.nashorn.internal.runtime.linker.PrimitiveLookup;
 
 /**
@@ -87,17 +86,26 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeNumber(final double value) {
-        this(value, Global.instance().getNumberPrototype());
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
     }
 
-    private NativeNumber(final double value, final ScriptObject proto) {
-        super(proto, $nasgenmap$);
+    private NativeNumber(final double value, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         this.value = value;
         this.isInt  = isRepresentableAsInt(value);
         this.isLong = isRepresentableAsLong(value);
     }
 
+    NativeNumber(final double value, final Global global) {
+        this(value, global.getNumberPrototype(), global.getNumberMap());
+    }
+
+    private NativeNumber(final double value) {
+        this(value, Global.instance());
+    }
+
+
     @Override
     public String safeToString() {
         return "[Number " + toString() + "]";
@@ -165,16 +173,7 @@
     public static Object constructor(final boolean newObj, final Object self, final Object... args) {
         final double num = (args.length > 0) ? JSType.toNumber(args[0]) : 0.0;
 
-        if (newObj) {
-            final ScriptObject proto =
-                (self instanceof ScriptObject) ?
-                    ((ScriptObject)self).getProto() :
-                    Global.instance().getNumberPrototype();
-
-            return new NativeNumber(num, proto);
-        }
-
-        return num;
+        return newObj? new NativeNumber(num) : num;
     }
 
     /**
@@ -380,10 +379,6 @@
     }
 
     private static MethodHandle findWrapFilter() {
-        try {
-            return MethodHandles.lookup().findStatic(NativeNumber.class, "wrapFilter", MH.type(NativeNumber.class, Object.class));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), NativeNumber.class, "wrapFilter", MH.type(NativeNumber.class, Object.class));
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,18 +28,37 @@
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
 
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import jdk.internal.dynalink.beans.BeansLinker;
+import jdk.internal.dynalink.beans.StaticClass;
+import jdk.internal.dynalink.linker.GuardedInvocation;
+import jdk.internal.dynalink.linker.GuardingDynamicLinker;
+import jdk.internal.dynalink.linker.LinkRequest;
+import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
+import jdk.internal.dynalink.support.LinkRequestImpl;
 import jdk.nashorn.api.scripting.ScriptObjectMirror;
+import jdk.nashorn.internal.lookup.Lookup;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
 import jdk.nashorn.internal.objects.annotations.Function;
 import jdk.nashorn.internal.objects.annotations.ScriptClass;
 import jdk.nashorn.internal.objects.annotations.Where;
+import jdk.nashorn.internal.runtime.AccessorProperty;
 import jdk.nashorn.internal.runtime.ECMAException;
 import jdk.nashorn.internal.runtime.JSType;
+import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.runtime.ScriptRuntime;
+import jdk.nashorn.internal.runtime.linker.Bootstrap;
 import jdk.nashorn.internal.runtime.linker.InvokeByName;
 
 /**
@@ -53,11 +72,16 @@
 @ScriptClass("Object")
 public final class NativeObject {
     private static final InvokeByName TO_STRING = new InvokeByName("toString", ScriptObject.class);
+    private static final MethodType MIRROR_GETTER_TYPE = MethodType.methodType(Object.class, ScriptObjectMirror.class);
+    private static final MethodType MIRROR_SETTER_TYPE = MethodType.methodType(Object.class, ScriptObjectMirror.class, Object.class);
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private NativeObject() {
+        // don't create me!
+        throw new UnsupportedOperationException();
     }
 
     private static ECMAException notAnObject(final Object obj) {
@@ -469,4 +493,192 @@
 
         return false;
     }
+
+    /**
+     * Nashorn extension: Object.bindProperties
+     *
+     * Binds the source object's properties to the target object. Binding
+     * properties allows two-way read/write for the properties of the source object.
+     *
+     * Example:
+     * <pre>
+     * var obj = { x: 34, y: 100 };
+     * var foo = {}
+     *
+     * // bind properties of "obj" to "foo" object
+     * Object.bindProperties(foo, obj);
+     *
+     * // now, we can access/write on 'foo' properties
+     * print(foo.x); // prints obj.x which is 34
+     *
+     * // update obj.x via foo.x
+     * foo.x = "hello";
+     * print(obj.x); // prints "hello" now
+     *
+     * obj.x = 42;   // foo.x also becomes 42
+     * print(foo.x); // prints 42
+     * </pre>
+     * <p>
+     * The source object bound can be a ScriptObject or a ScriptOjectMirror.
+     * null or undefined source object results in TypeError being thrown.
+     * </p>
+     * Example:
+     * <pre>
+     * var obj = loadWithNewGlobal({
+     *    name: "test",
+     *    script: "obj = { x: 33, y: 'hello' }"
+     * });
+     *
+     * // bind 'obj's properties to global scope 'this'
+     * Object.bindProperties(this, obj);
+     * print(x);         // prints 33
+     * print(y);         // prints "hello"
+     * x = Math.PI;      // changes obj.x to Math.PI
+     * print(obj.x);     // prints Math.PI
+     * </pre>
+     *
+     * Limitations of property binding:
+     * <ul>
+     * <li> Only enumerable, immediate (not proto inherited) properties of the source object are bound.
+     * <li> If the target object already contains a property called "foo", the source's "foo" is skipped (not bound).
+     * <li> Properties added to the source object after binding to the target are not bound.
+     * <li> Property configuration changes on the source object (or on the target) is not propagated.
+     * <li> Delete of property on the target (or the source) is not propagated -
+     * only the property value is set to 'undefined' if the property happens to be a data property.
+     * </ul>
+     * <p>
+     * It is recommended that the bound properties be treated as non-configurable
+     * properties to avoid surprises.
+     * </p>
+     *
+     * @param self self reference
+     * @param target the target object to which the source object's properties are bound
+     * @param source the source object whose properties are bound to the target
+     * @return the target object after property binding
+     */
+    @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
+    public static Object bindProperties(final Object self, final Object target, final Object source) {
+        // target object has to be a ScriptObject
+        Global.checkObject(target);
+        // check null or undefined source object
+        Global.checkObjectCoercible(source);
+
+        final ScriptObject targetObj = (ScriptObject)target;
+
+        if (source instanceof ScriptObject) {
+            final ScriptObject sourceObj = (ScriptObject)source;
+            final Property[] properties = sourceObj.getMap().getProperties();
+
+            // filter non-enumerable properties
+            final ArrayList<Property> propList = new ArrayList<>();
+            for (Property prop : properties) {
+                if (prop.isEnumerable()) {
+                    propList.add(prop);
+                }
+            }
+
+            if (! propList.isEmpty()) {
+                targetObj.addBoundProperties(sourceObj, propList.toArray(new Property[propList.size()]));
+            }
+        } else if (source instanceof ScriptObjectMirror) {
+            // get enumerable, immediate properties of mirror
+            final ScriptObjectMirror mirror = (ScriptObjectMirror)source;
+            final String[] keys = mirror.getOwnKeys(false);
+            if (keys.length == 0) {
+                // nothing to bind
+                return target;
+            }
+
+            // make accessor properties using dynamic invoker getters and setters
+            final AccessorProperty[] props = new AccessorProperty[keys.length];
+            for (int idx = 0; idx < keys.length; idx++) {
+                final String name = keys[idx];
+                final MethodHandle getter = Bootstrap.createDynamicInvoker("dyn:getMethod|getProp|getElem:" + name, MIRROR_GETTER_TYPE);
+                final MethodHandle setter = Bootstrap.createDynamicInvoker("dyn:setProp|setElem:" + name, MIRROR_SETTER_TYPE);
+                props[idx] = (AccessorProperty.create(name, 0, getter, setter));
+            }
+
+            targetObj.addBoundProperties(source, props);
+        } else if (source instanceof StaticClass) {
+            final Class<?> clazz = ((StaticClass)source).getRepresentedClass();
+            bindBeanProperties(targetObj, source, BeansLinker.getReadableStaticPropertyNames(clazz),
+                    BeansLinker.getWritableStaticPropertyNames(clazz), BeansLinker.getStaticMethodNames(clazz));
+        } else {
+            final Class<?> clazz = source.getClass();
+            bindBeanProperties(targetObj, source, BeansLinker.getReadableInstancePropertyNames(clazz),
+                    BeansLinker.getWritableInstancePropertyNames(clazz), BeansLinker.getInstanceMethodNames(clazz));
+        }
+
+        return target;
+    }
+
+    private static void bindBeanProperties(final ScriptObject targetObj, final Object source,
+            final Collection<String> readablePropertyNames, final Collection<String> writablePropertyNames,
+            final Collection<String> methodNames) {
+        final Set<String> propertyNames = new HashSet<>(readablePropertyNames);
+        propertyNames.addAll(writablePropertyNames);
+
+        final Class<?> clazz = source.getClass();
+        Bootstrap.checkReflectionAccess(clazz);
+
+        final MethodType getterType = MethodType.methodType(Object.class, clazz);
+        final MethodType setterType = MethodType.methodType(Object.class, clazz, Object.class);
+
+        final GuardingDynamicLinker linker = BeansLinker.getLinkerForClass(clazz);
+
+        final List<AccessorProperty> properties = new ArrayList<>(propertyNames.size() + methodNames.size());
+        for(final String methodName: methodNames) {
+            properties.add(AccessorProperty.create(methodName, Property.NOT_WRITABLE,
+                    getBoundBeanMethodGetter(source, getBeanOperation(linker, "dyn:getMethod:" + methodName, getterType, source)),
+                    null));
+        }
+        for(final String propertyName: propertyNames) {
+            final boolean isWritable = writablePropertyNames.contains(propertyName);
+            properties.add(AccessorProperty.create(propertyName, isWritable ? 0 : Property.NOT_WRITABLE,
+                    readablePropertyNames.contains(propertyName) ? getBeanOperation(linker, "dyn:getProp:" + propertyName, getterType, source) : Lookup.EMPTY_GETTER,
+                    isWritable ? getBeanOperation(linker, "dyn:setProp:" + propertyName, setterType, source) : Lookup.EMPTY_SETTER));
+        }
+
+        targetObj.addBoundProperties(source, properties.toArray(new AccessorProperty[properties.size()]));
+    }
+
+    private static MethodHandle getBoundBeanMethodGetter(Object source, MethodHandle methodGetter) {
+        try {
+            // NOTE: we're relying on the fact that "dyn:getMethod:..." return value is constant for any given method
+            // name and object linked with BeansLinker. (Actually, an even stronger assumption is true: return value is
+            // constant for any given method name and object's class.)
+            return MethodHandles.dropArguments(MethodHandles.constant(Object.class,
+                    Bootstrap.bindDynamicMethod(methodGetter.invoke(source), source)), 0, Object.class);
+        } catch(RuntimeException|Error e) {
+            throw e;
+        } catch(Throwable t) {
+            throw new RuntimeException(t);
+        }
+    }
+
+    private static MethodHandle getBeanOperation(final GuardingDynamicLinker linker, final String operation,
+            final MethodType methodType, final Object source) {
+        final GuardedInvocation inv;
+        try {
+            inv = linker.getGuardedInvocation(createLinkRequest(operation, methodType, source),
+                Bootstrap.getLinkerServices());
+            assert passesGuard(source, inv.getGuard());
+        } catch(RuntimeException|Error e) {
+            throw e;
+        } catch(Throwable t) {
+            throw new RuntimeException(t);
+        }
+        assert inv.getSwitchPoint() == null; // Linkers in Dynalink's beans package don't use switchpoints.
+        // We discard the guard, as all method handles will be bound to a specific object.
+        return inv.getInvocation();
+    }
+
+    private static boolean passesGuard(final Object obj, final MethodHandle guard) throws Throwable {
+        return guard == null || (boolean)guard.invoke(obj);
+    }
+
+    private static LinkRequest createLinkRequest(String operation, MethodType methodType, Object source) {
+        return new LinkRequestImpl(CallSiteDescriptorFactory.create(MethodHandles.publicLookup(), operation,
+                methodType), false, source);
+    }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java	Fri Jul 26 14:07:32 2013 -0700
@@ -58,8 +58,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeRangeError(final Object msg) {
-        super(Global.instance().getRangeErrorPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    private NativeRangeError(final Object msg, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         if (msg != UNDEFINED) {
             this.instMessage = JSType.toString(msg);
         } else {
@@ -67,6 +71,14 @@
         }
     }
 
+    NativeRangeError(final Object msg, final Global global) {
+        this(msg, global.getRangeErrorPrototype(), global.getRangeErrorMap());
+    }
+
+    private NativeRangeError(final Object msg) {
+        this(msg, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "Error";
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java	Fri Jul 26 14:07:32 2013 -0700
@@ -58,8 +58,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeReferenceError(final Object msg) {
-        super(Global.instance().getReferenceErrorPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    private NativeReferenceError(final Object msg, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         if (msg != UNDEFINED) {
             this.instMessage = JSType.toString(msg);
         } else {
@@ -67,6 +71,14 @@
         }
     }
 
+    NativeReferenceError(final Object msg, final Global global) {
+        this(msg, global.getReferenceErrorPrototype(), global.getReferenceErrorMap());
+    }
+
+    private NativeReferenceError(final Object msg) {
+        this(msg, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "Error";
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java	Fri Jul 26 14:07:32 2013 -0700
@@ -68,9 +68,20 @@
     private Global globalObject;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
-    NativeRegExp(final String input, final String flagString) {
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    private NativeRegExp(final Global global) {
+        super(global.getRegExpPrototype(), global.getRegExpMap());
+        this.globalObject = global;
+    }
+
+    NativeRegExp(final String input, final String flagString, final Global global) {
+        this(global);
         try {
             this.regexp = RegExpFactory.create(input, flagString);
         } catch (final ParserException e) {
@@ -80,17 +91,24 @@
         }
 
         this.setLastIndex(0);
-        init();
+    }
+
+    NativeRegExp(final String input, final String flagString) {
+        this(input, flagString, Global.instance());
+    }
+
+    NativeRegExp(final String string, final Global global) {
+        this(string, "", global);
     }
 
     NativeRegExp(final String string) {
-        this(string, "");
+        this(string, Global.instance());
     }
 
     NativeRegExp(final NativeRegExp regExp) {
+        this(Global.instance());
         this.lastIndex  = regExp.getLastIndexObject();
         this.regexp      = regExp.getRegExp();
-        init();
     }
 
     @Override
@@ -614,7 +632,7 @@
             return null;
         }
 
-        return new NativeRegExpExecResult(match);
+        return new NativeRegExpExecResult(match, globalObject);
     }
 
     /**
@@ -885,12 +903,6 @@
         this.lastIndex = JSType.toObject(lastIndex);
     }
 
-    private void init() {
-        // Keep reference to global object to support "static" properties of RegExp
-        this.globalObject = Global.instance();
-        this.setProto(globalObject.getRegExpPrototype());
-    }
-
     private static NativeRegExp checkRegExp(final Object self) {
         Global.checkObjectCoercible(self);
         if (self instanceof NativeRegExp) {
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java	Fri Jul 26 14:07:32 2013 -0700
@@ -53,8 +53,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeRegExpExecResult(final RegExpResult result) {
-        super(Global.instance().getArrayPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    NativeRegExpExecResult(final RegExpResult result, final Global global) {
+        super(global.getArrayPrototype(), global.getRegExpExecResultMap());
         setIsArray();
         this.setArray(ArrayData.allocate(result.getGroups().clone()));
         this.index = result.getIndex();
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java	Fri Jul 26 14:07:32 2013 -0700
@@ -30,14 +30,14 @@
 
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
 import java.util.Arrays;
+import jdk.nashorn.internal.runtime.AccessorProperty;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.runtime.arrays.ArrayData;
-import jdk.nashorn.internal.lookup.Lookup;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 
 /**
  * ECMA 10.6 Arguments Object.
@@ -54,21 +54,26 @@
     private static final PropertyMap map$;
 
     static {
-        PropertyMap map = PropertyMap.newMap(NativeStrictArguments.class);
-        map = Lookup.newProperty(map, "length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH);
+        final ArrayList<Property> properties = new ArrayList<>(1);
+        properties.add(AccessorProperty.create("length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH));
+        PropertyMap map = PropertyMap.newMap(properties);
         // In strict mode, the caller and callee properties should throw TypeError
         // Need to add properties directly to map since slots are assigned speculatively by newUserAccessors.
         final int flags = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE;
         map = map.addProperty(map.newUserAccessors("caller", flags));
         map = map.addProperty(map.newUserAccessors("callee", flags));
-        map$ = map;
+        map$ = map.setIsShared();
+    }
+
+    static PropertyMap getInitialMap() {
+        return map$;
     }
 
     private Object   length;
     private final Object[] namedArgs;
 
-    NativeStrictArguments(final ScriptObject proto, final Object[] values, final int numParams) {
-        super(proto, map$);
+    NativeStrictArguments(final Object[] values, final int numParams,final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         setIsArguments();
 
         final ScriptFunction func = ScriptFunctionImpl.getTypeErrorThrower();
@@ -143,10 +148,6 @@
     }
 
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
-        try {
-            return MethodHandles.lookup().findStatic(NativeStrictArguments.class, name, MH.type(rtype, types));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), NativeStrictArguments.class, name, MH.type(rtype, types));
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeString.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeString.java	Fri Jul 26 14:07:32 2013 -0700
@@ -41,7 +41,7 @@
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
+import jdk.nashorn.internal.lookup.MethodHandleFactory.LookupException;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
 import jdk.nashorn.internal.objects.annotations.Function;
@@ -74,12 +74,20 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeString(final CharSequence value) {
-        this(value, Global.instance().getStringPrototype());
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
     }
 
-    private NativeString(final CharSequence value, final ScriptObject proto) {
-        super(proto, $nasgenmap$);
+    private NativeString(final CharSequence value) {
+        this(value, Global.instance());
+    }
+
+    NativeString(final CharSequence value, final Global global) {
+        this(value, global.getStringPrototype(), global.getStringMap());
+    }
+
+    private NativeString(final CharSequence value, final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
         assert value instanceof String || value instanceof ConsString;
         this.value = value;
     }
@@ -147,9 +155,9 @@
 
         if (returnType == Object.class && (self instanceof String || self instanceof ConsString)) {
             try {
-                MethodHandle mh = MethodHandles.lookup().findStatic(NativeString.class, "get", desc.getMethodType());
+                MethodHandle mh = MH.findStatic(MethodHandles.lookup(), NativeString.class, "get", desc.getMethodType());
                 return new GuardedInvocation(mh, NashornGuards.getInstanceOf2Guard(String.class, ConsString.class));
-            } catch (final NoSuchMethodException | IllegalAccessException e) {
+            } catch (final LookupException e) {
                 // Shouldn't happen. Fall back to super
             }
         }
@@ -1065,10 +1073,7 @@
     }
 
     private static Object newObj(final Object self, final CharSequence str) {
-        if (self instanceof ScriptObject) {
-            return new NativeString(str, ((ScriptObject)self).getProto());
-        }
-        return new NativeString(str, Global.instance().getStringPrototype());
+        return new NativeString(str);
     }
 
     /**
@@ -1202,10 +1207,6 @@
     }
 
     private static MethodHandle findWrapFilter() {
-        try {
-            return MethodHandles.lookup().findStatic(NativeString.class, "wrapFilter", MH.type(NativeString.class, Object.class));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), NativeString.class, "wrapFilter", MH.type(NativeString.class, Object.class));
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java	Fri Jul 26 14:07:32 2013 -0700
@@ -58,8 +58,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeSyntaxError(final Object msg) {
-        super(Global.instance().getSyntaxErrorPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    NativeSyntaxError(final Object msg, final Global global) {
+        super(global.getSyntaxErrorPrototype(), global.getSyntaxErrorMap());
         if (msg != UNDEFINED) {
             this.instMessage = JSType.toString(msg);
         } else {
@@ -67,6 +71,10 @@
         }
     }
 
+    private NativeSyntaxError(final Object msg) {
+        this(msg, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "Error";
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java	Fri Jul 26 14:07:32 2013 -0700
@@ -58,8 +58,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeTypeError(final Object msg) {
-        super(Global.instance().getTypeErrorPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    NativeTypeError(final Object msg, final Global global) {
+        super(global.getTypeErrorPrototype(), global.getTypeErrorMap());
         if (msg != UNDEFINED) {
             this.instMessage = JSType.toString(msg);
         } else {
@@ -67,6 +71,10 @@
         }
     }
 
+    private NativeTypeError(final Object msg) {
+        this(msg, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "Error";
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java	Fri Jul 26 14:07:32 2013 -0700
@@ -57,8 +57,12 @@
     // initialized by nasgen
     private static PropertyMap $nasgenmap$;
 
-    NativeURIError(final Object msg) {
-        super(Global.instance().getURIErrorPrototype(), $nasgenmap$);
+    static PropertyMap getInitialMap() {
+        return $nasgenmap$;
+    }
+
+    NativeURIError(final Object msg, final Global global) {
+        super(global.getURIErrorPrototype(), global.getURIErrorMap());
         if (msg != UNDEFINED) {
             this.instMessage = JSType.toString(msg);
         } else {
@@ -66,6 +70,10 @@
         }
     }
 
+    private NativeURIError(final Object msg) {
+        this(msg, Global.instance());
+    }
+
     @Override
     public String getClassName() {
         return "Error";
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -47,6 +47,7 @@
     public static final int BYTES_PER_ELEMENT = 2;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -149,7 +150,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getUint16ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getUint16ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -48,6 +48,7 @@
     public static final int BYTES_PER_ELEMENT = 4;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -168,7 +169,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getUint32ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getUint32ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java	Fri Jul 26 14:07:32 2013 -0700
@@ -47,6 +47,7 @@
     public static final int BYTES_PER_ELEMENT = 1;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -142,7 +143,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getUint8ArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getUint8ArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java	Fri Jul 26 14:07:32 2013 -0700
@@ -48,6 +48,7 @@
     public static final int BYTES_PER_ELEMENT = 1;
 
     // initialized by nasgen
+    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
@@ -159,7 +160,7 @@
     }
 
     @Override
-    protected ScriptObject getPrototype() {
-        return Global.instance().getUint8ClampedArrayPrototype();
+    protected ScriptObject getPrototype(final Global global) {
+        return global.getUint8ClampedArrayPrototype();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java	Fri Jul 26 14:07:32 2013 -0700
@@ -30,12 +30,12 @@
 
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
+import jdk.nashorn.internal.runtime.AccessorProperty;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyMap;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
-import jdk.nashorn.internal.lookup.Lookup;
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 
 /**
  * Instances of this class serve as "prototype" object for script functions.
@@ -52,13 +52,22 @@
     private static final MethodHandle SET_CONSTRUCTOR = findOwnMH("setConstructor", void.class, Object.class, Object.class);
 
     static {
-        PropertyMap map = PropertyMap.newMap(PrototypeObject.class);
-        map = Lookup.newProperty(map, "constructor", Property.NOT_ENUMERABLE, GET_CONSTRUCTOR, SET_CONSTRUCTOR);
-        map$ = map;
+        final ArrayList<Property> properties = new ArrayList<>(1);
+        properties.add(AccessorProperty.create("constructor", Property.NOT_ENUMERABLE, GET_CONSTRUCTOR, SET_CONSTRUCTOR));
+        map$ = PropertyMap.newMap(properties).setIsShared();
+    }
+
+    static PropertyMap getInitialMap() {
+        return map$;
+    }
+
+    private PrototypeObject(final Global global, final PropertyMap map) {
+        super(map != map$? map.addAll(global.getPrototypeObjectMap()) : global.getPrototypeObjectMap());
+        setProto(global.getObjectPrototype());
     }
 
     PrototypeObject() {
-        this(map$);
+        this(Global.instance(), map$);
     }
 
     /**
@@ -67,12 +76,11 @@
      * @param map property map
      */
     public PrototypeObject(final PropertyMap map) {
-        super(map != map$ ? map.addAll(map$) : map$);
-        setProto(Global.objectPrototype());
+        this(Global.instance(), map);
     }
 
     PrototypeObject(final ScriptFunction func) {
-        this(map$);
+        this(Global.instance(), map$);
         this.constructor = func;
     }
 
@@ -107,10 +115,6 @@
     }
 
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
-        try {
-            return MethodHandles.lookup().findStatic(PrototypeObject.class, name, MH.type(rtype, types));
-        } catch (final NoSuchMethodException | IllegalAccessException e) {
-            throw new MethodHandleFactory.LookupException(e);
-        }
+        return MH.findStatic(MethodHandles.lookup(), PrototypeObject.class, name, MH.type(rtype, types));
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,6 +28,7 @@
 import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
 
 import java.lang.invoke.MethodHandle;
+import java.util.ArrayList;
 import jdk.nashorn.internal.runtime.GlobalFunctions;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.PropertyMap;
@@ -36,6 +37,7 @@
 import jdk.nashorn.internal.runtime.ScriptFunctionData;
 import jdk.nashorn.internal.runtime.ScriptObject;
 import jdk.nashorn.internal.lookup.Lookup;
+import jdk.nashorn.internal.runtime.AccessorProperty;
 
 /**
  * Concrete implementation of ScriptFunction. This sets correct map for the
@@ -53,9 +55,30 @@
     // property map for non-strict, non-bound functions.
     private static final PropertyMap map$;
 
+    static PropertyMap getInitialMap() {
+        return map$;
+    }
+
+    static PropertyMap getInitialAnonymousMap() {
+        return AnonymousFunction.getInitialMap();
+    }
+
+    static PropertyMap getInitialStrictMap() {
+        return strictmodemap$;
+    }
+
+    static PropertyMap getInitialBoundMap() {
+        return boundfunctionmap$;
+    }
+
     // Marker object for lazily initialized prototype object
     private static final Object LAZY_PROTOTYPE = new Object();
 
+    private ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final MethodHandle[] specs, final Global global) {
+        super(name, invokeHandle, global.getFunctionMap(), null, specs, false, true, true);
+        init(global);
+    }
+
     /**
      * Constructor called by Nasgen generated code, no membercount, use the default map.
      * Creates builtin functions only.
@@ -65,8 +88,12 @@
      * @param specs specialized versions of this method, if available, null otherwise
      */
     ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final MethodHandle[] specs) {
-        super(name, invokeHandle, map$, null, specs, false, true, true);
-        init();
+        this(name, invokeHandle, specs, Global.instance());
+    }
+
+    private ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final PropertyMap map, final MethodHandle[] specs, final Global global) {
+        super(name, invokeHandle, map.addAll(global.getFunctionMap()), null, specs, false, true, true);
+        init(global);
     }
 
     /**
@@ -79,8 +106,12 @@
      * @param specs specialized versions of this method, if available, null otherwise
      */
     ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final PropertyMap map, final MethodHandle[] specs) {
-        super(name, invokeHandle, map.addAll(map$), null, specs, false, true, true);
-        init();
+        this(name, invokeHandle, map, specs, Global.instance());
+    }
+
+    private ScriptFunctionImpl(final String name, final MethodHandle methodHandle, final ScriptObject scope, final MethodHandle[] specs, final boolean isStrict, final boolean isBuiltin, final boolean isConstructor, final Global global) {
+        super(name, methodHandle, getMap(global, isStrict), scope, specs, isStrict, isBuiltin, isConstructor);
+        init(global);
     }
 
     /**
@@ -95,8 +126,12 @@
      * @param isConstructor can the function be used as a constructor (most can; some built-ins are restricted).
      */
     ScriptFunctionImpl(final String name, final MethodHandle methodHandle, final ScriptObject scope, final MethodHandle[] specs, final boolean isStrict, final boolean isBuiltin, final boolean isConstructor) {
-        super(name, methodHandle, getMap(isStrict), scope, specs, isStrict, isBuiltin, isConstructor);
-        init();
+        this(name, methodHandle, scope, specs, isStrict, isBuiltin, isConstructor, Global.instance());
+    }
+
+    private ScriptFunctionImpl(final RecompilableScriptFunctionData data, final ScriptObject scope, final Global global) {
+        super(data, getMap(global, data.isStrict()), scope);
+        init(global);
     }
 
     /**
@@ -106,27 +141,32 @@
      * @param scope scope object
      */
     public ScriptFunctionImpl(final RecompilableScriptFunctionData data, final ScriptObject scope) {
-        super(data, getMap(data.isStrict()), scope);
-        init();
+        this(data, scope, Global.instance());
     }
 
     /**
      * Only invoked internally from {@link BoundScriptFunctionImpl} constructor.
      * @param data the script function data for the bound function.
+     * @param global the global object
      */
-    ScriptFunctionImpl(final ScriptFunctionData data) {
-        super(data, boundfunctionmap$, null);
-        init();
+    ScriptFunctionImpl(final ScriptFunctionData data, final Global global) {
+        super(data, global.getBoundFunctionMap(), null);
+        init(global);
     }
 
     static {
-        PropertyMap map = PropertyMap.newMap(ScriptFunctionImpl.class);
-        map = Lookup.newProperty(map, "prototype", Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE, G$PROTOTYPE, S$PROTOTYPE);
-        map = Lookup.newProperty(map, "length",    Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE | Property.NOT_WRITABLE, G$LENGTH, null);
-        map = Lookup.newProperty(map, "name",      Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE | Property.NOT_WRITABLE, G$NAME, null);
-        map$ = map;
+        final ArrayList<Property> properties = new ArrayList<>(3);
+        properties.add(AccessorProperty.create("prototype", Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE, G$PROTOTYPE, S$PROTOTYPE));
+        properties.add(AccessorProperty.create("length",  Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE | Property.NOT_WRITABLE, G$LENGTH, null));
+        properties.add(AccessorProperty.create("name", Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE | Property.NOT_WRITABLE, G$NAME, null));
+        map$ = PropertyMap.newMap(properties);
         strictmodemap$ = createStrictModeMap(map$);
         boundfunctionmap$ = createBoundFunctionMap(strictmodemap$);
+        // There are order dependencies between normal map, struct map and bound map
+        // We can make these 'shared' only after initialization of all three.
+        map$.setIsShared();
+        strictmodemap$.setIsShared();
+        boundfunctionmap$.setIsShared();
     }
 
     // function object representing TypeErrorThrower
@@ -149,17 +189,18 @@
         return typeErrorThrower;
     }
 
-    private static PropertyMap createStrictModeMap(PropertyMap map) {
+    private static PropertyMap createStrictModeMap(final PropertyMap map) {
         final int flags = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE;
+        PropertyMap newMap = map;
         // Need to add properties directly to map since slots are assigned speculatively by newUserAccessors.
-        map = map.addProperty(map.newUserAccessors("arguments", flags));
-        map = map.addProperty(map.newUserAccessors("caller", flags));
-        return map;
+        newMap = newMap.addProperty(map.newUserAccessors("arguments", flags));
+        newMap = newMap.addProperty(map.newUserAccessors("caller", flags));
+        return newMap;
     }
 
     // Choose the map based on strict mode!
-    private static PropertyMap getMap(final boolean strict) {
-        return strict ? strictmodemap$ : map$;
+    private static PropertyMap getMap(final Global global, final boolean strict) {
+        return strict ? global.getStrictFunctionMap() : global.getFunctionMap();
     }
 
     private static PropertyMap createBoundFunctionMap(final PropertyMap strictModeMap) {
@@ -171,15 +212,19 @@
     // Instance of this class is used as global anonymous function which
     // serves as Function.prototype object.
     private static class AnonymousFunction extends ScriptFunctionImpl {
-        private static final PropertyMap nasgenmap$$ = PropertyMap.newMap(AnonymousFunction.class);
+        private static final PropertyMap anonmap$ = PropertyMap.newMap().setIsShared();
 
-        AnonymousFunction() {
-            super("", GlobalFunctions.ANONYMOUS, nasgenmap$$, null);
+        static PropertyMap getInitialMap() {
+            return anonmap$;
+        }
+
+        AnonymousFunction(final Global global) {
+            super("", GlobalFunctions.ANONYMOUS, global.getAnonymousFunctionMap(), null);
         }
     }
 
-    static ScriptFunctionImpl newAnonymousFunction() {
-        return new AnonymousFunction();
+    static ScriptFunctionImpl newAnonymousFunction(final Global global) {
+        return new AnonymousFunction(global);
     }
 
     /**
@@ -254,8 +299,8 @@
     }
 
     // Internals below..
-    private void init() {
-        this.setProto(Global.instance().getFunctionPrototype());
+    private void init(final Global global) {
+        this.setProto(global.getFunctionPrototype());
         this.prototype = LAZY_PROTOTYPE;
 
         // We have to fill user accessor functions late as these are stored
--- a/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java	Fri Jul 26 14:07:32 2013 -0700
@@ -35,6 +35,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import jdk.nashorn.internal.ir.Expression;
 import jdk.nashorn.internal.ir.LiteralNode;
 import jdk.nashorn.internal.ir.Node;
 import jdk.nashorn.internal.ir.ObjectNode;
@@ -274,7 +275,7 @@
      * Parse a JSON literal from the token stream
      * @return the JSON literal as a Node
      */
-    private Node jsonLiteral() {
+    private Expression jsonLiteral() {
         final long literalToken = token;
 
         switch (type) {
@@ -326,7 +327,7 @@
      * Parse an array literal from the token stream
      * @return the array literal as a Node
      */
-    private Node arrayLiteral() {
+    private LiteralNode<Expression[]> arrayLiteral() {
         // Unlike JavaScript array literals, elison is not permitted in JSON.
 
         // Capture LBRACKET token.
@@ -334,9 +335,9 @@
         // LBRACKET tested in caller.
         next();
 
-        Node result = null;
+        LiteralNode<Expression[]> result = null;
         // Prepare to accummulating elements.
-        final List<Node> elements = new ArrayList<>();
+        final List<Expression> elements = new ArrayList<>();
 
 loop:
         while (true) {
@@ -368,7 +369,7 @@
      * Parse an object literal from the token stream
      * @return the object literal as a Node
      */
-    private Node objectLiteral() {
+    private ObjectNode objectLiteral() {
         // Capture LBRACE token.
         final long objectToken = token;
         // LBRACE tested in caller.
@@ -423,7 +424,7 @@
 
         if (name != null) {
             expect(COLON);
-            final Node value = jsonLiteral();
+            final Expression value = jsonLiteral();
             return new PropertyNode(propertyToken, value.getFinish(), name, value, null, null);
         }
 
--- a/nashorn/src/jdk/nashorn/internal/parser/Lexer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/parser/Lexer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -546,14 +546,27 @@
     }
 
     /**
+     * interface to receive line information for multi-line literals.
+     */
+    protected interface LineInfoReceiver {
+        /**
+         * Receives line information
+         * @param line last line number
+         * @param linePosition position of last line
+         */
+        public void lineInfo(int line, int linePosition);
+    }
+
+    /**
      * Check whether the given token represents the beginning of a literal. If so scan
      * the literal and return <tt>true</tt>, otherwise return false.
      *
      * @param token the token.
      * @param startTokenType the token type.
+     * @parasm lir LineInfoReceiver that receives line info for multi-line string literals.
      * @return True if a literal beginning with startToken was found and scanned.
      */
-    protected boolean scanLiteral(final long token, final TokenType startTokenType) {
+    protected boolean scanLiteral(final long token, final TokenType startTokenType, final LineInfoReceiver lir) {
         // Check if it can be a literal.
         if (!canStartLiteral(startTokenType)) {
             return false;
@@ -569,7 +582,7 @@
             return scanRegEx();
         } else if (ch0 == '<') {
             if (ch1 == '<') {
-                return scanHereString();
+                return scanHereString(lir);
             } else if (Character.isJavaIdentifierStart(ch1)) {
                 return scanXMLLiteral();
             }
@@ -1417,7 +1430,7 @@
      *
      * @return TRUE if is a here string.
      */
-    private boolean scanHereString() {
+    private boolean scanHereString(final LineInfoReceiver lir) {
         assert ch0 == '<' && ch1 == '<';
         if (scripting) {
             // Record beginning of here string.
@@ -1446,7 +1459,13 @@
 
             // Record rest of line.
             final State restState = saveState();
+            // keep line number updated
+            int lastLine = line;
+            int lastLinePosition = linePosition;
+
             skipLine(false);
+            lastLine++;
+            lastLinePosition = position;
             restState.setLimit(position);
 
             // Record beginning of string.
@@ -1463,9 +1482,14 @@
                 }
 
                 skipLine(false);
+                lastLine++;
+                lastLinePosition = position;
                 stringEnd = position;
             }
 
+            // notify last line information
+            lir.lineInfo(lastLine, lastLinePosition);
+
             // Record end of string.
             stringState.setLimit(stringEnd);
 
--- a/nashorn/src/jdk/nashorn/internal/parser/Parser.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/parser/Parser.java	Fri Jul 26 14:07:32 2013 -0700
@@ -54,9 +54,10 @@
 import static jdk.nashorn.internal.parser.TokenType.WHILE;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import jdk.nashorn.internal.codegen.CompilerConstants;
@@ -66,6 +67,7 @@
 import jdk.nashorn.internal.ir.BinaryNode;
 import jdk.nashorn.internal.ir.Block;
 import jdk.nashorn.internal.ir.BlockLexicalContext;
+import jdk.nashorn.internal.ir.BlockStatement;
 import jdk.nashorn.internal.ir.BreakNode;
 import jdk.nashorn.internal.ir.BreakableNode;
 import jdk.nashorn.internal.ir.CallNode;
@@ -73,7 +75,8 @@
 import jdk.nashorn.internal.ir.CatchNode;
 import jdk.nashorn.internal.ir.ContinueNode;
 import jdk.nashorn.internal.ir.EmptyNode;
-import jdk.nashorn.internal.ir.ExecuteNode;
+import jdk.nashorn.internal.ir.Expression;
+import jdk.nashorn.internal.ir.ExpressionStatement;
 import jdk.nashorn.internal.ir.ForNode;
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
@@ -127,6 +130,9 @@
 
     private static final DebugLogger LOG = new DebugLogger("parser");
 
+    /** to receive line information from Lexer when scanning multine literals. */
+    protected final Lexer.LineInfoReceiver lineInfoReceiver;
+
     /**
      * Constructor
      *
@@ -151,6 +157,19 @@
         this.env       = env;
         this.namespace = new Namespace(env.getNamespace());
         this.scripting = env._scripting;
+        if (this.scripting) {
+            this.lineInfoReceiver = new Lexer.LineInfoReceiver() {
+                @Override
+                public void lineInfo(final int line, final int linePosition) {
+                    // update the parser maintained line information
+                    Parser.this.line = line;
+                    Parser.this.linePosition = linePosition;
+                }
+            };
+        } else {
+            // non-scripting mode script can't have multi-line literals
+            this.lineInfoReceiver = null;
+        }
     }
 
     /**
@@ -350,7 +369,7 @@
      * @return New block.
      */
     private Block newBlock() {
-        return lc.push(new Block(line, token, Token.descPosition(token)));
+        return lc.push(new Block(token, Token.descPosition(token)));
     }
 
     /**
@@ -516,7 +535,7 @@
      * @param rhs Right hand side expression.
      * @return Verified expression.
      */
-    private Node verifyAssignment(final long op, final Node lhs, final Node rhs) {
+    private Expression verifyAssignment(final long op, final Expression lhs, final Expression rhs) {
         final TokenType opType = Token.descType(op);
 
         switch (opType) {
@@ -562,7 +581,7 @@
      * @param isPostfix  Prefix or postfix.
      * @return           Reduced expression.
      */
-    private static Node incDecExpression(final long firstToken, final TokenType tokenType, final Node expression, final boolean isPostfix) {
+    private static UnaryNode incDecExpression(final long firstToken, final TokenType tokenType, final Expression expression, final boolean isPostfix) {
         if (isPostfix) {
             return new UnaryNode(Token.recast(firstToken, tokenType == DECPREFIX ? DECPOSTFIX : INCPOSTFIX), expression.getStart(), Token.descPosition(firstToken) + Token.descLength(firstToken), expression);
         }
@@ -622,8 +641,8 @@
      * @return Directive value if the given statement is a directive
      */
     private String getDirective(final Node stmt) {
-        if (stmt instanceof ExecuteNode) {
-            final Node expr = ((ExecuteNode)stmt).getExpression();
+        if (stmt instanceof ExpressionStatement) {
+            final Node expr = ((ExpressionStatement)stmt).getExpression();
             if (expr instanceof LiteralNode) {
                 final LiteralNode<?> lit = (LiteralNode<?>)expr;
                 final long litToken = lit.getToken();
@@ -836,9 +855,7 @@
      * Parse a statement block.
      */
     private void block() {
-        final Block newBlock = getBlock(true);
-        // Force block execution.
-        appendStatement(new ExecuteNode(newBlock.getLineNumber(), newBlock.getToken(), finish, newBlock));
+        appendStatement(new BlockStatement(line, getBlock(true)));
     }
 
     /**
@@ -921,7 +938,7 @@
             verifyStrictIdent(name, "variable name");
 
             // Assume no init.
-            Node init = null;
+            Expression init = null;
 
             // Look for initializer assignment.
             if (type == ASSIGN) {
@@ -985,20 +1002,20 @@
         final long expressionToken = token;
 
         // Get expression and add as statement.
-        final Node expression = expression();
-
-        ExecuteNode executeNode = null;
+        final Expression expression = expression();
+
+        ExpressionStatement expressionStatement = null;
         if (expression != null) {
-            executeNode = new ExecuteNode(expressionLine, expressionToken, finish, expression);
-            appendStatement(executeNode);
+            expressionStatement = new ExpressionStatement(expressionLine, expressionToken, finish, expression);
+            appendStatement(expressionStatement);
         } else {
             expect(null);
         }
 
         endOfLine();
 
-        if (executeNode != null) {
-            executeNode.setFinish(finish);
+        if (expressionStatement != null) {
+            expressionStatement.setFinish(finish);
             lc.getCurrentBlock().setFinish(finish);
         }
     }
@@ -1020,7 +1037,7 @@
         next();
 
         expect(LPAREN);
-        final Node test = expression();
+        final Expression test = expression();
         expect(RPAREN);
         final Block pass = getStatement();
 
@@ -1049,8 +1066,6 @@
         // Create FOR node, capturing FOR token.
         ForNode forNode = new ForNode(line, token, Token.descPosition(token), null, null, null, null, ForNode.IS_FOR);
 
-        // Set up new block for scope of vars. Captures first token.
-        Block outer = newBlock();
         lc.push(forNode);
 
         try {
@@ -1076,7 +1091,7 @@
             case SEMICOLON:
                 break;
             default:
-                final Node expression = expression(unaryExpression(), COMMARIGHT.getPrecedence(), true);
+                final Expression expression = expression(unaryExpression(), COMMARIGHT.getPrecedence(), true);
                 forNode = forNode.setInit(lc, expression);
                 break;
             }
@@ -1084,6 +1099,12 @@
             switch (type) {
             case SEMICOLON:
                 // for (init; test; modify)
+
+                // for each (init; test; modify) is invalid
+                if (forNode.isForEach()) {
+                    throw error(AbstractParser.message("for.each.without.in"), token);
+                }
+
                 expect(SEMICOLON);
                 if (type != SEMICOLON) {
                     forNode = forNode.setTest(lc, expression());
@@ -1142,15 +1163,11 @@
             final Block body = getStatement();
             forNode = forNode.setBody(lc, body);
             forNode.setFinish(body.getFinish());
-            outer.setFinish(body.getFinish());
 
             appendStatement(forNode);
         } finally {
             lc.pop(forNode);
-            outer = restoreBlock(outer);
         }
-
-        appendStatement(new ExecuteNode(outer.getLineNumber(), outer.getToken(), outer.getFinish(), outer));
      }
 
     /**
@@ -1358,7 +1375,7 @@
         // RETURN tested in caller.
         nextOrEOL();
 
-        Node expression = null;
+        Expression expression = null;
 
         // SEMICOLON or expression.
         switch (type) {
@@ -1394,7 +1411,7 @@
         // YIELD tested in caller.
         nextOrEOL();
 
-        Node expression = null;
+        Expression expression = null;
 
         // SEMICOLON or expression.
         switch (type) {
@@ -1496,7 +1513,7 @@
 
             while (type != RBRACE) {
                 // Prepare for next case.
-                Node caseExpression = null;
+                Expression caseExpression = null;
                 final long caseToken = token;
 
                 switch (type) {
@@ -1589,7 +1606,7 @@
         // THROW tested in caller.
         nextOrEOL();
 
-        Node expression = null;
+        Expression expression = null;
 
         // SEMICOLON or expression.
         switch (type) {
@@ -1637,6 +1654,7 @@
         next();
 
         // Container block needed to act as target for labeled break statements
+        final int startLine = line;
         Block outer = newBlock();
 
         // Create try.
@@ -1656,11 +1674,13 @@
                 verifyStrictIdent(exception, "catch argument");
 
                 // Check for conditional catch.
-                Node ifExpression = null;
+                final Expression ifExpression;
                 if (type == IF) {
                     next();
                     // Get the exception condition.
                     ifExpression = expression();
+                } else {
+                    ifExpression = null;
                 }
 
                 expect(RPAREN);
@@ -1707,7 +1727,7 @@
             outer = restoreBlock(outer);
         }
 
-        appendStatement(new ExecuteNode(outer.getLineNumber(), outer.getToken(), outer.getFinish(), outer));
+        appendStatement(new BlockStatement(startLine, outer));
     }
 
     /**
@@ -1725,7 +1745,7 @@
         // DEBUGGER tested in caller.
         next();
         endOfLine();
-        appendStatement(new ExecuteNode(debuggerLine, debuggerToken, finish, new RuntimeNode(debuggerToken, finish, RuntimeNode.Request.DEBUGGER, new ArrayList<Node>())));
+        appendStatement(new ExpressionStatement(debuggerLine, debuggerToken, finish, new RuntimeNode(debuggerToken, finish, RuntimeNode.Request.DEBUGGER, new ArrayList<Expression>())));
     }
 
     /**
@@ -1743,7 +1763,7 @@
      * @return Expression node.
      */
     @SuppressWarnings("fallthrough")
-    private Node primaryExpression() {
+    private Expression primaryExpression() {
         // Capture first token.
         final int  primaryLine  = line;
         final long primaryToken = token;
@@ -1790,7 +1810,7 @@
         case LPAREN:
             next();
 
-            final Node expression = expression();
+            final Expression expression = expression();
 
             expect(RPAREN);
 
@@ -1798,7 +1818,7 @@
 
         default:
             // In this context some operator tokens mark the start of a literal.
-            if (lexer.scanLiteral(primaryToken, type)) {
+            if (lexer.scanLiteral(primaryToken, type, lineInfoReceiver)) {
                 next();
                 return getLiteral();
             }
@@ -1817,17 +1837,16 @@
      * @param primaryToken Original string token.
      * @return callNode to $EXEC.
      */
-    Node execString(final int primaryLine, final long primaryToken) {
+    CallNode execString(final int primaryLine, final long primaryToken) {
         // Synthesize an ident to call $EXEC.
         final IdentNode execIdent = new IdentNode(primaryToken, finish, ScriptingFunctions.EXEC_NAME);
         // Skip over EXECSTRING.
         next();
         // Set up argument list for call.
-        final List<Node> arguments = new ArrayList<>();
         // Skip beginning of edit string expression.
         expect(LBRACE);
         // Add the following expression to arguments.
-        arguments.add(expression());
+        final List<Expression> arguments = Collections.singletonList(expression());
         // Skip ending of edit string expression.
         expect(RBRACE);
 
@@ -1854,14 +1873,14 @@
      * Parse array literal.
      * @return Expression node.
      */
-    private Node arrayLiteral() {
+    private LiteralNode<Expression[]> arrayLiteral() {
         // Capture LBRACKET token.
         final long arrayToken = token;
         // LBRACKET tested in caller.
         next();
 
         // Prepare to accummulating elements.
-        final List<Node> elements = new ArrayList<>();
+        final List<Expression> elements = new ArrayList<>();
         // Track elisions.
         boolean elision = true;
 loop:
@@ -1889,7 +1908,7 @@
                     throw error(AbstractParser.message("expected.comma", type.getNameOrType()));
                 }
                 // Add expression element.
-                final Node expression = assignmentExpression(false);
+                final Expression expression = assignmentExpression(false);
 
                 if (expression != null) {
                     elements.add(expression);
@@ -1919,7 +1938,7 @@
      * Parse an object literal.
      * @return Expression node.
      */
-    private Node objectLiteral() {
+    private ObjectNode objectLiteral() {
         // Capture LBRACE token.
         final long objectToken = token;
         // LBRACE tested in caller.
@@ -1927,14 +1946,14 @@
 
         // Object context.
         // Prepare to accumulate elements.
-        // final List<Node> elements = new ArrayList<>();
-        final Map<String, PropertyNode> map = new LinkedHashMap<>();
+        final List<PropertyNode> elements = new ArrayList<>();
+        final Map<String, Integer> map = new HashMap<>();
 
         // Create a block for the object literal.
-            boolean commaSeen = true;
+        boolean commaSeen = true;
 loop:
-            while (true) {
-                switch (type) {
+        while (true) {
+            switch (type) {
                 case RBRACE:
                     next();
                     break loop;
@@ -1956,30 +1975,29 @@
                     // Get and add the next property.
                     final PropertyNode property = propertyAssignment();
                     final String key = property.getKeyName();
-                    final PropertyNode existingProperty = map.get(key);
-
-                    if (existingProperty == null) {
-                        map.put(key, property);
-                       // elements.add(property);
+                    final Integer existing = map.get(key);
+
+                    if (existing == null) {
+                        map.put(key, elements.size());
+                        elements.add(property);
                         break;
                     }
 
+                    final PropertyNode existingProperty = elements.get(existing);
+
                     // ECMA section 11.1.5 Object Initialiser
                     // point # 4 on property assignment production
-                    final Node         value  = property.getValue();
+                    final Expression   value  = property.getValue();
                     final FunctionNode getter = property.getGetter();
                     final FunctionNode setter = property.getSetter();
 
-                    final Node         prevValue  = existingProperty.getValue();
+                    final Expression   prevValue  = existingProperty.getValue();
                     final FunctionNode prevGetter = existingProperty.getGetter();
                     final FunctionNode prevSetter = existingProperty.getSetter();
 
-                    boolean redefinitionOk = true;
                     // ECMA 11.1.5 strict mode restrictions
-                    if (isStrictMode) {
-                        if (value != null && prevValue != null) {
-                            redefinitionOk = false;
-                        }
+                    if (isStrictMode && value != null && prevValue != null) {
+                        throw error(AbstractParser.message("property.redefinition", key), property.getToken());
                     }
 
                     final boolean isPrevAccessor = prevGetter != null || prevSetter != null;
@@ -1987,49 +2005,33 @@
 
                     // data property redefined as accessor property
                     if (prevValue != null && isAccessor) {
-                        redefinitionOk = false;
+                        throw error(AbstractParser.message("property.redefinition", key), property.getToken());
                     }
 
                     // accessor property redefined as data
                     if (isPrevAccessor && value != null) {
-                        redefinitionOk = false;
+                        throw error(AbstractParser.message("property.redefinition", key), property.getToken());
                     }
 
                     if (isAccessor && isPrevAccessor) {
                         if (getter != null && prevGetter != null ||
-                            setter != null && prevSetter != null) {
-                            redefinitionOk = false;
+                                setter != null && prevSetter != null) {
+                            throw error(AbstractParser.message("property.redefinition", key), property.getToken());
                         }
                     }
 
-                    if (!redefinitionOk) {
-                        throw error(AbstractParser.message("property.redefinition", key.toString()), property.getToken());
-                    }
-
-                    PropertyNode newProperty = existingProperty;
                     if (value != null) {
-                        if (prevValue == null) {
-                            map.put(key, newProperty = newProperty.setValue(value));
-                        } else {
-                            final long propertyToken = Token.recast(newProperty.getToken(), COMMARIGHT);
-                            map.put(key, newProperty = newProperty.setValue(new BinaryNode(propertyToken, prevValue, value)));
-                        }
-
-                        map.put(key, newProperty = newProperty.setGetter(null).setSetter(null));
-                    }
-
-                    if (getter != null) {
-                        map.put(key, newProperty = newProperty.setGetter(getter));
-                    }
-
-                    if (setter != null) {
-                        map.put(key, newProperty = newProperty.setSetter(setter));
+                        elements.add(property);
+                    } else if (getter != null) {
+                        elements.set(existing, existingProperty.setGetter(getter));
+                    } else if (setter != null) {
+                        elements.set(existing, existingProperty.setSetter(setter));
                     }
                     break;
             }
         }
 
-        return new ObjectNode(objectToken, finish, new ArrayList<>(map.values()));
+        return new ObjectNode(objectToken, finish, elements);
     }
 
     /**
@@ -2046,7 +2048,7 @@
     private PropertyKey propertyName() {
         switch (type) {
         case IDENT:
-            return getIdent();
+            return getIdent().setIsPropertyName();
         case OCTAL:
             if (isStrictMode) {
                 throw error(AbstractParser.message("strict.no.octal"), token);
@@ -2123,7 +2125,7 @@
                 }
             }
 
-            propertyName =  new IdentNode(propertyToken, finish, ident);
+            propertyName =  new IdentNode(propertyToken, finish, ident).setIsPropertyName();
         } else {
             propertyName = propertyName();
         }
@@ -2149,14 +2151,14 @@
      * Parse left hand side expression.
      * @return Expression node.
      */
-    private Node leftHandSideExpression() {
+    private Expression leftHandSideExpression() {
         int  callLine  = line;
         long callToken = token;
 
-        Node lhs = memberExpression();
+        Expression lhs = memberExpression();
 
         if (type == LPAREN) {
-            final List<Node> arguments = argumentList();
+            final List<Expression> arguments = optimizeList(argumentList());
 
             // Catch special functions.
             if (lhs instanceof IdentNode) {
@@ -2175,7 +2177,7 @@
             switch (type) {
             case LPAREN:
                 // Get NEW or FUNCTION arguments.
-                final List<Node> arguments = argumentList();
+                final List<Expression> arguments = optimizeList(argumentList());
 
                 // Create call node.
                 lhs = new CallNode(callLine, callToken, finish, lhs, arguments);
@@ -2186,7 +2188,7 @@
                 next();
 
                 // Get array index.
-                final Node rhs = expression();
+                final Expression rhs = expression();
 
                 expect(RBRACKET);
 
@@ -2223,19 +2225,19 @@
      * Parse new expression.
      * @return Expression node.
      */
-    private Node newExpression() {
+    private Expression newExpression() {
         final long newToken = token;
         // NEW is tested in caller.
         next();
 
         // Get function base.
         final int  callLine    = line;
-        final Node constructor = memberExpression();
+        final Expression constructor = memberExpression();
         if (constructor == null) {
             return null;
         }
         // Get arguments.
-        List<Node> arguments;
+        ArrayList<Expression> arguments;
 
         // Allow for missing arguments.
         if (type == LPAREN) {
@@ -2253,12 +2255,11 @@
         //
         // The object literal following the "new Constructor()" expresssion
         // is passed as an additional (last) argument to the constructor.
-
         if (!env._no_syntax_extensions && type == LBRACE) {
             arguments.add(objectLiteral());
         }
 
-        final CallNode callNode = new CallNode(callLine, constructor.getToken(), finish, constructor, arguments);
+        final CallNode callNode = new CallNode(callLine, constructor.getToken(), finish, constructor, optimizeList(arguments));
 
         return new UnaryNode(newToken, callNode);
     }
@@ -2276,9 +2277,9 @@
      * Parse member expression.
      * @return Expression node.
      */
-    private Node memberExpression() {
+    private Expression memberExpression() {
         // Prepare to build operation.
-        Node lhs;
+        Expression lhs;
 
         switch (type) {
         case NEW:
@@ -2307,7 +2308,7 @@
                 next();
 
                 // Get array index.
-                final Node index = expression();
+                final Expression index = expression();
 
                 expect(RBRACKET);
 
@@ -2352,9 +2353,9 @@
      * Parse function call arguments.
      * @return Argument list.
      */
-    private List<Node> argumentList() {
+    private ArrayList<Expression> argumentList() {
         // Prepare to accumulate list of arguments.
-        final List<Node> nodeList = new ArrayList<>();
+        final ArrayList<Expression> nodeList = new ArrayList<>();
         // LPAREN tested in caller.
         next();
 
@@ -2374,9 +2375,23 @@
         }
 
         expect(RPAREN);
-
         return nodeList;
-   }
+    }
+
+    private static <T> List<T> optimizeList(ArrayList<T> list) {
+        switch(list.size()) {
+            case 0: {
+                return Collections.emptyList();
+            }
+            case 1: {
+                return Collections.singletonList(list.get(0));
+            }
+            default: {
+                list.trimToSize();
+                return list;
+            }
+        }
+    }
 
     /**
      * FunctionDeclaration :
@@ -2392,7 +2407,7 @@
      *
      * @return Expression node.
      */
-    private Node functionExpression(final boolean isStatement, final boolean topLevel) {
+    private Expression functionExpression(final boolean isStatement, final boolean topLevel) {
         final long functionToken = token;
         final int  functionLine  = line;
         // FUNCTION is tested in caller.
@@ -2568,10 +2583,8 @@
                  */
 
                 // just expression as function body
-                final Node expr = assignmentExpression(true);
+                final Expression expr = assignmentExpression(true);
                 assert lc.getCurrentBlock() == lc.getFunctionBody(functionNode);
-                // create a return statement - this creates code in itself and does not need to be
-                // wrapped into an ExecuteNode
                 final ReturnNode returnNode = new ReturnNode(functionNode.getLineNumber(), expr.getToken(), finish, expr);
                 appendStatement(returnNode);
                 lastToken = token;
@@ -2614,11 +2627,11 @@
         }
     }
 
-    private RuntimeNode referenceError(final Node lhs, final Node rhs, final boolean earlyError) {
+    private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
         if (earlyError) {
             throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
         }
-        final ArrayList<Node> args = new ArrayList<>();
+        final ArrayList<Expression> args = new ArrayList<>();
         args.add(lhs);
         if (rhs == null) {
             args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
@@ -2663,18 +2676,18 @@
      * Parse unary expression.
      * @return Expression node.
      */
-    private Node unaryExpression() {
+    private Expression unaryExpression() {
         final int  unaryLine  = line;
         final long unaryToken = token;
 
         switch (type) {
         case DELETE: {
             next();
-            final Node expr = unaryExpression();
+            final Expression expr = unaryExpression();
             if (expr instanceof BaseNode || expr instanceof IdentNode) {
                 return new UnaryNode(unaryToken, expr);
             }
-            appendStatement(new ExecuteNode(unaryLine, unaryToken, finish, expr));
+            appendStatement(new ExpressionStatement(unaryLine, unaryToken, finish, expr));
             return LiteralNode.newInstance(unaryToken, finish, true);
         }
         case VOID:
@@ -2684,7 +2697,7 @@
         case BIT_NOT:
         case NOT:
             next();
-            final Node expr = unaryExpression();
+            final Expression expr = unaryExpression();
             return new UnaryNode(unaryToken, expr);
 
         case INCPREFIX:
@@ -2692,7 +2705,7 @@
             final TokenType opType = type;
             next();
 
-            final Node lhs = leftHandSideExpression();
+            final Expression lhs = leftHandSideExpression();
             // ++, -- without operand..
             if (lhs == null) {
                 throw error(AbstractParser.message("expected.lvalue", type.getNameOrType()));
@@ -2717,14 +2730,14 @@
             break;
         }
 
-        Node expression = leftHandSideExpression();
+        Expression expression = leftHandSideExpression();
 
         if (last != EOL) {
             switch (type) {
             case INCPREFIX:
             case DECPREFIX:
                 final TokenType opType = type;
-                final Node lhs = expression;
+                final Expression lhs = expression;
                 // ++, -- without operand..
                 if (lhs == null) {
                     throw error(AbstractParser.message("expected.lvalue", type.getNameOrType()));
@@ -2849,16 +2862,16 @@
      * Parse expression.
      * @return Expression node.
      */
-    private Node expression() {
+    private Expression expression() {
         // TODO - Destructuring array.
         // Include commas in expression parsing.
         return expression(unaryExpression(), COMMARIGHT.getPrecedence(), false);
     }
 
-    private Node expression(final Node exprLhs, final int minPrecedence, final boolean noIn) {
+    private Expression expression(final Expression exprLhs, final int minPrecedence, final boolean noIn) {
         // Get the precedence of the next operator.
         int precedence = type.getPrecedence();
-        Node lhs = exprLhs;
+        Expression lhs = exprLhs;
 
         // While greater precedence.
         while (type.isOperator(noIn) && precedence >= minPrecedence) {
@@ -2871,12 +2884,12 @@
 
                 // Pass expression. Middle expression of a conditional expression can be a "in"
                 // expression - even in the contexts where "in" is not permitted.
-                final Node rhs = expression(unaryExpression(), ASSIGN.getPrecedence(), false);
+                final Expression rhs = expression(unaryExpression(), ASSIGN.getPrecedence(), false);
 
                 expect(COLON);
 
                 // Fail expression.
-                final Node third = expression(unaryExpression(), ASSIGN.getPrecedence(), noIn);
+                final Expression third = expression(unaryExpression(), ASSIGN.getPrecedence(), noIn);
 
                 // Build up node.
                 lhs = new TernaryNode(op, lhs, rhs, third);
@@ -2885,7 +2898,7 @@
                 next();
 
                  // Get the next primary expression.
-                Node rhs = unaryExpression();
+                Expression rhs = unaryExpression();
 
                 // Get precedence of next operator.
                 int nextPrecedence = type.getPrecedence();
@@ -2907,7 +2920,7 @@
         return lhs;
     }
 
-    private Node assignmentExpression(final boolean noIn) {
+    private Expression assignmentExpression(final boolean noIn) {
         // TODO - Handle decompose.
         // Exclude commas in expression parsing.
         return expression(unaryExpression(), ASSIGN.getPrecedence(), noIn);
@@ -2951,7 +2964,7 @@
             } else {
                 lc.setFlag(fn, FunctionNode.HAS_NESTED_EVAL);
             }
-            lc.setFlag(lc.getFunctionBody(fn), Block.NEEDS_SCOPE);
+            lc.setBlockNeedsScope(lc.getFunctionBody(fn));
         }
     }
 
--- a/nashorn/src/jdk/nashorn/internal/parser/TokenType.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/parser/TokenType.java	Fri Jul 26 14:07:32 2013 -0700
@@ -93,7 +93,7 @@
     ASSIGN_BIT_OR  (BINARY,  "|=",    2, false),
     OR             (BINARY,  "||",    4, true),
     RBRACE         (BRACKET, "}"),
-    BIT_NOT        (BINARY,  "~",    14, false),
+    BIT_NOT        (UNARY,   "~",     14, false),
 
     // ECMA 7.6.1.1 Keywords, 7.6.1.2 Future Reserved Words.
     // All other Java keywords are commented out.
--- a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Fri Jul 26 14:07:32 2013 -0700
@@ -75,6 +75,8 @@
 
     private static final MethodType[] ACCESSOR_GETTER_TYPES = new MethodType[NOOF_TYPES];
     private static final MethodType[] ACCESSOR_SETTER_TYPES = new MethodType[NOOF_TYPES];
+    private static final MethodType ACCESSOR_GETTER_PRIMITIVE_TYPE;
+    private static final MethodType ACCESSOR_SETTER_PRIMITIVE_TYPE;
     private static final MethodHandle SPILL_ELEMENT_GETTER;
     private static final MethodHandle SPILL_ELEMENT_SETTER;
 
@@ -82,17 +84,43 @@
     private static final MethodHandle[] SPILL_ACCESSORS = new MethodHandle[SPILL_CACHE_SIZE * 2];
 
     static {
+        MethodType getterPrimitiveType = null;
+        MethodType setterPrimitiveType = null;
+
         for (int i = 0; i < NOOF_TYPES; i++) {
             final Type type = ACCESSOR_TYPES.get(i);
             ACCESSOR_GETTER_TYPES[i] = MH.type(type.getTypeClass(), Object.class);
             ACCESSOR_SETTER_TYPES[i] = MH.type(void.class, Object.class, type.getTypeClass());
+
+            if (type == PRIMITIVE_TYPE) {
+                getterPrimitiveType = ACCESSOR_GETTER_TYPES[i];
+                setterPrimitiveType = ACCESSOR_SETTER_TYPES[i];
+            }
         }
 
-        final MethodHandle spillGetter = MH.getter(MethodHandles.lookup(), ScriptObject.class, "spill", Object[].class);
+        ACCESSOR_GETTER_PRIMITIVE_TYPE = getterPrimitiveType;
+        ACCESSOR_SETTER_PRIMITIVE_TYPE = setterPrimitiveType;
+
+        final MethodType spillGetterType = MethodType.methodType(Object[].class, Object.class);
+        final MethodHandle spillGetter = MH.asType(MH.getter(MethodHandles.lookup(), ScriptObject.class, "spill", Object[].class), spillGetterType);
         SPILL_ELEMENT_GETTER = MH.filterArguments(MH.arrayElementGetter(Object[].class), 0, spillGetter);
         SPILL_ELEMENT_SETTER = MH.filterArguments(MH.arrayElementSetter(Object[].class), 0, spillGetter);
     }
 
+    /**
+     * Create a new accessor property. Factory method used by nasgen generated code.
+     *
+     * @param key           {@link Property} key.
+     * @param propertyFlags {@link Property} flags.
+     * @param getter        {@link Property} get accessor method.
+     * @param setter        {@link Property} set accessor method.
+     *
+     * @return  New {@link AccessorProperty} created.
+     */
+    public static AccessorProperty create(final String key, final int propertyFlags, final MethodHandle getter, final MethodHandle setter) {
+        return new AccessorProperty(key, propertyFlags, -1, getter, setter);
+    }
+
     /** Seed getter for the primitive version of this field (in -Dnashorn.fields.dual=true mode) */
     private MethodHandle primitiveGetter;
 
@@ -119,15 +147,15 @@
      * and are thus rebound with that as receiver
      *
      * @param property  accessor property to rebind
-     * @param delegate  delegate script object to rebind receiver to
+     * @param delegate  delegate object to rebind receiver to
      */
-    public AccessorProperty(final AccessorProperty property, final ScriptObject delegate) {
+    public AccessorProperty(final AccessorProperty property, final Object delegate) {
         super(property);
 
         this.primitiveGetter = bindTo(property.primitiveGetter, delegate);
         this.primitiveSetter = bindTo(property.primitiveSetter, delegate);
-        this.objectGetter    = bindTo(property.objectGetter, delegate);
-        this.objectSetter    = bindTo(property.objectSetter, delegate);
+        this.objectGetter    = bindTo(property.ensureObjectGetter(), delegate);
+        this.objectSetter    = bindTo(property.ensureObjectSetter(), delegate);
 
         setCurrentType(property.getCurrentType());
     }
@@ -177,9 +205,8 @@
                     ACCESSOR_GETTER_TYPES[i]);
             }
         } else {
-            //this will work as the object setter and getter will be converted appropriately
-            objectGetter = getter;
-            objectSetter = setter;
+            objectGetter = getter.type() != Lookup.GET_OBJECT_TYPE ? MH.asType(getter, Lookup.GET_OBJECT_TYPE) : getter;
+            objectSetter = setter != null && setter.type() != Lookup.SET_OBJECT_TYPE ? MH.asType(setter, Lookup.SET_OBJECT_TYPE) : setter;
         }
 
         setCurrentType(getterType);
@@ -195,8 +222,8 @@
             setters = new MethodHandle[fieldCount];
             for(int i = 0; i < fieldCount; ++i) {
                 final String fieldName = ObjectClassGenerator.getFieldName(i, Type.OBJECT);
-                getters[i] = MH.getter(lookup, structure, fieldName, Type.OBJECT.getTypeClass());
-                setters[i] = MH.setter(lookup, structure, fieldName, Type.OBJECT.getTypeClass());
+                getters[i] = MH.asType(MH.getter(lookup, structure, fieldName, Type.OBJECT.getTypeClass()), Lookup.GET_OBJECT_TYPE);
+                setters[i] = MH.asType(MH.setter(lookup, structure, fieldName, Type.OBJECT.getTypeClass()), Lookup.SET_OBJECT_TYPE);
             }
         }
     }
@@ -221,20 +248,20 @@
         primitiveSetter = null;
 
         if (isParameter() && hasArguments()) {
-            final MethodHandle arguments   = MH.getter(lookup, structure, "arguments", Object.class);
-            final MethodHandle argumentsSO = MH.asType(arguments, arguments.type().changeReturnType(ScriptObject.class));
+            final MethodHandle arguments   = MH.getter(lookup, structure, "arguments", ScriptObject.class);
 
-            objectGetter = MH.insertArguments(MH.filterArguments(ScriptObject.GET_ARGUMENT.methodHandle(), 0, argumentsSO), 1, slot);
-            objectSetter = MH.insertArguments(MH.filterArguments(ScriptObject.SET_ARGUMENT.methodHandle(), 0, argumentsSO), 1, slot);
+            objectGetter = MH.asType(MH.insertArguments(MH.filterArguments(ScriptObject.GET_ARGUMENT.methodHandle(), 0, arguments), 1, slot), Lookup.GET_OBJECT_TYPE);
+            objectSetter = MH.asType(MH.insertArguments(MH.filterArguments(ScriptObject.SET_ARGUMENT.methodHandle(), 0, arguments), 1, slot), Lookup.SET_OBJECT_TYPE);
         } else {
             final GettersSetters gs = GETTERS_SETTERS.get(structure);
             objectGetter = gs.getters[slot];
             objectSetter = gs.setters[slot];
 
             if (!OBJECT_FIELDS_ONLY) {
-                final String fieldNamePrimitive = ObjectClassGenerator.getFieldName(slot, ObjectClassGenerator.PRIMITIVE_TYPE);
-                primitiveGetter = MH.getter(lookup, structure, fieldNamePrimitive, PRIMITIVE_TYPE.getTypeClass());
-                primitiveSetter = MH.setter(lookup, structure, fieldNamePrimitive, PRIMITIVE_TYPE.getTypeClass());
+                final String fieldNamePrimitive = ObjectClassGenerator.getFieldName(slot, PRIMITIVE_TYPE);
+                final Class<?> typeClass = PRIMITIVE_TYPE.getTypeClass();
+                primitiveGetter = MH.asType(MH.getter(lookup, structure, fieldNamePrimitive, typeClass), ACCESSOR_GETTER_PRIMITIVE_TYPE);
+                primitiveSetter = MH.asType(MH.setter(lookup, structure, fieldNamePrimitive, typeClass), ACCESSOR_SETTER_PRIMITIVE_TYPE);
             }
         }
 
@@ -317,24 +344,30 @@
         }
     }
 
-    @Override
-    public MethodHandle getGetter(final Class<?> type) {
+    // Spill getters and setters are lazily initialized, see JDK-8011630
+    private MethodHandle ensureObjectGetter() {
         if (isSpill() && objectGetter == null) {
             objectGetter = getSpillGetter();
         }
+        return objectGetter;
+    }
+
+    private MethodHandle ensureObjectSetter() {
+        if (isSpill() && objectSetter == null) {
+            objectSetter = getSpillSetter();
+        }
+        return objectSetter;
+    }
+
+    @Override
+    public MethodHandle getGetter(final Class<?> type) {
         final int i = getAccessorTypeIndex(type);
+        ensureObjectGetter();
+
         if (getters[i] == null) {
             getters[i] = debug(
-                MH.asType(
-                    createGetter(
-                        currentType,
-                        type,
-                        primitiveGetter,
-                        objectGetter),
-                    ACCESSOR_GETTER_TYPES[i]),
-                currentType,
-                type,
-                "get");
+                createGetter(currentType, type, primitiveGetter, objectGetter),
+                currentType, type, "get");
         }
 
         return getters[i];
@@ -366,11 +399,8 @@
     }
 
     private MethodHandle generateSetter(final Class<?> forType, final Class<?> type) {
-        if (isSpill() && objectSetter == null) {
-            objectSetter = getSpillSetter();
-        }
+        ensureObjectSetter();
         MethodHandle mh = createSetter(forType, type, primitiveSetter, objectSetter);
-        mh = MH.asType(mh, ACCESSOR_SETTER_TYPES[getAccessorTypeIndex(type)]); //has to be the case for invokeexact to work in ScriptObject
         mh = debug(mh, currentType, type, "set");
         return mh;
     }
@@ -423,9 +453,9 @@
         final int slot = getSlot();
         MethodHandle getter = slot < SPILL_CACHE_SIZE ? SPILL_ACCESSORS[slot * 2] : null;
         if (getter == null) {
-            getter = MH.asType(MH.insertArguments(SPILL_ELEMENT_GETTER, 1, slot), Lookup.GET_OBJECT_TYPE);
+            getter = MH.insertArguments(SPILL_ELEMENT_GETTER, 1, slot);
             if (slot < SPILL_CACHE_SIZE) {
-                SPILL_ACCESSORS[slot * 2] = getter;
+                SPILL_ACCESSORS[slot * 2 + 0] = getter;
             }
         }
         return getter;
@@ -435,7 +465,7 @@
         final int slot = getSlot();
         MethodHandle setter = slot < SPILL_CACHE_SIZE ? SPILL_ACCESSORS[slot * 2 + 1] : null;
         if (setter == null) {
-            setter = MH.asType(MH.insertArguments(SPILL_ELEMENT_SETTER, 1, slot), Lookup.SET_OBJECT_TYPE);
+            setter = MH.insertArguments(SPILL_ELEMENT_SETTER, 1, slot);
             if (slot < SPILL_CACHE_SIZE) {
                 SPILL_ACCESSORS[slot * 2 + 1] = setter;
             }
--- a/nashorn/src/jdk/nashorn/internal/runtime/CodeInstaller.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/CodeInstaller.java	Fri Jul 26 14:07:32 2013 -0700
@@ -62,4 +62,10 @@
      * @param code bytecode to verify
      */
     public void verify(final byte[] code);
+
+    /**
+     * Get next unique script id
+     * @return unique script id
+     */
+    public long getUniqueScriptId();
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Jul 26 14:07:32 2013 -0700
@@ -36,16 +36,13 @@
 import java.io.PrintWriter;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
-import java.lang.reflect.Constructor;
+import java.util.concurrent.atomic.AtomicLong;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.CodeSigner;
 import java.security.CodeSource;
-import java.security.Permissions;
 import java.security.PrivilegedAction;
-import java.security.ProtectionDomain;
 import java.util.Map;
 import jdk.internal.org.objectweb.asm.ClassReader;
 import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
@@ -55,6 +52,7 @@
 import jdk.nashorn.internal.ir.FunctionNode;
 import jdk.nashorn.internal.ir.debug.ASTWriter;
 import jdk.nashorn.internal.ir.debug.PrintVisitor;
+import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.parser.Parser;
 import jdk.nashorn.internal.runtime.options.Options;
 
@@ -96,6 +94,11 @@
         public void verify(final byte[] code) {
             context.verify(code);
         }
+
+        @Override
+        public long getUniqueScriptId() {
+            return context.getUniqueScriptId();
+        }
     }
 
     /** Is Context global debug mode enabled ? */
@@ -123,8 +126,8 @@
             sm.checkPermission(new RuntimePermission("nashorn.setGlobal"));
         }
 
-        if (global != null && !(global instanceof GlobalObject)) {
-            throw new IllegalArgumentException("global does not implement GlobalObject!");
+        if (global != null && !(global instanceof Global)) {
+            throw new IllegalArgumentException("global is not an instance of Global!");
         }
 
         setGlobalTrusted(global);
@@ -197,6 +200,9 @@
     /** Current error manager. */
     private final ErrorManager errors;
 
+    /** Unique id for script. Used only when --loader-per-compile=false */
+    private final AtomicLong uniqueScriptId;
+
     private static final ClassLoader myLoader = Context.class.getClassLoader();
     private static final StructureLoader sharedLoader;
 
@@ -253,14 +259,13 @@
         this.env       = new ScriptEnvironment(options, out, err);
         this._strict   = env._strict;
         this.appLoader = appLoader;
-        this.scriptLoader = (ScriptLoader)AccessController.doPrivileged(
-             new PrivilegedAction<ClassLoader>() {
-                @Override
-                public ClassLoader run() {
-                    final StructureLoader structureLoader = new StructureLoader(sharedLoader, Context.this);
-                    return new ScriptLoader(structureLoader, Context.this);
-                }
-             });
+        if (env._loader_per_compile) {
+            this.scriptLoader = null;
+            this.uniqueScriptId = null;
+        } else {
+            this.scriptLoader = createNewLoader();
+            this.uniqueScriptId = new AtomicLong();
+        }
         this.errors    = errors;
 
         // if user passed -classpath option, make a class loader with that and set it as
@@ -521,11 +526,13 @@
         });
         setGlobalTrusted(newGlobal);
 
-        final Object[] wrapped = args == null? ScriptRuntime.EMPTY_ARRAY :  ScriptObjectMirror.wrapArray(args, newGlobal);
+        final Object[] wrapped = args == null? ScriptRuntime.EMPTY_ARRAY :  ScriptObjectMirror.wrapArray(args, oldGlobal);
         newGlobal.put("arguments", ((GlobalObject)newGlobal).wrapAsObject(wrapped));
 
         try {
-            return ScriptObjectMirror.wrap(load(newGlobal, from), newGlobal);
+            // wrap objects from newGlobal's world as mirrors - but if result
+            // is from oldGlobal's world, unwrap it!
+            return ScriptObjectMirror.unwrap(ScriptObjectMirror.wrap(load(newGlobal, from), newGlobal), oldGlobal);
         } finally {
             setGlobalTrusted(oldGlobal);
         }
@@ -550,6 +557,21 @@
     }
 
     /**
+     * Checks that the given package can be accessed from current call stack.
+     *
+     * @param fullName fully qualified package name
+     */
+    public static void checkPackageAccess(final String fullName) {
+        final int index = fullName.lastIndexOf('.');
+        if (index != -1) {
+            final SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                sm.checkPackageAccess(fullName.substring(0, index));
+            }
+        }
+    }
+
+    /**
      * Lookup a Java class. This is used for JSR-223 stuff linking in from
      * {@code jdk.nashorn.internal.objects.NativeJava} and {@code jdk.nashorn.internal.runtime.NativeJavaPackage}
      *
@@ -561,19 +583,7 @@
      */
     public Class<?> findClass(final String fullName) throws ClassNotFoundException {
         // check package access as soon as possible!
-        final int index = fullName.lastIndexOf('.');
-        if (index != -1) {
-            final SecurityManager sm = System.getSecurityManager();
-            if (sm != null) {
-                AccessController.doPrivileged(new PrivilegedAction<Void>() {
-                    @Override
-                    public Void run() {
-                        sm.checkPackageAccess(fullName.substring(0, index));
-                        return null;
-                    }
-                }, createNoPermissionsContext());
-            }
-        }
+        checkPackageAccess(fullName);
 
         // try the script -classpath loader, if that is set
         if (classPathLoader != null) {
@@ -714,10 +724,6 @@
         return (context != null) ? context : Context.getContextTrusted();
     }
 
-    private static AccessControlContext createNoPermissionsContext() {
-        return new AccessControlContext(new ProtectionDomain[] { new ProtectionDomain(null, new Permissions()) });
-    }
-
     private Object evaluateSource(final Source source, final ScriptObject scope, final ScriptObject thiz) {
         ScriptFunction script = null;
 
@@ -817,25 +823,16 @@
              new PrivilegedAction<ScriptLoader>() {
                 @Override
                 public ScriptLoader run() {
-                    // Generated code won't refer to any class generated by context
-                    // script loader and so parent loader can be the structure
-                    // loader -- which is parent of the context script loader.
-                    return new ScriptLoader((StructureLoader)scriptLoader.getParent(), Context.this);
+                    return new ScriptLoader(sharedLoader, Context.this);
                 }
              });
     }
 
     private ScriptObject newGlobalTrusted() {
-        try {
-            final Class<?> clazz = Class.forName("jdk.nashorn.internal.objects.Global", true, scriptLoader);
-            final Constructor<?> cstr = clazz.getConstructor(Context.class);
-            return (ScriptObject) cstr.newInstance(this);
-        } catch (final Exception e) {
-            printStackTrace(e);
-            if (e instanceof RuntimeException) {
-                throw (RuntimeException)e;
-            }
-            throw new RuntimeException(e);
-        }
+        return new Global(this);
+    }
+
+    private long getUniqueScriptId() {
+        return uniqueScriptId.getAndIncrement();
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java	Fri Jul 26 14:07:32 2013 -0700
@@ -41,7 +41,7 @@
 public class FunctionScope extends ScriptObject implements Scope {
 
     /** Area to store scope arguments. (public for access from scripts.) */
-    public final Object arguments;
+    public final ScriptObject arguments;
 
     /** Flag to indicate that a split method issued a return statement */
     private int splitState = -1;
@@ -53,7 +53,7 @@
      * @param callerScope caller scope
      * @param arguments   arguments
      */
-    public FunctionScope(final PropertyMap map, final ScriptObject callerScope, final Object arguments) {
+    public FunctionScope(final PropertyMap map, final ScriptObject callerScope, final ScriptObject arguments) {
         super(callerScope, map);
         this.arguments = arguments;
         setIsScope();
--- a/nashorn/src/jdk/nashorn/internal/runtime/GlobalFunctions.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/GlobalFunctions.java	Fri Jul 26 14:07:32 2013 -0700
@@ -34,9 +34,6 @@
 
 /**
  * Utilities used by Global class.
- *
- * These are actual implementation methods for functions exposed by global
- * scope. The code lives here to share the code across the contexts.
  */
 public final class GlobalFunctions {
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/GlobalObject.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/GlobalObject.java	Fri Jul 26 14:07:32 2013 -0700
@@ -30,14 +30,7 @@
 import jdk.internal.dynalink.linker.LinkRequest;
 
 /**
- * Runtime interface to the global scope of the current context.
- * NOTE: never access {@code jdk.nashorn.internal.objects.Global} class directly
- * from runtime/parser/codegen/ir etc. Always go through this interface.
- * <p>
- * The reason for this is that all objects in the @{code jdk.nashorn.internal.objects.*} package
- * are different per Context and loaded separately by each Context class loader. Attempting
- * to directly refer to an object in this package from the rest of the runtime
- * will lead to {@code ClassNotFoundException} thrown upon link time
+ * Runtime interface to the global scope objects.
  */
 
 public interface GlobalObject {
--- a/nashorn/src/jdk/nashorn/internal/runtime/JSType.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/JSType.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,7 +29,9 @@
 import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
 
 import java.util.Locale;
+import jdk.internal.dynalink.beans.BeansLinker;
 import jdk.internal.dynalink.beans.StaticClass;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import jdk.nashorn.internal.codegen.CompilerConstants.Call;
 import jdk.nashorn.internal.parser.Lexer;
 
@@ -151,6 +153,14 @@
             return JSType.FUNCTION;
         }
 
+        if (BeansLinker.isDynamicMethod(obj)) {
+            return JSType.FUNCTION;
+        }
+
+        if (obj instanceof ScriptObjectMirror) {
+            return ((ScriptObjectMirror)obj).isFunction()? JSType.FUNCTION : JSType.OBJECT;
+        }
+
         return JSType.OBJECT;
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -1,3 +1,28 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
 package jdk.nashorn.internal.runtime;
 
 import java.util.AbstractList;
--- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyListenerManager.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyListenerManager.java	Fri Jul 26 14:07:32 2013 -0700
@@ -41,6 +41,7 @@
     private static int listenersRemoved;
 
     /**
+     * Return aggregate listeners added to all PropertyListenerManagers
      * @return the listenersAdded
      */
     public static int getListenersAdded() {
@@ -48,12 +49,21 @@
     }
 
     /**
+     * Return aggregate listeners removed from all PropertyListenerManagers
      * @return the listenersRemoved
      */
     public static int getListenersRemoved() {
         return listenersRemoved;
     }
 
+    /**
+     * Return listeners added to this PropertyListenerManager.
+     * @return the listener count
+     */
+    public final int getListenerCount() {
+        return listeners != null? listeners.size() : 0;
+    }
+
     // Property listener management methods
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,11 +25,8 @@
 
 package jdk.nashorn.internal.runtime;
 
-import jdk.nashorn.internal.scripts.JO;
-
 import static jdk.nashorn.internal.runtime.PropertyHashMap.EMPTY_HASHMAP;
 
-import java.lang.invoke.MethodHandle;
 import java.lang.invoke.SwitchPoint;
 import java.lang.ref.WeakReference;
 import java.util.Arrays;
@@ -57,9 +54,8 @@
     private static final int CLONEABLE_FLAGS_MASK = 0b0000_1111;
     /** Has a listener been added to this property map. This flag is not copied when cloning a map. See {@link PropertyListener} */
     public static final int IS_LISTENER_ADDED     = 0b0001_0000;
-
-    /** Empty map used for seed map for JO$ objects */
-    private static final PropertyMap EMPTY_MAP = new PropertyMap(EMPTY_HASHMAP);
+    /** Is this process wide "shared" map?. This flag is not copied when cloning a map */
+    public static final int IS_SHARED             = 0b0010_0000;
 
     /** Map status flags. */
     private int flags;
@@ -91,14 +87,16 @@
     /**
      * Constructor.
      *
-     * @param properties    A {@link PropertyHashMap} with initial contents.
-     * @param fieldCount    Number of fields in use.
+     * @param properties   A {@link PropertyHashMap} with initial contents.
+     * @param fieldCount   Number of fields in use.
      * @param fieldMaximum Number of fields available.
+     * @param spillLength  Number of spill slots used.
      */
-    private PropertyMap(final PropertyHashMap properties, final int fieldCount, final int fieldMaximum) {
+    private PropertyMap(final PropertyHashMap properties, final int fieldCount, final int fieldMaximum, final int spillLength) {
         this.properties   = properties;
         this.fieldCount   = fieldCount;
         this.fieldMaximum = fieldMaximum;
+        this.spillLength  = spillLength;
 
         if (Context.DEBUG) {
             count++;
@@ -111,7 +109,7 @@
      * @param properties A {@link PropertyHashMap} with initial contents.
      */
     private PropertyMap(final PropertyHashMap properties) {
-        this(properties, 0, 0);
+        this(properties, 0, 0, 0);
     }
 
     /**
@@ -143,58 +141,49 @@
     }
 
     /**
-     * Duplicates this PropertyMap instance. This is used by nasgen generated
-     * prototype and constructor classes. {@link PropertyMap} used for singletons
-     * like these (and global instance) are duplicated using this method and used.
-     * The original filled map referenced by static fields of prototype and
-     * constructor classes are not touched. This allows multiple independent global
-     * instances to be used within a single context instance.
+     * Duplicates this PropertyMap instance. This is used to duplicate 'shared'
+     * maps {@link PropertyMap} used as process wide singletons. Shared maps are
+     * duplicated for every global scope object. That way listeners, proto and property
+     * histories are scoped within a global scope.
      *
      * @return Duplicated {@link PropertyMap}.
      */
     public PropertyMap duplicate() {
+        if (Context.DEBUG) {
+            duplicatedCount++;
+        }
         return new PropertyMap(this.properties);
     }
 
     /**
      * Public property map allocator.
      *
-     * @param structure  Class the map's {@link AccessorProperty}s apply to.
-     * @param properties Collection of initial properties.
-     * @param fieldCount    Number of fields in use.
+     * @param properties   Collection of initial properties.
+     * @param fieldCount   Number of fields in use.
      * @param fieldMaximum Number of fields available.
-     *
+     * @param spillLength  Number of used spill slots.
      * @return New {@link PropertyMap}.
      */
-    public static PropertyMap newMap(final Class<?> structure, final Collection<Property> properties, final int fieldCount, final int fieldMaximum) {
-        // Reduce the number of empty maps in the context.
-        if (structure == JO.class) {
-            return EMPTY_MAP;
-        }
-
+    public static PropertyMap newMap(final Collection<Property> properties, final int fieldCount, final int fieldMaximum,  final int spillLength) {
         PropertyHashMap newProperties = EMPTY_HASHMAP.immutableAdd(properties);
-
-        return new PropertyMap(newProperties, fieldCount, fieldMaximum);
+        return new PropertyMap(newProperties, fieldCount, fieldMaximum, spillLength);
     }
 
     /**
-     * Public property map factory allocator
-     *
-     * @param structure  Class the map's {@link AccessorProperty}s apply to.
-     *
+     * Public property map allocator. Used by nasgen generated code.
+     * @param properties Collection of initial properties.
      * @return New {@link PropertyMap}.
      */
-    public static PropertyMap newMap(final Class<?> structure) {
-        return newMap(structure, null, 0, 0);
+    public static PropertyMap newMap(final Collection<Property> properties) {
+        return (properties == null || properties.isEmpty())? newMap() : newMap(properties, 0, 0, 0);
     }
 
     /**
      * Return a sharable empty map.
      *
-     * @param  context the context
      * @return New empty {@link PropertyMap}.
      */
-    public static PropertyMap newEmptyMap(final Context context) {
+    public static PropertyMap newMap() {
         return new PropertyMap(EMPTY_HASHMAP);
     }
 
@@ -216,6 +205,8 @@
      * @return A shared {@link SwitchPoint} for the property.
      */
     public SwitchPoint getProtoGetSwitchPoint(final ScriptObject proto, final String key) {
+        assert !isShared() : "proto SwitchPoint from a shared PropertyMap";
+
         if (proto == null) {
             return null;
         }
@@ -244,6 +235,8 @@
      * @param property {@link Property} to invalidate.
      */
     private void invalidateProtoGetSwitchPoint(final Property property) {
+        assert !isShared() : "proto invalidation on a shared PropertyMap";
+
         if (protoGetSwitches != null) {
             final String key = property.getKey();
             final SwitchPoint sp = protoGetSwitches.get(key);
@@ -258,17 +251,6 @@
     }
 
     /**
-     * Add a property to the map.
-     *
-     * @param property {@link Property} being added.
-     *
-     * @return New {@link PropertyMap} with {@link Property} added.
-     */
-    public PropertyMap newProperty(final Property property) {
-        return addProperty(property);
-    }
-
-    /**
      * Add a property to the map, re-binding its getters and setters,
      * if available, to a given receiver. This is typically the global scope. See
      * {@link ScriptObject#addBoundProperties(ScriptObject)}
@@ -278,23 +260,8 @@
      *
      * @return New {@link PropertyMap} with {@link Property} added.
      */
-    PropertyMap newPropertyBind(final AccessorProperty property, final ScriptObject bindTo) {
-        return newProperty(new AccessorProperty(property, bindTo));
-    }
-
-    /**
-     * Add a new accessor property to the map.
-     *
-     * @param key           {@link Property} key.
-     * @param propertyFlags {@link Property} flags.
-     * @param slot          {@link Property} slot.
-     * @param getter        {@link Property} get accessor method.
-     * @param setter        {@link Property} set accessor method.
-     *
-     * @return  New {@link PropertyMap} with {@link AccessorProperty} added.
-     */
-    public PropertyMap newProperty(final String key, final int propertyFlags, final int slot, final MethodHandle getter, final MethodHandle setter) {
-        return newProperty(new AccessorProperty(key, propertyFlags, slot, getter, setter));
+    PropertyMap addPropertyBind(final AccessorProperty property, final Object bindTo) {
+        return addProperty(new AccessorProperty(property, bindTo));
     }
 
     /**
@@ -496,6 +463,28 @@
     }
 
     /**
+     * Make this property map 'shared' one. Shared property map instances are
+     * process wide singleton objects. A shaped map should never be added as a listener
+     * to a proto object. Nor it should have history or proto history. A shared map
+     * is just a template that is meant to be duplicated before use. All nasgen initialized
+     * property maps are shared.
+     *
+     * @return this map after making it as shared
+     */
+    public PropertyMap setIsShared() {
+        assert !isListenerAdded() : "making PropertyMap shared after listener added";
+        assert protoHistory == null : "making PropertyMap shared after associating a proto with it";
+        if (Context.DEBUG) {
+            sharedCount++;
+        }
+
+        flags |= IS_SHARED;
+        // clear any history on this PropertyMap, won't be used.
+        history = null;
+        return this;
+    }
+
+    /**
      * Check for any configurable properties.
      *
      * @return {@code true} if any configurable.
@@ -561,6 +550,8 @@
      * @param newMap   {@link PropertyMap} associated with prototype.
      */
     private void addToProtoHistory(final ScriptObject newProto, final PropertyMap newMap) {
+        assert !isShared() : "proto history modified on a shared PropertyMap";
+
         if (protoHistory == null) {
             protoHistory = new WeakHashMap<>();
         }
@@ -575,6 +566,8 @@
      * @param newMap   Modified {@link PropertyMap}.
      */
     private void addToHistory(final Property property, final PropertyMap newMap) {
+        assert !isShared() : "history modified on a shared PropertyMap";
+
         if (!properties.isEmpty()) {
             if (history == null) {
                 history = new LinkedHashMap<>();
@@ -700,6 +693,15 @@
     }
 
     /**
+     * Check if this map shared or not.
+     *
+     * @return true if this map is shared.
+     */
+    public boolean isShared() {
+        return (flags & IS_SHARED) != 0;
+    }
+
+    /**
      * Test to see if {@link PropertyMap} is extensible.
      *
      * @return {@code true} if {@link PropertyMap} can be added to.
@@ -762,6 +764,8 @@
      * @return New {@link PropertyMap} with prototype changed.
      */
     PropertyMap changeProto(final ScriptObject oldProto, final ScriptObject newProto) {
+        assert !isShared() : "proto associated with a shared PropertyMap";
+
         if (oldProto == newProto) {
             return this;
         }
@@ -877,6 +881,8 @@
     // counters updated only in debug mode
     private static int count;
     private static int clonedCount;
+    private static int sharedCount;
+    private static int duplicatedCount;
     private static int historyHit;
     private static int protoInvalidations;
     private static int protoHistoryHit;
@@ -897,6 +903,20 @@
     }
 
     /**
+     * @return The number of maps that are shared.
+     */
+    public static int getSharedCount() {
+        return sharedCount;
+    }
+
+    /**
+     * @return The number of maps that are duplicated.
+     */
+    public static int getDuplicatedCount() {
+        return duplicatedCount;
+    }
+
+    /**
      * @return The number of times history was successfully used.
      */
     public static int getHistoryHit() {
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java	Fri Jul 26 14:07:32 2013 -0700
@@ -119,9 +119,15 @@
     /** Create a new class loaded for each compilation */
     public final boolean _loader_per_compile;
 
+    /** Do not support Java support extensions. */
+    public final boolean _no_java;
+
     /** Do not support non-standard syntax extensions. */
     public final boolean _no_syntax_extensions;
 
+    /** Do not support typed arrays. */
+    public final boolean _no_typed_arrays;
+
     /** Package to which generated class files are added */
     public final String  _package;
 
@@ -207,7 +213,9 @@
         _fx                   = options.getBoolean("fx");
         _lazy_compilation     = options.getBoolean("lazy.compilation");
         _loader_per_compile   = options.getBoolean("loader.per.compile");
+        _no_java              = options.getBoolean("no.java");
         _no_syntax_extensions = options.getBoolean("no.syntax.extensions");
+        _no_typed_arrays      = options.getBoolean("no.typed.arrays");
         _package              = options.getString("package");
         _parse_only           = options.getBoolean("parse.only");
         _print_ast            = options.getBoolean("print.ast");
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java	Fri Jul 26 14:07:32 2013 -0700
@@ -71,6 +71,8 @@
 
     private static final MethodHandle IS_NONSTRICT_FUNCTION = findOwnMH("isNonStrictFunction", boolean.class, Object.class, Object.class, ScriptFunctionData.class);
 
+    private static final MethodHandle ADD_ZEROTH_ELEMENT = findOwnMH("addZerothElement", Object[].class, Object[].class, Object.class);
+
     /** The parent scope. */
     private final ScriptObject scope;
 
@@ -546,7 +548,21 @@
     }
 
     private static MethodHandle bindToNameIfNeeded(final MethodHandle methodHandle, final String bindName) {
-        return bindName == null ? methodHandle : MH.insertArguments(methodHandle, 1, bindName);
+        if (bindName == null) {
+            return methodHandle;
+        } else {
+            // if it is vararg method, we need to extend argument array with
+            // a new zeroth element that is set to bindName value.
+            final MethodType methodType = methodHandle.type();
+            final int parameterCount = methodType.parameterCount();
+            final boolean isVarArg = parameterCount > 0 && methodType.parameterType(parameterCount - 1).isArray();
+
+            if (isVarArg) {
+                return MH.filterArguments(methodHandle, 1, MH.insertArguments(ADD_ZEROTH_ELEMENT, 1, bindName));
+            } else {
+                return MH.insertArguments(methodHandle, 1, bindName);
+            }
+        }
     }
 
     /**
@@ -586,6 +602,16 @@
         return self instanceof ScriptFunction && ((ScriptFunction)self).data == data && arg instanceof ScriptObject;
     }
 
+    @SuppressWarnings("unused")
+    private static Object[] addZerothElement(final Object[] args, final Object value) {
+        // extends input array with by adding new zeroth element
+        final Object[] src = (args == null)? ScriptRuntime.EMPTY_ARRAY : args;
+        final Object[] result = new Object[src.length + 1];
+        System.arraycopy(src, 0, result, 1, src.length);
+        result[0] = value;
+        return result;
+    }
+
     private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
         final Class<?>   own = ScriptFunction.class;
         final MethodType mt  = MH.type(rtype, types);
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Jul 26 14:07:32 2013 -0700
@@ -170,7 +170,7 @@
         }
 
         this.arrayData = ArrayData.EMPTY_ARRAY;
-        this.setMap(map == null ? PropertyMap.newMap(getClass()) : map);
+        this.setMap(map == null ? PropertyMap.newMap() : map);
     }
 
     /**
@@ -188,7 +188,7 @@
         }
 
         this.arrayData = ArrayData.EMPTY_ARRAY;
-        this.setMap(map == null ? PropertyMap.newMap(getClass()) : map);
+        this.setMap(map == null ? PropertyMap.newMap() : map);
         this.proto = proto;
 
         if (proto != null) {
@@ -203,9 +203,19 @@
      * @param source The source object to copy from.
      */
     public void addBoundProperties(final ScriptObject source) {
+        addBoundProperties(source, source.getMap().getProperties());
+    }
+
+    /**
+     * Copy all properties from the array with their receiver bound to the source.
+     *
+     * @param source The source object to copy from.
+     * @param properties The array of properties to copy.
+     */
+    public void addBoundProperties(final ScriptObject source, final Property[] properties) {
         PropertyMap newMap = this.getMap();
 
-        for (final Property property : source.getMap().getProperties()) {
+        for (final Property property : properties) {
             final String key = property.getKey();
 
             if (newMap.findProperty(key) == null) {
@@ -213,7 +223,7 @@
                     final UserAccessorProperty prop = this.newUserAccessors(key, property.getFlags(), property.getGetterFunction(source), property.getSetterFunction(source));
                     newMap = newMap.addProperty(prop);
                 } else {
-                    newMap = newMap.newPropertyBind((AccessorProperty)property, source);
+                    newMap = newMap.addPropertyBind((AccessorProperty)property, source);
                 }
             }
         }
@@ -222,6 +232,26 @@
     }
 
     /**
+     * Copy all properties from the array with their receiver bound to the source.
+     *
+     * @param source The source object to copy from.
+     * @param properties The collection of accessor properties to copy.
+     */
+    public void addBoundProperties(final Object source, final AccessorProperty[] properties) {
+        PropertyMap newMap = this.getMap();
+
+        for (final AccessorProperty property : properties) {
+            final String key = property.getKey();
+
+            if (newMap.findProperty(key) == null) {
+                newMap = newMap.addPropertyBind(property, source);
+            }
+        }
+
+        this.setMap(newMap);
+    }
+
+    /**
      * Bind the method handle to the specified receiver, while preserving its original type (it will just ignore the
      * first argument in lieu of the bound argument).
      * @param methodHandle Method handle to bind to.
@@ -1027,6 +1057,15 @@
     }
 
     /**
+     * Set the current context.
+     * @param ctx context instance to set
+     */
+    protected final void setContext(final Context ctx) {
+        ctx.getClass();
+        this.context = ctx;
+    }
+
+    /**
      * Return the map of an object.
      * @return PropertyMap object.
      */
@@ -1939,7 +1978,12 @@
             return noSuchProperty(desc, request);
         }
 
-        final ScriptFunction func = (ScriptFunction)getObjectValue(find);
+        final Object value = getObjectValue(find);
+        if (! (value instanceof ScriptFunction)) {
+            return createEmptyGetter(desc, name);
+        }
+
+        final ScriptFunction func = (ScriptFunction)value;
         final Object thiz = scopeCall && func.isStrict() ? ScriptRuntime.UNDEFINED : this;
         // TODO: It'd be awesome if we could bind "name" without binding "this".
         return new GuardedInvocation(MH.dropArguments(MH.constant(ScriptFunction.class,
@@ -1959,8 +2003,13 @@
         final boolean scopeAccess = isScope() && NashornCallSiteDescriptor.isScope(desc);
 
         if (find != null) {
-            final ScriptFunction func = (ScriptFunction)getObjectValue(find);
-            MethodHandle methodHandle = getCallMethodHandle(func, desc.getMethodType(), name);
+            final Object value = getObjectValue(find);
+            ScriptFunction func = null;
+            MethodHandle methodHandle = null;
+            if (value instanceof ScriptFunction) {
+                func = (ScriptFunction)value;
+                methodHandle = getCallMethodHandle(func, desc.getMethodType(), name);
+            }
 
             if (methodHandle != null) {
                 if (scopeAccess && func.isStrict()) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java	Fri Jul 26 14:07:32 2013 -0700
@@ -592,6 +592,8 @@
                 throw typeError("cant.get.property", safeToString(property), "null");
             } else if (JSType.isPrimitive(obj)) {
                 obj = ((ScriptObject)JSType.toScriptObject(obj)).get(property);
+            } else if (obj instanceof ScriptObjectMirror) {
+                obj = ((ScriptObjectMirror)obj).getMember(property.toString());
             } else {
                 obj = UNDEFINED;
             }
@@ -601,23 +603,6 @@
     }
 
     /**
-     * ECMA 11.4.2 - void operator
-     *
-     * @param object object to evaluate
-     *
-     * @return Undefined as the object type
-     */
-    public static Object VOID(final Object object) {
-        if (object instanceof Number) {
-            if (Double.isNaN(((Number)object).doubleValue())) {
-                return Double.NaN;
-            }
-        }
-
-        return UNDEFINED;
-    }
-
-    /**
      * Throw ReferenceError when LHS of assignment or increment/decrement
      * operator is not an assignable node (say a literal)
      *
--- a/nashorn/src/jdk/nashorn/internal/runtime/StructureLoader.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/StructureLoader.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,30 +25,19 @@
 
 package jdk.nashorn.internal.runtime;
 
-import static jdk.nashorn.internal.codegen.Compiler.OBJECTS_PACKAGE;
 import static jdk.nashorn.internal.codegen.Compiler.SCRIPTS_PACKAGE;
 import static jdk.nashorn.internal.codegen.Compiler.binaryName;
 import static jdk.nashorn.internal.codegen.CompilerConstants.JS_OBJECT_PREFIX;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.CodeSigner;
-import java.security.CodeSource;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import java.security.ProtectionDomain;
 import jdk.nashorn.internal.codegen.ObjectClassGenerator;
 
 /**
- * Responsible for on the fly construction of structure classes as well
- * as loading jdk.nashorn.internal.objects.* classes.
+ * Responsible for on the fly construction of structure classes.
  *
  */
 final class StructureLoader extends NashornLoader {
     private static final String JS_OBJECT_PREFIX_EXTERNAL = binaryName(SCRIPTS_PACKAGE) + '.' + JS_OBJECT_PREFIX.symbolName();
-    private static final String OBJECTS_PACKAGE_EXTERNAL  = binaryName(OBJECTS_PACKAGE);
 
     /**
      * Constructor.
@@ -68,45 +57,9 @@
             return loadedClass;
         }
 
-        if (name.startsWith(binaryName(OBJECTS_PACKAGE_EXTERNAL))) {
-            try {
-                return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
-                    @Override
-                    public Class<?> run() throws ClassNotFoundException {
-                        final String      source  = name.replace('.','/') + ".clazz";
-                        final URL         url     = getResource(source);
-                        try (final InputStream is = getResourceAsStream(source)) {
-                            if (is == null) {
-                                throw new ClassNotFoundException(name);
-                            }
-
-                            byte[] code;
-                            try {
-                                code = Source.readBytes(is);
-                            } catch (final IOException e) {
-                                Context.printStackTrace(e);
-                                throw new ClassNotFoundException(name, e);
-                            }
-
-                            final Class<?> cl = defineClass(name, code, 0, code.length, new CodeSource(url, (CodeSigner[])null));
-                            if (resolve) {
-                                resolveClass(cl);
-                            }
-                            return cl;
-                        } catch (final IOException e) {
-                            throw new RuntimeException(e);
-                        }
-                    }
-                });
-            } catch (final PrivilegedActionException  e) {
-                throw new ClassNotFoundException(name, e);
-            }
-        }
-
         return super.loadClassTrusted(name, resolve);
     }
 
-
     @Override
     protected Class<?> findClass(final String name) throws ClassNotFoundException {
         if (name.startsWith(JS_OBJECT_PREFIX_EXTERNAL)) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Fri Jul 26 14:07:32 2013 -0700
@@ -75,8 +75,13 @@
      * @return ArrayData
      */
     public static ArrayData allocate(final int length) {
-        final ArrayData arrayData = new IntArrayData(length);
-        return length == 0 ? arrayData : new DeletedRangeArrayFilter(arrayData, 0, length - 1);
+        if (length == 0) {
+            return new IntArrayData();
+        } else if (length >= SparseArrayData.MAX_DENSE_LENGTH) {
+            return new SparseArrayData(EMPTY_ARRAY, length);
+        } else {
+            return new DeletedRangeArrayFilter(new IntArrayData(length), 0, length - 1);
+        }
     }
 
     /**
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Fri Jul 26 14:07:32 2013 -0700
@@ -75,7 +75,9 @@
     }
 
     private static Object[] toObjectArray(final int[] array, final int length) {
-        final Object[] oarray = new Object[length];
+        assert length <= array.length : "length exceeds internal array size";
+        final Object[] oarray = new Object[array.length];
+
         for (int index = 0; index < length; index++) {
             oarray[index] = Integer.valueOf(array[index]);
         }
@@ -83,18 +85,22 @@
         return oarray;
     }
 
-    private static double[] toDoubleArray(final int[] array) {
+    private static double[] toDoubleArray(final int[] array, final int length) {
+        assert length <= array.length : "length exceeds internal array size";
         final double[] darray = new double[array.length];
-        for (int index = 0; index < array.length; index++) {
+
+        for (int index = 0; index < length; index++) {
             darray[index] = array[index];
         }
 
         return darray;
     }
 
-    private static long[] toLongArray(final int[] array) {
+    private static long[] toLongArray(final int[] array, final int length) {
+        assert length <= array.length : "length exceeds internal array size";
         final long[] larray = new long[array.length];
-        for (int index = 0; index < array.length; index++) {
+
+        for (int index = 0; index < length; index++) {
             larray[index] = array[index];
         }
 
@@ -105,12 +111,14 @@
     public ArrayData convert(final Class<?> type) {
         if (type == Integer.class) {
             return this;
-        } else if (type == Long.class) {
-            return new LongArrayData(IntArrayData.toLongArray(array), (int) length());
+        }
+        final int length = (int) length();
+        if (type == Long.class) {
+            return new LongArrayData(IntArrayData.toLongArray(array, length), length);
         } else if (type == Double.class) {
-            return new NumberArrayData(IntArrayData.toDoubleArray(array), (int) length());
+            return new NumberArrayData(IntArrayData.toDoubleArray(array, length), length);
         } else {
-            return new ObjectArrayData(IntArrayData.toObjectArray(array, array.length), (int) length());
+            return new ObjectArrayData(IntArrayData.toObjectArray(array, length), length);
         }
     }
 
@@ -161,26 +169,13 @@
 
     @Override
     public ArrayData set(final int index, final Object value, final boolean strict) {
-        try {
-            final int intValue = ((Integer)value).intValue();
-            array[index] = intValue;
-            setLength(Math.max(index + 1, length()));
-            return this;
-        } catch (final NullPointerException | ClassCastException e) {
-            if (value instanceof Short || value instanceof Byte) {
-                final int intValue = ((Number)value).intValue();
-                array[index] = intValue;
-                setLength(Math.max(index + 1, length()));
-                return this;
-            }
-
-            if (value == ScriptRuntime.UNDEFINED) {
-                return new UndefinedArrayFilter(this).set(index, value, strict);
-            }
+        if (value instanceof Integer) {
+            return set(index, ((Number)value).intValue(), strict);
+        } else if (value == ScriptRuntime.UNDEFINED) {
+            return new UndefinedArrayFilter(this).set(index, value, strict);
         }
 
         final ArrayData newData = convert(value == null ? Object.class : value.getClass());
-
         return newData.set(index, value, strict);
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Fri Jul 26 14:07:32 2013 -0700
@@ -55,7 +55,9 @@
     }
 
     private static Object[] toObjectArray(final long[] array, final int length) {
-        final Object[] oarray = new Object[length];
+        assert length <= array.length : "length exceeds internal array size";
+        final Object[] oarray = new Object[array.length];
+
         for (int index = 0; index < length; index++) {
             oarray[index] = Long.valueOf(array[index]);
         }
@@ -71,9 +73,11 @@
         return super.asArrayOfType(componentType);
     }
 
-    private static double[] toDoubleArray(final long[] array) {
+    private static double[] toDoubleArray(final long[] array, final int length) {
+        assert length <= array.length : "length exceeds internal array size";
         final double[] darray = new double[array.length];
-        for (int index = 0; index < array.length; index++) {
+
+        for (int index = 0; index < length; index++) {
             darray[index] = array[index];
         }
 
@@ -84,10 +88,12 @@
     public ArrayData convert(final Class<?> type) {
         if (type == Long.class) {
             return this;
-        } else if (type == Double.class) {
-            return new NumberArrayData(LongArrayData.toDoubleArray(array), (int) length());
+        }
+        final int length = (int) length();
+        if (type == Double.class) {
+            return new NumberArrayData(LongArrayData.toDoubleArray(array, length), length);
         } else {
-            return new ObjectArrayData(LongArrayData.toObjectArray(array, array.length), (int) length());
+            return new ObjectArrayData(LongArrayData.toObjectArray(array, length), length);
         }
     }
 
@@ -138,19 +144,13 @@
 
     @Override
     public ArrayData set(final int index, final Object value, final boolean strict) {
-        try {
-            final long longValue = ((Long)value).longValue();
-            array[index] = longValue;
-            setLength(Math.max(index + 1, length()));
-            return this;
-        } catch (final NullPointerException | ClassCastException e) {
-            if (value == ScriptRuntime.UNDEFINED) {
-                return new UndefinedArrayFilter(this).set(index, value, strict);
-            }
+        if (value instanceof Long || value instanceof Integer) {
+            return set(index, ((Number)value).longValue(), strict);
+        } else if (value == ScriptRuntime.UNDEFINED) {
+            return new UndefinedArrayFilter(this).set(index, value, strict);
         }
 
         final ArrayData newData = convert(value == null ? Object.class : value.getClass());
-
         return newData.set(index, value, strict);
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Fri Jul 26 14:07:32 2013 -0700
@@ -58,7 +58,9 @@
     }
 
     private static Object[] toObjectArray(final double[] array, final int length) {
-        final Object[] oarray = new Object[length];
+        assert length <= array.length : "length exceeds internal array size";
+        final Object[] oarray = new Object[array.length];
+
         for (int index = 0; index < length; index++) {
             oarray[index] = Double.valueOf(array[index]);
         }
@@ -76,7 +78,8 @@
     @Override
     public ArrayData convert(final Class<?> type) {
         if (type != Double.class && type != Integer.class && type != Long.class) {
-            return new ObjectArrayData(NumberArrayData.toObjectArray(array, array.length), (int) length());
+            final int length = (int) length();
+            return new ObjectArrayData(NumberArrayData.toObjectArray(array, length), length);
         }
         return this;
     }
@@ -127,16 +130,12 @@
 
     @Override
     public ArrayData set(final int index, final Object value, final boolean strict) {
-        try {
-            final double doubleValue = ((Number)value).doubleValue();
-            array[index] = doubleValue;
-            setLength(Math.max(index + 1, length()));
-            return this;
-        } catch (final NullPointerException | ClassCastException e) {
-            if (value == UNDEFINED) {
-                return new UndefinedArrayFilter(this).set(index, value, strict);
-            }
+        if (value instanceof Double || value instanceof Integer || value instanceof Long) {
+            return set(index, ((Number)value).doubleValue(), strict);
+        } else if (value == UNDEFINED) {
+            return new UndefinedArrayFilter(this).set(index, value, strict);
         }
+
         final ArrayData newData = convert(value == null ? Object.class : value.getClass());
         return newData.set(index, value, strict);
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Fri Jul 26 14:07:32 2013 -0700
@@ -146,7 +146,7 @@
 
     @Override
     public ArrayData setEmpty(final long lo, final long hi) {
-        Arrays.fill(array, (int)Math.max(lo, 0L), (int)Math.min(hi, (long)Integer.MAX_VALUE), ScriptRuntime.EMPTY);
+        Arrays.fill(array, (int)Math.max(lo, 0L), (int)Math.min(hi, Integer.MAX_VALUE), ScriptRuntime.EMPTY);
         return this;
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/Bootstrap.java	Fri Jul 26 14:07:32 2013 -0700
@@ -57,7 +57,7 @@
     static {
         final DynamicLinkerFactory factory = new DynamicLinkerFactory();
         factory.setPrioritizedLinkers(new NashornLinker(), new NashornPrimitiveLinker(), new NashornStaticClassLinker(),
-                new JSObjectLinker(), new ReflectionCheckLinker());
+                new BoundDynamicMethodLinker(), new JSObjectLinker(), new ReflectionCheckLinker());
         factory.setFallbackLinkers(new BeansLinker(), new NashornBottomLinker());
         factory.setSyncOnRelink(true);
         final int relinkThreshold = Options.getIntProperty("nashorn.unstable.relink.threshold", -1);
@@ -78,7 +78,7 @@
      * @return CallSite with MethodHandle to appropriate method or null if not found.
      */
     public static CallSite bootstrap(final Lookup lookup, final String opDesc, final MethodType type, final int flags) {
-        return dynamicLinker.link(LinkerCallSite.newLinkerCallSite(opDesc, type, flags));
+        return dynamicLinker.link(LinkerCallSite.newLinkerCallSite(lookup, opDesc, type, flags));
     }
 
     /**
@@ -94,12 +94,12 @@
         return new RuntimeCallSite(type, initialName);
     }
 
-
     /**
-     * Returns a dynamic invoker for a specified dynamic operation. You can use this method to create a method handle
-     * that when invoked acts completely as if it were a Nashorn-linked call site. An overview of available dynamic
-     * operations can be found in the <a href="https://github.com/szegedi/dynalink/wiki/User-Guide-0.4">Dynalink User Guide</a>,
-     * but we'll show few examples here:
+     * Returns a dynamic invoker for a specified dynamic operation using the public lookup. You can use this method to
+     * create a method handle that when invoked acts completely as if it were a Nashorn-linked call site. An overview of
+     * available dynamic operations can be found in the
+     * <a href="https://github.com/szegedi/dynalink/wiki/User-Guide-0.6">Dynalink User Guide</a>, but we'll show few
+     * examples here:
      * <ul>
      *   <li>Get a named property with fixed name:
      *     <pre>
@@ -196,7 +196,7 @@
     }
 
     /**
-     * Returns a dynamic invoker for a specified dynamic operation. Similar to
+     * Returns a dynamic invoker for a specified dynamic operation using the public lookup. Similar to
      * {@link #createDynamicInvoker(String, Class, Class...)} but with return and parameter types composed into a
      * method type in the signature. See the discussion of that method for details.
      * @param opDesc Dynalink dynamic operation descriptor.
@@ -204,7 +204,28 @@
      * @return MethodHandle for invoking the operation.
      */
     public static MethodHandle createDynamicInvoker(final String opDesc, final MethodType type) {
-        return bootstrap(null, opDesc, type, 0).dynamicInvoker();
+        return bootstrap(MethodHandles.publicLookup(), opDesc, type, 0).dynamicInvoker();
+    }
+
+    /**
+     * Binds a bean dynamic method (returned by invoking {@code dyn:getMethod} on an object linked with
+     * {@code BeansLinker} to a receiver.
+     * @param dynamicMethod the dynamic method to bind
+     * @param boundThis the bound "this" value.
+     * @return a bound dynamic method.
+     */
+    public static Object bindDynamicMethod(Object dynamicMethod, Object boundThis) {
+        return new BoundDynamicMethod(dynamicMethod, boundThis);
+    }
+
+    /**
+     * If the given class is a reflection-specific class (anything in {@code java.lang.reflect} and
+     * {@code java.lang.invoke} package, as well a {@link Class} and any subclass of {@link ClassLoader}) and there is
+     * a security manager in the system, then it checks the {@code nashorn.JavaReflection} {@code RuntimePermission}.
+     * @param clazz the class being tested
+     */
+    public static void checkReflectionAccess(Class<?> clazz) {
+        ReflectionCheckLinker.checkReflectionAccess(clazz);
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/BoundDynamicMethod.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.runtime.linker;
+
+import jdk.internal.dynalink.beans.BeansLinker;
+
+/**
+ * Represents a Dynalink dynamic method bound to a receiver. Note that objects of this class are just the tuples of
+ * a method and a bound this, without any behavior. All the behavior is defined in the {@link BoundDynamicMethodLinker}.
+ */
+final class BoundDynamicMethod {
+    private final Object dynamicMethod;
+    private final Object boundThis;
+
+    BoundDynamicMethod(final Object dynamicMethod, final Object boundThis) {
+        assert BeansLinker.isDynamicMethod(dynamicMethod);
+        this.dynamicMethod = dynamicMethod;
+        this.boundThis = boundThis;
+    }
+
+    Object getDynamicMethod() {
+        return dynamicMethod;
+    }
+
+    Object getBoundThis() {
+        return boundThis;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/BoundDynamicMethodLinker.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.runtime.linker;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import jdk.internal.dynalink.CallSiteDescriptor;
+import jdk.internal.dynalink.beans.BeansLinker;
+import jdk.internal.dynalink.linker.GuardedInvocation;
+import jdk.internal.dynalink.linker.LinkRequest;
+import jdk.internal.dynalink.linker.LinkerServices;
+import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
+import jdk.internal.dynalink.support.Guards;
+
+/**
+ * Links {@link BoundDynamicMethod} objects. Passes through to Dynalink's BeansLinker for linking a dynamic method
+ * (they only respond to "dyn:call"), and modifies the returned invocation to deal with the receiver binding.
+ */
+final class BoundDynamicMethodLinker implements TypeBasedGuardingDynamicLinker {
+    @Override
+    public boolean canLinkType(Class<?> type) {
+        return type == BoundDynamicMethod.class;
+    }
+
+    @Override
+    public GuardedInvocation getGuardedInvocation(LinkRequest linkRequest, LinkerServices linkerServices) throws Exception {
+        final Object objBoundDynamicMethod = linkRequest.getReceiver();
+        if(!(objBoundDynamicMethod instanceof BoundDynamicMethod)) {
+            return null;
+        }
+
+        final BoundDynamicMethod boundDynamicMethod = (BoundDynamicMethod)objBoundDynamicMethod;
+        final Object dynamicMethod = boundDynamicMethod.getDynamicMethod();
+        final Object boundThis = boundDynamicMethod.getBoundThis();
+
+        // Replace arguments (boundDynamicMethod, this, ...) => (dynamicMethod, boundThis, ...) when delegating to
+        // BeansLinker
+        final Object[] args = linkRequest.getArguments();
+        args[0] = dynamicMethod;
+        args[1] = boundThis;
+
+        // Use R(T0, T1, ...) => R(dynamicMethod.class, boundThis.class, ...) call site type when delegating to
+        // BeansLinker.
+        final CallSiteDescriptor descriptor = linkRequest.getCallSiteDescriptor();
+        final MethodType type = descriptor.getMethodType();
+        final CallSiteDescriptor newDescriptor = descriptor.changeMethodType(
+                type.changeParameterType(0, dynamicMethod.getClass()).changeParameterType(1, boundThis.getClass()));
+
+        // Delegate to BeansLinker
+        final GuardedInvocation inv = BeansLinker.getLinkerForClass(dynamicMethod.getClass()).getGuardedInvocation(
+                linkRequest.replaceArguments(newDescriptor, args), linkerServices);
+        if(inv == null) {
+            return null;
+        }
+
+        // Bind (dynamicMethod, boundThis) to the handle
+        final MethodHandle boundHandle = MethodHandles.insertArguments(inv.getInvocation(), 0, dynamicMethod, boundThis);
+        final Class<?> p0Type = type.parameterType(0);
+        // Ignore incoming (boundDynamicMethod, this)
+        final MethodHandle droppingHandle = MethodHandles.dropArguments(boundHandle, 0, p0Type, type.parameterType(1));
+        // Identity guard on boundDynamicMethod object
+        final MethodHandle newGuard = Guards.getIdentityGuard(boundDynamicMethod);
+
+        return inv.replaceMethods(droppingHandle, newGuard.asType(newGuard.type().changeParameterType(0, p0Type)));
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/InvokeByName.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/InvokeByName.java	Fri Jul 26 14:07:32 2013 -0700
@@ -83,7 +83,7 @@
      */
     public InvokeByName(final String name, final Class<?> targetClass, final Class<?> rtype, final Class<?>... ptypes) {
         this.name = name;
-        getter  = Bootstrap.createDynamicInvoker("dyn:getMethod|getProp|getItem:" + name, Object.class, targetClass);
+        getter  = Bootstrap.createDynamicInvoker("dyn:getMethod|getProp|getElem:" + name, Object.class, targetClass);
 
         final Class<?>[] finalPtypes;
         final int plength = ptypes.length;
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,6 +28,7 @@
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 
 import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.lang.reflect.Modifier;
 import java.security.AccessController;
@@ -39,10 +40,10 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import jdk.internal.dynalink.beans.StaticClass;
 import jdk.internal.dynalink.support.LinkRequestImpl;
 import jdk.nashorn.internal.objects.NativeJava;
+import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.ECMAException;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
@@ -99,6 +100,13 @@
      */
     public static StaticClass getAdapterClassFor(final Class<?>[] types, ScriptObject classOverrides) {
         assert types != null && types.length > 0;
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            for (Class<?> type : types) {
+                // check for restricted package access
+                Context.checkPackageAccess(type.getName());
+            }
+        }
         return getAdapterInfo(types).getAdapterClassFor(classOverrides);
     }
 
@@ -119,9 +127,12 @@
         return AccessController.doPrivileged(new PrivilegedExceptionAction<MethodHandle>() {
             @Override
             public MethodHandle run() throws Exception {
-                return  MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get(
-                    "dyn:new", MethodType.methodType(targetType, StaticClass.class, sourceType), 0), false,
-                    adapterClass, null)).getInvocation(), adapterClass);
+                // NOTE: we use publicLookup(), but none of our adapter constructors are caller sensitive, so this is
+                // okay, we won't artificially limit access.
+                return  MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(
+                        NashornCallSiteDescriptor.get(MethodHandles.publicLookup(),  "dyn:new",
+                                MethodType.methodType(targetType, StaticClass.class, sourceType), 0), false,
+                                adapterClass, null)).getInvocation(), adapterClass);
             }
         });
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/LinkerCallSite.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/LinkerCallSite.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,7 +25,6 @@
 
 package jdk.nashorn.internal.runtime.linker;
 
-import jdk.nashorn.internal.lookup.MethodHandleFactory;
 import static jdk.nashorn.internal.lookup.Lookup.MH;
 
 import java.io.FileNotFoundException;
@@ -47,6 +46,7 @@
 import jdk.internal.dynalink.ChainedCallSite;
 import jdk.internal.dynalink.DynamicLinker;
 import jdk.internal.dynalink.linker.GuardedInvocation;
+import jdk.nashorn.internal.lookup.MethodHandleFactory;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.Debug;
 import jdk.nashorn.internal.runtime.ScriptObject;
@@ -79,8 +79,9 @@
      * @param flags    Call site specific flags.
      * @return New LinkerCallSite.
      */
-    static LinkerCallSite newLinkerCallSite(final String name, final MethodType type, final int flags) {
-        final NashornCallSiteDescriptor desc = NashornCallSiteDescriptor.get(name, type, flags);
+    static LinkerCallSite newLinkerCallSite(final MethodHandles.Lookup lookup, final String name, final MethodType type,
+            final int flags) {
+        final NashornCallSiteDescriptor desc = NashornCallSiteDescriptor.get(lookup, name, type, flags);
 
         if (desc.isProfile()) {
             return ProfilingLinkerCallSite.newProfilingLinkerCallSite(desc);
@@ -132,7 +133,7 @@
     }
 
     private static String getScriptLocation() {
-        final StackTraceElement caller = DynamicLinker.getRelinkedCallSiteLocation();
+        final StackTraceElement caller = DynamicLinker.getLinkedCallSiteLocation();
         return caller == null ? "unknown location" : (caller.getFileName() + ":" + caller.getLineNumber());
     }
 
@@ -316,7 +317,7 @@
 
         private static final MethodHandle TRACEOBJECT = findOwnMH("traceObject", Object.class, MethodHandle.class, Object[].class);
         private static final MethodHandle TRACEVOID   = findOwnMH("traceVoid", void.class, MethodHandle.class, Object[].class);
-        private static final MethodHandle TRACEMISS   = findOwnMH("traceMiss", void.class, Object[].class);
+        private static final MethodHandle TRACEMISS   = findOwnMH("traceMiss", void.class, String.class, Object[].class);
 
         TracingLinkerCallSite(final NashornCallSiteDescriptor desc) {
            super(desc);
@@ -362,7 +363,7 @@
                 return relink;
             }
             final MethodType type = relink.type();
-            return MH.foldArguments(relink, MH.asType(MH.asCollector(MH.bindTo(TRACEMISS, this), Object[].class, type.parameterCount()), type.changeReturnType(void.class)));
+            return MH.foldArguments(relink, MH.asType(MH.asCollector(MH.insertArguments(TRACEMISS, 0, this, "MISS " + getScriptLocation() + " "), Object[].class, type.parameterCount()), type.changeReturnType(void.class)));
         }
 
         private void printObject(final PrintWriter out, final Object arg) {
@@ -481,8 +482,8 @@
          * @throws Throwable if invocation failes or throws exception/error
          */
         @SuppressWarnings("unused")
-        public void traceMiss(final Object... args) throws Throwable {
-            tracePrint(Context.getCurrentErr(), "MISS ", args, null);
+        public void traceMiss(final String desc, final Object... args) throws Throwable {
+            tracePrint(Context.getCurrentErr(), desc, args, null);
         }
 
         private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,9 +25,11 @@
 
 package jdk.nashorn.internal.runtime.linker;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodHandles.Lookup;
 import java.lang.invoke.MethodType;
-import java.lang.ref.WeakReference;
-import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.support.AbstractCallSiteDescriptor;
 import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
@@ -70,9 +72,15 @@
      * set. */
     public static final int CALLSITE_TRACE_SCOPE      = 0x200;
 
-    private static final WeakHashMap<NashornCallSiteDescriptor, WeakReference<NashornCallSiteDescriptor>> canonicals =
-            new WeakHashMap<>();
+    private static final ClassValue<ConcurrentMap<NashornCallSiteDescriptor, NashornCallSiteDescriptor>> canonicals =
+            new ClassValue<ConcurrentMap<NashornCallSiteDescriptor,NashornCallSiteDescriptor>>() {
+        @Override
+        protected ConcurrentMap<NashornCallSiteDescriptor, NashornCallSiteDescriptor> computeValue(Class<?> type) {
+            return new ConcurrentHashMap<>();
+        }
+    };
 
+    private final MethodHandles.Lookup lookup;
     private final String operator;
     private final String operand;
     private final MethodType methodType;
@@ -81,39 +89,35 @@
     /**
      * Retrieves a Nashorn call site descriptor with the specified values. Since call site descriptors are immutable
      * this method is at liberty to retrieve canonicalized instances (although it is not guaranteed it will do so).
+     * @param lookup the lookup describing the script
      * @param name the name at the call site, e.g. {@code "dyn:getProp|getElem|getMethod:color"}.
      * @param methodType the method type at the call site
      * @param flags Nashorn-specific call site flags
      * @return a call site descriptor with the specified values.
      */
-    public static NashornCallSiteDescriptor get(final String name, final MethodType methodType, final int flags) {
+    public static NashornCallSiteDescriptor get(final MethodHandles.Lookup lookup, final String name,
+            final MethodType methodType, final int flags) {
         final String[] tokenizedName = CallSiteDescriptorFactory.tokenizeName(name);
         assert tokenizedName.length == 2 || tokenizedName.length == 3;
         assert "dyn".equals(tokenizedName[0]);
         assert tokenizedName[1] != null;
         // TODO: see if we can move mangling/unmangling into Dynalink
-        return get(tokenizedName[1], tokenizedName.length == 3 ? tokenizedName[2].intern() : null,
+        return get(lookup, tokenizedName[1], tokenizedName.length == 3 ? tokenizedName[2].intern() : null,
                 methodType, flags);
     }
 
-    private static NashornCallSiteDescriptor get(final String operator, final String operand, final MethodType methodType, final int flags) {
-        final NashornCallSiteDescriptor csd = new NashornCallSiteDescriptor(operator, operand, methodType, flags);
+    private static NashornCallSiteDescriptor get(final MethodHandles.Lookup lookup, final String operator, final String operand, final MethodType methodType, final int flags) {
+        final NashornCallSiteDescriptor csd = new NashornCallSiteDescriptor(lookup, operator, operand, methodType, flags);
         // Many of these call site descriptors are identical (e.g. every getter for a property color will be
-        // "dyn:getProp:color(Object)Object", so it makes sense canonicalizing them in a weak map
-        synchronized(canonicals) {
-            final WeakReference<NashornCallSiteDescriptor> ref = canonicals.get(csd);
-            if(ref != null) {
-                final NashornCallSiteDescriptor canonical = ref.get();
-                if(canonical != null) {
-                    return canonical;
-                }
-            }
-            canonicals.put(csd, new WeakReference<>(csd));
-        }
-        return csd;
+        // "dyn:getProp:color(Object)Object", so it makes sense canonicalizing them.
+        final ConcurrentMap<NashornCallSiteDescriptor, NashornCallSiteDescriptor> classCanonicals = canonicals.get(lookup.lookupClass());
+        final NashornCallSiteDescriptor canonical = classCanonicals.putIfAbsent(csd, csd);
+        return canonical != null ? canonical : csd;
     }
 
-    private NashornCallSiteDescriptor(final String operator, final String operand, final MethodType methodType, final int flags) {
+    private NashornCallSiteDescriptor(final MethodHandles.Lookup lookup, final String operator, final String operand,
+            final MethodType methodType, final int flags) {
+        this.lookup = lookup;
         this.operator = operator;
         this.operand = operand;
         this.methodType = methodType;
@@ -142,6 +146,11 @@
     }
 
     @Override
+    public Lookup getLookup() {
+        return lookup;
+    }
+
+    @Override
     public boolean equals(final CallSiteDescriptor csd) {
         return super.equals(csd) && flags == getFlags(csd);
     }
@@ -279,6 +288,6 @@
 
     @Override
     public CallSiteDescriptor changeMethodType(final MethodType newMethodType) {
-        return get(operator, operand, newMethodType, flags);
+        return get(getLookup(), operator, operand, newMethodType, flags);
     }
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/ReflectionCheckLinker.java	Fri Jul 26 14:07:32 2013 -0700
@@ -25,10 +25,14 @@
 
 package jdk.nashorn.internal.runtime.linker;
 
+import java.lang.reflect.Modifier;
+import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
 import jdk.internal.dynalink.linker.LinkerServices;
 import jdk.internal.dynalink.linker.TypeBasedGuardingDynamicLinker;
+import jdk.internal.dynalink.support.CallSiteDescriptorFactory;
+import jdk.nashorn.internal.runtime.Context;
 
 /**
  * Check java reflection permission for java reflective and java.lang.invoke access from scripts
@@ -36,10 +40,10 @@
 final class ReflectionCheckLinker implements TypeBasedGuardingDynamicLinker{
     @Override
     public boolean canLinkType(final Class<?> type) {
-        return canLinkTypeStatic(type);
+        return isReflectionClass(type);
     }
 
-    private static boolean canLinkTypeStatic(final Class<?> type) {
+    private static boolean isReflectionClass(final Class<?> type) {
         if (type == Class.class || ClassLoader.class.isAssignableFrom(type)) {
             return true;
         }
@@ -50,11 +54,39 @@
     @Override
     public GuardedInvocation getGuardedInvocation(final LinkRequest origRequest, final LinkerServices linkerServices)
             throws Exception {
-        final SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new RuntimePermission("nashorn.JavaReflection"));
-        }
+        checkLinkRequest(origRequest);
         // let the next linker deal with actual linking
         return null;
     }
+
+    static void checkReflectionAccess(Class<?> clazz) {
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null && isReflectionClass(clazz)) {
+            checkReflectionPermission(sm);
+        }
+    }
+
+    private static void checkLinkRequest(final LinkRequest origRequest) {
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            final LinkRequest requestWithoutContext = origRequest.withoutRuntimeContext(); // Nashorn has no runtime context
+            final Object self = requestWithoutContext.getReceiver();
+            // allow 'static' access on Class objects representing public classes of non-restricted packages
+            if ((self instanceof Class) && Modifier.isPublic(((Class<?>)self).getModifiers())) {
+                final CallSiteDescriptor desc = requestWithoutContext.getCallSiteDescriptor();
+                if(CallSiteDescriptorFactory.tokenizeOperators(desc).contains("getProp")) {
+                    if ("static".equals(desc.getNameToken(CallSiteDescriptor.NAME_OPERAND))) {
+                        Context.checkPackageAccess(((Class)self).getName());
+                        // If "getProp:static" passes package access, allow access.
+                        return;
+                    }
+                }
+            }
+            checkReflectionPermission(sm);
+        }
+    }
+
+    private static void checkReflectionPermission(final SecurityManager sm) {
+        sm.checkPermission(new RuntimePermission("nashorn.JavaReflection"));
+    }
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java	Fri Jul 26 14:07:32 2013 -0700
@@ -84,9 +84,7 @@
                 this.regex = new Regex(javaPattern, 0, javaPattern.length, option, Syntax.JAVASCRIPT);
                 this.groupsInNegativeLookahead = parsed.getGroupsInNegativeLookahead();
             }
-        } catch (final PatternSyntaxException e2) {
-            throwParserException("syntax", e2.getMessage());
-        } catch (JOniException e2) {
+        } catch (final PatternSyntaxException | JOniException e2) {
             throwParserException("syntax", e2.getMessage());
         }
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java	Fri Jul 26 14:07:32 2013 -0700
@@ -57,7 +57,10 @@
     private final LinkedList<Integer> forwardReferences = new LinkedList<>();
 
     /** Current level of zero-width negative lookahead assertions. */
-    private int negativeLookaheadLevel;
+    private int negLookaheadLevel;
+
+    /** Sequential id of current top-level zero-width negative lookahead assertion. */
+    private int negLookaheadGroup;
 
     /** Are we currently inside a character class? */
     private boolean inCharClass = false;
@@ -68,17 +71,18 @@
     private static final String NON_IDENT_ESCAPES = "$^*+(){}[]|\\.?-";
 
     private static class Capture {
-        /**
-         * Zero-width negative lookaheads enclosing the capture.
-         */
-        private final int negativeLookaheadLevel;
+        /** Zero-width negative lookaheads enclosing the capture. */
+        private final int negLookaheadLevel;
+        /** Sequential id of top-level negative lookaheads containing the capture. */
+        private  final int negLookaheadGroup;
 
-        Capture(final int negativeLookaheadLevel) {
-            this.negativeLookaheadLevel = negativeLookaheadLevel;
+        Capture(final int negLookaheadGroup, final int negLookaheadLevel) {
+            this.negLookaheadGroup = negLookaheadGroup;
+            this.negLookaheadLevel = negLookaheadLevel;
         }
 
-        public int getNegativeLookaheadLevel() {
-            return negativeLookaheadLevel;
+        boolean isContained(final int group, final int level) {
+            return group == this.negLookaheadGroup && level >= this.negLookaheadLevel;
         }
 
     }
@@ -152,7 +156,7 @@
         BitVector vec = null;
         for (int i = 0; i < caps.size(); i++) {
             final Capture cap = caps.get(i);
-            if (cap.getNegativeLookaheadLevel() > 0) {
+            if (cap.negLookaheadLevel > 0) {
                 if (vec == null) {
                     vec = new BitVector(caps.size() + 1);
                 }
@@ -311,11 +315,14 @@
             commit(3);
 
             if (isNegativeLookahead) {
-                negativeLookaheadLevel++;
+                if (negLookaheadLevel == 0) {
+                    negLookaheadGroup++;
+                }
+                negLookaheadLevel++;
             }
             disjunction();
             if (isNegativeLookahead) {
-                negativeLookaheadLevel--;
+                negLookaheadLevel--;
             }
 
             if (ch0 == ')') {
@@ -432,20 +439,17 @@
         }
 
         if (ch0 == '(') {
-            boolean capturingParens = true;
             commit(1);
             if (ch0 == '?' && ch1 == ':') {
-                capturingParens = false;
                 commit(2);
+            } else {
+                caps.add(new Capture(negLookaheadGroup, negLookaheadLevel));
             }
 
             disjunction();
 
             if (ch0 == ')') {
                 commit(1);
-                if (capturingParens) {
-                    caps.add(new Capture(negativeLookaheadLevel));
-                }
                 return true;
             }
         }
@@ -675,24 +679,22 @@
                     sb.setLength(sb.length() - 1);
                     octalOrLiteral(Integer.toString(decimalValue), sb);
 
-                } else if (decimalValue <= caps.size() && caps.get(decimalValue - 1).getNegativeLookaheadLevel() > 0) {
-                    //  Captures that live inside a negative lookahead are dead after the
-                    //  lookahead and will be undefined if referenced from outside.
-                    if (caps.get(decimalValue - 1).getNegativeLookaheadLevel() > negativeLookaheadLevel) {
+                } else if (decimalValue <= caps.size()) {
+                    //  Captures inside a negative lookahead are undefined when referenced from the outside.
+                    if (!caps.get(decimalValue - 1).isContained(negLookaheadGroup, negLookaheadLevel)) {
+                        // Reference to capture in negative lookahead, omit from output buffer.
                         sb.setLength(sb.length() - 1);
                     } else {
+                        // Append backreference to output buffer.
                         sb.append(decimalValue);
                     }
-                } else if (decimalValue > caps.size()) {
-                    // Forward reference to a capture group. Forward references are always undefined so we can omit
-                    // it from the output buffer. However, if the target capture does not exist, we need to rewrite
-                    // the reference as hex escape or literal string, so register the reference for later processing.
+                } else {
+                    // Forward references to a capture group are always undefined so we can omit it from the output buffer.
+                    // However, if the target capture does not exist, we need to rewrite the reference as hex escape
+                    // or literal string, so register the reference for later processing.
                     sb.setLength(sb.length() - 1);
                     forwardReferences.add(decimalValue);
                     forwardReferences.add(sb.length());
-                } else {
-                    // Append as backreference
-                    sb.append(decimalValue);
                 }
 
             }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Analyser.java	Fri Jul 26 14:07:32 2013 -0700
@@ -41,10 +41,12 @@
 import jdk.nashorn.internal.runtime.regexp.joni.constants.AnchorType;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.EncloseType;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.NodeType;
-import jdk.nashorn.internal.runtime.regexp.joni.constants.RegexState;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.StackPopLevel;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.TargetInfo;
 import jdk.nashorn.internal.runtime.regexp.joni.encoding.ObjPtr;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.InternalException;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
 
 final class Analyser extends Parser {
 
@@ -53,8 +55,6 @@
     }
 
     protected final void compile() {
-        regex.state = RegexState.COMPILING;
-
         if (Config.DEBUG) {
             Config.log.println(new String(chars, getBegin(), getEnd()));
         }
@@ -115,8 +115,6 @@
             Config.log.println(new ByteCodePrinter(regex).byteCodeListToString());
 
         } // DEBUG_COMPILE
-
-        regex.state = RegexState.NORMAL;
     }
 
     private void swap(Node a, Node b) {
@@ -187,14 +185,11 @@
             BackRefNode br = (BackRefNode)node;
             if (br.isRecursion()) break;
 
-            if (br.back[0] > env.numMem) newValueException(ERR_INVALID_BACKREF);
-            min = getMinMatchLength(env.memNodes[br.back[0]]);
+            if (br.backRef > env.numMem) {
+                throw new ValueException(ERR_INVALID_BACKREF);
+            }
+            min = getMinMatchLength(env.memNodes[br.backRef]);
 
-            for (int i=1; i<br.backNum; i++) {
-                if (br.back[i] > env.numMem) newValueException(ERR_INVALID_BACKREF);
-                int tmin = getMinMatchLength(env.memNodes[br.back[i]]);
-                if (min > tmin) min = tmin;
-            }
             break;
 
         case NodeType.LIST:
@@ -306,11 +301,11 @@
                 break;
             }
 
-            for (int i=0; i<br.backNum; i++) {
-                if (br.back[i] > env.numMem) newValueException(ERR_INVALID_BACKREF);
-                int tmax = getMaxMatchLength(env.memNodes[br.back[i]]);
-                if (max < tmax) max = tmax;
+            if (br.backRef > env.numMem) {
+                throw new ValueException(ERR_INVALID_BACKREF);
             }
+            int tmax = getMaxMatchLength(env.memNodes[br.backRef]);
+            if (max < tmax) max = tmax;
             break;
 
         case NodeType.QTFR:
@@ -417,8 +412,6 @@
             break;
 
         case NodeType.CTYPE:
-            len = 1;
-
         case NodeType.CCLASS:
         case NodeType.CANY:
             len = 1;
@@ -712,13 +705,12 @@
             an.charLength = len;
             break;
         case GET_CHAR_LEN_VARLEN:
-            newSyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
-            break;
+            throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
         case GET_CHAR_LEN_TOP_ALT_VARLEN:
             if (syntax.differentLengthAltLookBehind()) {
                 return divideLookBehindAlternatives(node);
             } else {
-                newSyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
+                throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
             }
         }
         return node;
@@ -955,12 +947,12 @@
 
         case NodeType.BREF:
             BackRefNode br = (BackRefNode)node;
-            for (int i=0; i<br.backNum; i++) {
-                if (br.back[i] > env.numMem) newValueException(ERR_INVALID_BACKREF);
-                env.backrefedMem = bsOnAt(env.backrefedMem, br.back[i]);
-                env.btMemStart = bsOnAt(env.btMemStart, br.back[i]);
-                ((EncloseNode)env.memNodes[br.back[i]]).setMemBackrefed();
+            if (br.backRef > env.numMem) {
+                throw new ValueException(ERR_INVALID_BACKREF);
             }
+            env.backrefedMem = bsOnAt(env.backrefedMem, br.backRef);
+            env.btMemStart = bsOnAt(env.btMemStart, br.backRef);
+            ((EncloseNode)env.memNodes[br.backRef]).setMemBackrefed();
             break;
 
         case NodeType.QTFR:
@@ -1064,14 +1056,18 @@
                 break;
 
             case AnchorType.LOOK_BEHIND:
-                if (checkTypeTree(an.target, NodeType.ALLOWED_IN_LB, EncloseType.ALLOWED_IN_LB, AnchorType.ALLOWED_IN_LB)) newSyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
+                if (checkTypeTree(an.target, NodeType.ALLOWED_IN_LB, EncloseType.ALLOWED_IN_LB, AnchorType.ALLOWED_IN_LB)) {
+                    throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
+                }
                 node = setupLookBehind(node);
                 if (node.getType() != NodeType.ANCHOR) continue restart;
                 setupTree(((AnchorNode)node).target, state);
                 break;
 
             case AnchorType.LOOK_BEHIND_NOT:
-                if (checkTypeTree(an.target, NodeType.ALLOWED_IN_LB, EncloseType.ALLOWED_IN_LB, AnchorType.ALLOWED_IN_LB)) newSyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
+                if (checkTypeTree(an.target, NodeType.ALLOWED_IN_LB, EncloseType.ALLOWED_IN_LB, AnchorType.ALLOWED_IN_LB)) {
+                    throw new SyntaxException(ERR_INVALID_LOOK_BEHIND_PATTERN);
+                }
                 node = setupLookBehind(node);
                 if (node.getType() != NodeType.ANCHOR) continue restart;
                 setupTree(((AnchorNode)node).target, (state | IN_NOT));
@@ -1218,15 +1214,9 @@
 
             Node[]nodes = oenv.scanEnv.memNodes;
 
-            int min = getMinMatchLength(nodes[br.back[0]]);
-            int max = getMaxMatchLength(nodes[br.back[0]]);
+            int min = getMinMatchLength(nodes[br.backRef]);
+            int max = getMaxMatchLength(nodes[br.backRef]);
 
-            for (int i=1; i<br.backNum; i++) {
-                int tmin = getMinMatchLength(nodes[br.back[i]]);
-                int tmax = getMaxMatchLength(nodes[br.back[i]]);
-                if (min > tmin) min = tmin;
-                if (max < tmax) max = tmax;
-            }
             opt.length.set(min, max);
             break;
         }
@@ -1314,7 +1304,7 @@
         }
 
         default:
-            newInternalException(ERR_PARSER_BUG);
+            throw new InternalException(ERR_PARSER_BUG);
         } // switch
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java	Fri Jul 26 14:07:32 2013 -0700
@@ -100,12 +100,7 @@
     }
 
     private boolean isNeedStrLenOpExact(int op) {
-        return  op == OPCode.EXACTN         ||
-                op == OPCode.EXACTMB2N      ||
-                op == OPCode.EXACTMB3N      ||
-                op == OPCode.EXACTMBN       ||
-                op == OPCode.EXACTN_IC      ||
-                op == OPCode.EXACTN_IC_SB;
+        return  op == OPCode.EXACTN || op == OPCode.EXACTN_IC;
     }
 
     private boolean opTemplated(int op) {
@@ -172,7 +167,6 @@
             if (isNeedStrLenOpExact(op)) len += OPSize.LENGTH;
             len += strLength;
         }
-        if (op == OPCode.EXACTMBN) len += OPSize.LENGTH;
         return len;
     }
 
@@ -181,8 +175,6 @@
         int op = selectStrOpcode(strLength, ignoreCase);
         addOpcode(op);
 
-        if (op == OPCode.EXACTMBN) addLength(1);
-
         if (isNeedStrLenOpExact(op)) {
             addLength(strLength);
         }
@@ -294,35 +286,22 @@
 
     @Override
     protected void compileBackrefNode(BackRefNode node) {
-        BackRefNode br = node;
-        // USE_BACKREF_AT_LEVEL
-        if (br.backNum == 1) {
-            if (isIgnoreCase(regex.options)) {
-                addOpcode(OPCode.BACKREFN_IC);
-                addMemNum(br.back[0]);
-            } else {
-                switch (br.back[0]) {
-                    case 1:
-                        addOpcode(OPCode.BACKREF1);
-                        break;
-                    case 2:
-                        addOpcode(OPCode.BACKREF2);
-                        break;
-                    default:
-                        addOpcode(OPCode.BACKREFN);
-                        addOpcode(br.back[0]);
-                        break;
-                } // switch
-            }
+        if (isIgnoreCase(regex.options)) {
+            addOpcode(OPCode.BACKREFN_IC);
+            addMemNum(node.backRef);
         } else {
-            if (isIgnoreCase(regex.options)) {
-                addOpcode(OPCode.BACKREF_MULTI_IC);
-            } else {
-                addOpcode(OPCode.BACKREF_MULTI);
-            }
-            // !add_bacref_mems:!
-            addLength(br.backNum);
-            for (int i=br.backNum-1; i>=0; i--) addMemNum(br.back[i]);
+            switch (node.backRef) {
+                case 1:
+                    addOpcode(OPCode.BACKREF1);
+                    break;
+                case 2:
+                    addOpcode(OPCode.BACKREF2);
+                    break;
+                default:
+                    addOpcode(OPCode.BACKREFN);
+                    addOpcode(node.backRef);
+                    break;
+            } // switch
         }
     }
 
@@ -791,13 +770,8 @@
         case NodeType.BREF:
             BackRefNode br = (BackRefNode)node;
 
-            // USE_BACKREF_AT_LEVEL
-            if (br.backNum == 1) {
-                len = ((!isIgnoreCase(regex.options) && br.back[0] <= 2)
-                        ? OPSize.OPCODE : (OPSize.OPCODE + OPSize.MEMNUM));
-            } else {
-                len = OPSize.OPCODE + OPSize.LENGTH + (OPSize.MEMNUM * br.backNum);
-            }
+            len = ((!isIgnoreCase(regex.options) && br.backRef <= 2)
+                    ? OPSize.OPCODE : (OPSize.OPCODE + OPSize.MEMNUM));
             break;
 
         case NodeType.QTFR:
@@ -873,15 +847,10 @@
 
         switch(opcode) {
         case OPCode.ANYCHAR_STAR:
-        case OPCode.ANYCHAR_STAR_SB:
         case OPCode.ANYCHAR_ML_STAR:
-        case OPCode.ANYCHAR_ML_STAR_SB:
         case OPCode.ANYCHAR_STAR_PEEK_NEXT:
-        case OPCode.ANYCHAR_STAR_PEEK_NEXT_SB:
         case OPCode.ANYCHAR_ML_STAR_PEEK_NEXT:
-        case OPCode.ANYCHAR_ML_STAR_PEEK_NEXT_SB:
         case OPCode.STATE_CHECK_ANYCHAR_STAR:
-        case OPCode.STATE_CHECK_ANYCHAR_STAR_SB:
         case OPCode.STATE_CHECK_ANYCHAR_ML_STAR:
         case OPCode.MEMORY_START_PUSH:
         case OPCode.MEMORY_END_PUSH:
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Fri Jul 26 14:07:32 2013 -0700
@@ -45,7 +45,7 @@
     private int sstart;
     private int sbegin;
 
-    private final int[]code;        // byte code
+    private final int[] code;       // byte code
     private int ip;                 // instruction pointer
 
     ByteCodeMachine(Regex regex, char[] chars, int p, int end) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodePrinter.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodePrinter.java	Fri Jul 26 14:07:32 2013 -0700
@@ -26,13 +26,11 @@
 import jdk.nashorn.internal.runtime.regexp.joni.exception.InternalException;
 
 class ByteCodePrinter {
-    final int[]code;
+    final int[] code;
     final int codeLength;
     final char[][] templates;
 
-    Object[]operands;
-    int operantCount;
-    WarnCallback warnings;
+    Object[] operands;
 
     private final static String OpCodeNames[] = new String[] {
             "finish", /*OP_FINISH*/
@@ -123,32 +121,6 @@
             "state-check-anychar-ml*", /*OP_STATE_CHECK_ANYCHAR_ML_STAR*/
             "set-option-push", /*OP_SET_OPTION_PUSH*/
             "set-option", /*OP_SET_OPTION*/
-
-            // single byte versions
-            "anychar-sb", /*OP_ANYCHAR*/
-            "anychar-ml-sb", /*OP_ANYCHAR_ML*/
-            "anychar*-sb", /*OP_ANYCHAR_STAR*/
-            "anychar-ml*-sb", /*OP_ANYCHAR_ML_STAR*/
-            "anychar*-peek-next-sb", /*OP_ANYCHAR_STAR_PEEK_NEXT*/
-            "anychar-ml*-peek-next-sb", /*OP_ANYCHAR_ML_STAR_PEEK_NEXT*/
-            "state-check-anychar*-sb", /*OP_STATE_CHECK_ANYCHAR_STAR*/
-            "state-check-anychar-ml*-sb", /*OP_STATE_CHECK_ANYCHAR_ML_STAR*/
-
-            "cclass-sb", /*OP_CCLASS*/
-            "cclass-not-sb", /*OP_CCLASS_NOT*/
-
-            "word-sb", /*OP_WORD*/
-            "not-word-sb", /*OP_NOT_WORD*/
-            "word-bound-sb", /*OP_WORD_BOUND*/
-            "not-word-bound-sb", /*OP_NOT_WORD_BOUND*/
-            "word-begin-sb", /*OP_WORD_BEGIN*/
-            "word-end-sb", /*OP_WORD_END*/
-
-            "look-behind-sb", /*OP_LOOK_BEHIND*/
-
-            "exact1-ic-sb", /*OP_EXACT1_IC*/
-            "exactn-ic-sb", /*OP_EXACTN_IC*/
-
     };
 
     private final static int OpCodeArgTypes[] = new int[] {
@@ -240,41 +212,14 @@
             Arguments.STATE_CHECK, /*OP_STATE_CHECK_ANYCHAR_ML_STAR*/
             Arguments.OPTION, /*OP_SET_OPTION_PUSH*/
             Arguments.OPTION, /*OP_SET_OPTION*/
-
-            // single byte versions
-            Arguments.NON, /*OP_ANYCHAR*/
-            Arguments.NON, /*OP_ANYCHAR_ML*/
-            Arguments.NON, /*OP_ANYCHAR_STAR*/
-            Arguments.NON, /*OP_ANYCHAR_ML_STAR*/
-            Arguments.SPECIAL, /*OP_ANYCHAR_STAR_PEEK_NEXT*/
-            Arguments.SPECIAL, /*OP_ANYCHAR_ML_STAR_PEEK_NEXT*/
-            Arguments.STATE_CHECK, /*OP_STATE_CHECK_ANYCHAR_STAR*/
-            Arguments.STATE_CHECK, /*OP_STATE_CHECK_ANYCHAR_ML_STAR*/
-
-            Arguments.SPECIAL, /*OP_CCLASS*/
-            Arguments.SPECIAL, /*OP_CCLASS_NOT*/
-
-            Arguments.NON, /*OP_WORD*/
-            Arguments.NON, /*OP_NOT_WORD*/
-            Arguments.NON, /*OP_WORD_BOUND*/
-            Arguments.NON, /*OP_NOT_WORD_BOUND*/
-            Arguments.NON, /*OP_WORD_BEGIN*/
-            Arguments.NON, /*OP_WORD_END*/
-
-            Arguments.SPECIAL, /*OP_LOOK_BEHIND*/
-
-            Arguments.SPECIAL, /*OP_EXACT1_IC*/
-            Arguments.SPECIAL, /*OP_EXACTN_IC*/
     };
 
     public ByteCodePrinter(Regex regex) {
         code = regex.code;
         codeLength = regex.codeLength;
         operands = regex.operands;
-        operantCount = regex.operandLength;
 
         templates = regex.templates;
-        warnings = regex.warnings;
     }
 
     public String byteCodeListToString() {
@@ -283,24 +228,17 @@
 
     private void pString(StringBuilder sb, int len, int s) {
         sb.append(":");
-        while (len-- > 0) sb.append(new String(new byte[]{(byte)code[s++]}));
-    }
-
-    private void pStringFromTemplate(StringBuilder sb, int len, byte[]tm, int idx) {
-        sb.append(":T:");
-        while (len-- > 0) sb.append(new String(new byte[]{tm[idx++]}));
+        sb.append(new String(code, s, len));
     }
 
-    private void pLenString(StringBuilder sb, int len, int mbLen, int s) {
-        int x = len * mbLen;
-        sb.append(":" + len + ":");
-        while (x-- > 0) sb.append(new String(new byte[]{(byte)code[s++]}));
+    private void pLenString(StringBuilder sb, int len, int s) {
+        sb.append(":").append(len).append(":");
+        sb.append(new String(code, s, len));
     }
 
-    private void pLenStringFromTemplate(StringBuilder sb, int len, int mbLen, char[] tm, int idx) {
-        int x = len * mbLen;
-        sb.append(":T:" + len + ":");
-        while (x-- > 0) sb.append(new String(new byte[]{(byte)tm[idx++]}));
+    private void pLenStringFromTemplate(StringBuilder sb, int len, char[] tm, int idx) {
+        sb.append(":T:").append(len).append(":");
+        sb.append(tm, idx, len);
     }
 
     public int compiledByteCodeToString(StringBuilder sb, int bp) {
@@ -309,7 +247,7 @@
         CClassNode cc;
         int tm, idx;
 
-        sb.append("[" + OpCodeNames[code[bp]]);
+        sb.append("[").append(OpCodeNames[code[bp]]);
         int argType = OpCodeArgTypes[code[bp]];
         int ip = bp;
         if (argType != Arguments.SPECIAL) {
@@ -319,32 +257,32 @@
                 break;
 
             case Arguments.RELADDR:
-                sb.append(":(" + code[bp] + ")");
+                sb.append(":(").append(code[bp]).append(")");
                 bp += OPSize.RELADDR;
                 break;
 
             case Arguments.ABSADDR:
-                sb.append(":(" + code[bp] + ")");
+                sb.append(":(").append(code[bp]).append(")");
                 bp += OPSize.ABSADDR;
                 break;
 
             case Arguments.LENGTH:
-                sb.append(":" + code[bp]);
+                sb.append(":").append(code[bp]);
                 bp += OPSize.LENGTH;
                 break;
 
             case Arguments.MEMNUM:
-                sb.append(":" + code[bp]);
+                sb.append(":").append(code[bp]);
                 bp += OPSize.MEMNUM;
                 break;
 
             case Arguments.OPTION:
-                sb.append(":" + code[bp]);
+                sb.append(":").append(code[bp]);
                 bp += OPSize.OPTION;
                 break;
 
             case Arguments.STATE_CHECK:
-                sb.append(":" + code[bp]);
+                sb.append(":").append(code[bp]);
                 bp += OPSize.STATE_CHECK;
                 break;
             }
@@ -353,8 +291,6 @@
             case OPCode.EXACT1:
             case OPCode.ANYCHAR_STAR_PEEK_NEXT:
             case OPCode.ANYCHAR_ML_STAR_PEEK_NEXT:
-            case OPCode.ANYCHAR_STAR_PEEK_NEXT_SB:
-            case OPCode.ANYCHAR_ML_STAR_PEEK_NEXT_SB:
                 pString(sb, 1, bp++);
                 break;
 
@@ -386,44 +322,19 @@
                     bp += OPSize.INDEX;
                     idx = code[bp];
                     bp += OPSize.INDEX;
-                    pLenStringFromTemplate(sb, len, 1, templates[tm], idx);
+                    pLenStringFromTemplate(sb, len, templates[tm], idx);
                 } else {
-                    pLenString(sb, len, 1, bp);
+                    pLenString(sb, len, bp);
                     bp += len;
                 }
                 break;
 
-            case OPCode.EXACTMB2N1:
-                pString(sb, 2, bp);
-                bp += 2;
-                break;
-
-            case OPCode.EXACTMB2N2:
-                pString(sb, 4, bp);
-                bp += 4;
-                break;
-
-            case OPCode.EXACTMB2N3:
-                pString(sb, 6, bp);
-                bp += 6;
+            case OPCode.EXACT1_IC:
+                pString(sb, 1, bp);
+                bp++;
                 break;
 
-            case OPCode.EXACTMB2N:
-                len = code[bp];
-                bp += OPSize.LENGTH;
-                if (Config.USE_STRING_TEMPLATES) {
-                    tm = code[bp];
-                    bp += OPSize.INDEX;
-                    idx = code[bp];
-                    bp += OPSize.INDEX;
-                    pLenStringFromTemplate(sb, len, 2, templates[tm], idx);
-                } else {
-                    pLenString(sb, len, 2, bp);
-                    bp += len * 2;
-                }
-                break;
-
-            case OPCode.EXACTMB3N:
+            case OPCode.EXACTN_IC:
                 len = code[bp];
                 bp += OPSize.LENGTH;
                 if (Config.USE_STRING_TEMPLATES) {
@@ -431,77 +342,27 @@
                     bp += OPSize.INDEX;
                     idx = code[bp];
                     bp += OPSize.INDEX;
-                    pLenStringFromTemplate(sb, len, 3, templates[tm], idx);
-                } else {
-                    pLenString(sb, len, 3, bp);
-                    bp += len * 3;
-                }
-                break;
-
-            case OPCode.EXACTMBN:
-                int mbLen = code[bp];
-                bp += OPSize.LENGTH;
-                len = code[bp];
-                bp += OPSize.LENGTH;
-                n = len * mbLen;
-
-                if (Config.USE_STRING_TEMPLATES) {
-                    tm = code[bp];
-                    bp += OPSize.INDEX;
-                    idx = code[bp];
-                    bp += OPSize.INDEX;
-                    sb.append(":T:" + mbLen + ":" + len + ":");
-
-                    while (n-- > 0) sb.append(new String(new char[]{templates[tm][idx++]}));
+                    pLenStringFromTemplate(sb, len, templates[tm], idx);
                 } else {
-                    sb.append(":" + mbLen + ":" + len + ":");
-
-                    while (n-- > 0) sb.append(new String(new byte[]{(byte)code[bp++]}));
-                }
-
-                break;
-
-            case OPCode.EXACT1_IC:
-            case OPCode.EXACT1_IC_SB:
-                final int MAX_CHAR_LENGTH = 6;
-                byte[]bytes = new byte[MAX_CHAR_LENGTH];
-                for (int i = 0; bp + i < code.length && i < MAX_CHAR_LENGTH; i++) bytes[i] = (byte)code[bp + i];
-                pString(sb, 1, bp);
-                bp++;
-                break;
-
-            case OPCode.EXACTN_IC:
-            case OPCode.EXACTN_IC_SB:
-                len = code[bp];
-                bp += OPSize.LENGTH;
-                if (Config.USE_STRING_TEMPLATES) {
-                    tm = code[bp];
-                    bp += OPSize.INDEX;
-                    idx = code[bp];
-                    bp += OPSize.INDEX;
-                    pLenStringFromTemplate(sb, len, 1, templates[tm], idx);
-                } else {
-                    pLenString(sb, len, 1, bp);
+                    pLenString(sb, len, bp);
                     bp += len;
                 }
                 break;
 
             case OPCode.CCLASS:
-            case OPCode.CCLASS_SB:
                 bs = new BitSet();
                 System.arraycopy(code, bp, bs.bits, 0, BitSet.BITSET_SIZE);
                 n = bs.numOn();
                 bp += BitSet.BITSET_SIZE;
-                sb.append(":" + n);
+                sb.append(":").append(n);
                 break;
 
             case OPCode.CCLASS_NOT:
-            case OPCode.CCLASS_NOT_SB:
                 bs = new BitSet();
                 System.arraycopy(code, bp, bs.bits, 0, BitSet.BITSET_SIZE);
                 n = bs.numOn();
                 bp += BitSet.BITSET_SIZE;
-                sb.append(":" + n);
+                sb.append(":").append(n);
                 break;
 
             case OPCode.CCLASS_MB:
@@ -511,7 +372,7 @@
                 cod = code[bp];
                 //bp += OPSize.CODE_POINT;
                 bp += len;
-                sb.append(":" + cod + ":" + len);
+                sb.append(":").append(cod).append(":").append(len);
                 break;
 
             case OPCode.CCLASS_MIX:
@@ -525,20 +386,20 @@
                 cod = code[bp];
                 //bp += OPSize.CODE_POINT;
                 bp += len;
-                sb.append(":" + n + ":" + cod + ":" + len);
+                sb.append(":").append(n).append(":").append(cod).append(":").append(len);
                 break;
 
             case OPCode.CCLASS_NODE:
                 cc = (CClassNode)operands[code[bp]];
                 bp += OPSize.POINTER;
                 n = cc.bs.numOn();
-                sb.append(":" + cc + ":" + n);
+                sb.append(":").append(cc).append(":").append(n);
                 break;
 
             case OPCode.BACKREFN_IC:
                 mem = code[bp];
                 bp += OPSize.MEMNUM;
-                sb.append(":" + mem);
+                sb.append(":").append(mem);
                 break;
 
             case OPCode.BACKREF_MULTI_IC:
@@ -557,10 +418,10 @@
             case OPCode.BACKREF_WITH_LEVEL: {
                 int option = code[bp];
                 bp += OPSize.OPTION;
-                sb.append(":" + option);
+                sb.append(":").append(option);
                 int level = code[bp];
                 bp += OPSize.LENGTH;
-                sb.append(":" + level);
+                sb.append(":").append(level);
                 sb.append(" ");
                 len = code[bp];
                 bp += OPSize.LENGTH;
@@ -579,23 +440,22 @@
                 bp += OPSize.MEMNUM;
                 addr = code[bp];
                 bp += OPSize.RELADDR;
-                sb.append(":" + mem + ":" + addr);
+                sb.append(":").append(mem).append(":").append(addr);
                 break;
 
             case OPCode.PUSH_OR_JUMP_EXACT1:
             case OPCode.PUSH_IF_PEEK_NEXT:
                 addr = code[bp];
                 bp += OPSize.RELADDR;
-                sb.append(":(" + addr + ")");
+                sb.append(":(").append(addr).append(")");
                 pString(sb, 1, bp);
                 bp++;
                 break;
 
             case OPCode.LOOK_BEHIND:
-            case OPCode.LOOK_BEHIND_SB:
                 len = code[bp];
                 bp += OPSize.LENGTH;
-                sb.append(":" + len);
+                sb.append(":").append(len);
                 break;
 
             case OPCode.PUSH_LOOK_BEHIND_NOT:
@@ -603,7 +463,7 @@
                 bp += OPSize.RELADDR;
                 len = code[bp];
                 bp += OPSize.LENGTH;
-                sb.append(":" + len + ":(" + addr + ")");
+                sb.append(":").append(len).append(":(").append(addr).append(")");
                 break;
 
             case OPCode.STATE_CHECK_PUSH:
@@ -612,7 +472,7 @@
                 bp += OPSize.STATE_CHECK_NUM;
                 addr = code[bp];
                 bp += OPSize.RELADDR;
-                sb.append(":" + scn + ":(" + addr + ")");
+                sb.append(":").append(scn).append(":(").append(addr).append(")");
                 break;
 
             default:
@@ -623,14 +483,16 @@
         sb.append("]");
 
         // @opcode_address(opcode_size)
-        if (Config.DEBUG_COMPILE_BYTE_CODE_INFO) sb.append("@" + ip + "(" + (bp - ip) + ")");
+        if (Config.DEBUG_COMPILE_BYTE_CODE_INFO) {
+            sb.append("@").append(ip).append("(").append((bp - ip)).append(")");
+        }
 
         return bp;
     }
 
     private String compiledByteCodeListToString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("code length: " + codeLength + "\n");
+        sb.append("code length: ").append(codeLength).append("\n");
 
         int ncode = 0;
         int bp = 0;
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -22,25 +22,34 @@
 import jdk.nashorn.internal.runtime.regexp.joni.exception.ErrorMessages;
 import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
 
-public final class CodeRangeBuffer {
+public final class CodeRangeBuffer implements Cloneable {
     private static final int INIT_MULTI_BYTE_RANGE_SIZE = 5;
     private static final int ALL_MULTI_BYTE_RANGE = 0x7fffffff;
 
-    int[]p;
+    int[] p;
     int used;
 
-    public CodeRangeBuffer(int[]ranges) {
-        p = ranges;
-        used = ranges[0] + 1;
-    }
 
     public CodeRangeBuffer() {
         p = new int[INIT_MULTI_BYTE_RANGE_SIZE];
         writeCodePoint(0, 0);
     }
 
-    public int[]getCodeRange() {
-        return p;
+    // CodeRange.isInCodeRange
+    public boolean isInCodeRange(int code) {
+        int low = 0;
+        int n = p[0];
+        int high = n;
+
+        while (low < high) {
+            int x = (low + high) >> 1;
+            if (code > p[(x << 1) + 2]) {
+                low = x + 1;
+            } else {
+                high = x;
+            }
+        }
+        return low < n && code >= p[(low << 1) + 1];
     }
 
     private CodeRangeBuffer(CodeRangeBuffer orig) {
@@ -52,12 +61,12 @@
     public String toString() {
         StringBuilder buf = new StringBuilder();
         buf.append("CodeRange");
-        buf.append("\n  used: " + used);
-        buf.append("\n  code point: " + p[0]);
+        buf.append("\n  used: ").append(used);
+        buf.append("\n  code point: ").append(p[0]);
         buf.append("\n  ranges: ");
 
         for (int i=0; i<p[0]; i++) {
-            buf.append("[" + rangeNumToString(p[i * 2 + 1]) + ".." + rangeNumToString(p[i * 2 + 2]) + "]");
+            buf.append("[").append(rangeNumToString(p[i * 2 + 1])).append("..").append(rangeNumToString(p[i * 2 + 2])).append("]");
             if (i > 0 && i % 6 == 0) buf.append("\n          ");
         }
 
@@ -108,6 +117,7 @@
         if (used < u) used = u;
     }
 
+    @Override
     public CodeRangeBuffer clone() {
         return new CodeRangeBuffer(this);
     }
@@ -183,7 +193,7 @@
 
     // add_code_range, be aware of it returning null!
     public static CodeRangeBuffer addCodeRange(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to) {
-        if (from >to) {
+        if (from > to) {
             if (env.syntax.allowEmptyRangeInCC()) {
                 return pbuf;
             } else {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java	Fri Jul 26 14:07:32 2013 -0700
@@ -132,23 +132,6 @@
         }
     }
 
-    // CodeRange.isInCodeRange
-    public static boolean isInCodeRange(int[]p, int code) {
-        int low = 0;
-        int n = p[0];
-        int high = n;
-
-        while (low < high) {
-            int x = (low + high) >> 1;
-            if (code > p[(x << 1) + 2]) {
-                low = x + 1;
-            } else {
-                high = x;
-            }
-        }
-        return low < n && code >= p[(low << 1) + 1];
-    }
-
     public static int[] ctypeCodeRange(int ctype, IntHolder sbOut) {
         sbOut.value = 0x100; // use bitset for codes smaller than 256
         int[] range = null;
@@ -188,7 +171,7 @@
     }
 
     // CodeRange.isInCodeRange
-    public static boolean isInCodeRange(int[]p, int offset, int code) {
+    public static boolean isInCodeRange(int[] p, int offset, int code) {
         int low = 0;
         int n = p[offset];
         int high = n ;
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java	Fri Jul 26 14:07:32 2013 -0700
@@ -28,6 +28,8 @@
 import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType;
 import jdk.nashorn.internal.runtime.regexp.joni.encoding.CharacterType;
 import jdk.nashorn.internal.runtime.regexp.joni.exception.ErrorMessages;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
 
 class Lexer extends ScannerSupport {
     protected final ScanEnvironment env;
@@ -52,20 +54,24 @@
             if (synAllow) {
                 return 1; /* "....{" : OK! */
             } else {
-                newSyntaxException(ERR_END_PATTERN_AT_LEFT_BRACE);
+                throw new SyntaxException(ERR_END_PATTERN_AT_LEFT_BRACE);
             }
         }
 
         if (!synAllow) {
             c = peek();
             if (c == ')' || c == '(' || c == '|') {
-                newSyntaxException(ERR_END_PATTERN_AT_LEFT_BRACE);
+                throw new SyntaxException(ERR_END_PATTERN_AT_LEFT_BRACE);
             }
         }
 
         int low = scanUnsignedNumber();
-        if (low < 0) newSyntaxException(ErrorMessages.ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
-        if (low > Config.MAX_REPEAT_NUM) newSyntaxException(ErrorMessages.ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
+        if (low < 0) {
+            throw new SyntaxException(ErrorMessages.ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
+        }
+        if (low > Config.MAX_REPEAT_NUM) {
+            throw new SyntaxException(ErrorMessages.ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
+        }
 
         boolean nonLow = false;
         if (p == _p) { /* can't read low */
@@ -85,8 +91,12 @@
         if (c == ',') {
             int prev = p; // ??? last
             up = scanUnsignedNumber();
-            if (up < 0) newValueException(ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
-            if (up > Config.MAX_REPEAT_NUM) newValueException(ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
+            if (up < 0) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
+            }
+            if (up > Config.MAX_REPEAT_NUM) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE);
+            }
 
             if (p == prev) {
                 if (nonLow) return invalidRangeQuantifier(synAllow);
@@ -110,7 +120,7 @@
         if (c != '}') return invalidRangeQuantifier(synAllow);
 
         if (!isRepeatInfinite(up) && low > up) {
-            newValueException(ERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE);
+            throw new ValueException(ERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE);
         }
 
         token.type = TokenType.INTERVAL;
@@ -125,24 +135,31 @@
             restore();
             return 1;
         } else {
-            newSyntaxException(ERR_INVALID_REPEAT_RANGE_PATTERN);
-            return 0; // not reached
+            throw new SyntaxException(ERR_INVALID_REPEAT_RANGE_PATTERN);
         }
     }
 
     /* \M-, \C-, \c, or \... */
     private int fetchEscapedValue() {
-        if (!left()) newSyntaxException(ERR_END_PATTERN_AT_ESCAPE);
+        if (!left()) {
+            throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
+        }
         fetch();
 
         switch(c) {
 
         case 'M':
             if (syntax.op2EscCapitalMBarMeta()) {
-                if (!left()) newSyntaxException(ERR_END_PATTERN_AT_META);
+                if (!left()) {
+                    throw new SyntaxException(ERR_END_PATTERN_AT_META);
+                }
                 fetch();
-                if (c != '-') newSyntaxException(ERR_META_CODE_SYNTAX);
-                if (!left()) newSyntaxException(ERR_END_PATTERN_AT_META);
+                if (c != '-') {
+                    throw new SyntaxException(ERR_META_CODE_SYNTAX);
+                }
+                if (!left()) {
+                    throw new SyntaxException(ERR_END_PATTERN_AT_META);
+                }
                 fetch();
                 if (c == syntax.metaCharTable.esc) {
                     c = fetchEscapedValue();
@@ -155,9 +172,13 @@
 
         case 'C':
             if (syntax.op2EscCapitalCBarControl()) {
-                if (!left()) newSyntaxException(ERR_END_PATTERN_AT_CONTROL);
+                if (!left()) {
+                    throw new SyntaxException(ERR_END_PATTERN_AT_CONTROL);
+                }
                 fetch();
-                if (c != '-') newSyntaxException(ERR_CONTROL_CODE_SYNTAX);
+                if (c != '-') {
+                    throw new SyntaxException(ERR_CONTROL_CODE_SYNTAX);
+                }
                 fetchEscapedValueControl();
             } else {
                 fetchEscapedValueBackSlash();
@@ -182,7 +203,9 @@
     }
 
     private void fetchEscapedValueControl() {
-        if (!left()) newSyntaxException(ERR_END_PATTERN_AT_CONTROL);
+        if (!left()) {
+            throw new SyntaxException(ERR_END_PATTERN_AT_CONTROL);
+        }
         fetch();
         if (c == '?') {
             c = 0177;
@@ -205,115 +228,6 @@
         }
     }
 
-    // USE_NAMED_GROUP && USE_BACKREF_AT_LEVEL
-    /*
-        \k<name+n>, \k<name-n>
-        \k<num+n>,  \k<num-n>
-        \k<-num+n>, \k<-num-n>
-     */
-
-    // #else USE_NAMED_GROUP
-    // make it return nameEnd!
-    private final int fetchNameForNoNamedGroup(int startCode, boolean ref) {
-        int src = p;
-        value = 0;
-
-        int isNum = 0;
-        int sign = 1;
-
-        int endCode = nameEndCodePoint(startCode);
-        int pnumHead = p;
-        int nameEnd = stop;
-
-        String err = null;
-        if (!left()) {
-            newValueException(ERR_EMPTY_GROUP_NAME);
-        } else {
-            fetch();
-            if (c == endCode) newValueException(ERR_EMPTY_GROUP_NAME);
-
-            if (EncodingHelper.isDigit(c)) {
-                isNum = 1;
-            } else if (c == '-') {
-                isNum = 2;
-                sign = -1;
-                pnumHead = p;
-            } else {
-                err = ERR_INVALID_CHAR_IN_GROUP_NAME;
-            }
-        }
-
-        while(left()) {
-            nameEnd = p;
-
-            fetch();
-            if (c == endCode || c == ')') break;
-            if (!EncodingHelper.isDigit(c)) err = ERR_INVALID_CHAR_IN_GROUP_NAME;
-        }
-
-        if (err == null && c != endCode) {
-            err = ERR_INVALID_GROUP_NAME;
-            nameEnd = stop;
-        }
-
-        if (err == null) {
-            mark();
-            p = pnumHead;
-            int backNum = scanUnsignedNumber();
-            restore();
-            if (backNum < 0) {
-                newValueException(ERR_TOO_BIG_NUMBER);
-            } else if (backNum == 0){
-                newValueException(ERR_INVALID_GROUP_NAME, src, nameEnd);
-            }
-            backNum *= sign;
-
-            value = nameEnd;
-            return backNum;
-        } else {
-            newValueException(err, src, nameEnd);
-            return 0; // not reached
-        }
-    }
-
-    protected final int fetchName(int startCode, boolean ref) {
-        return fetchNameForNoNamedGroup(startCode, ref);
-    }
-
-    private boolean strExistCheckWithEsc(int[]s, int n, int bad) {
-        int p = this.p;
-        int to = this.stop;
-
-        boolean inEsc = false;
-        int i=0;
-        while(p < to) {
-            if (inEsc) {
-                inEsc = false;
-                p ++;
-            } else {
-                int x = chars[p];
-                int q = p + 1;
-                if (x == s[0]) {
-                    for (i=1; i<n && q < to; i++) {
-                        x = chars[q];
-                        if (x != s[i]) break;
-                        q++;
-                    }
-                    if (i >= n) return true;
-                    p++;
-                } else {
-                    x = chars[p];
-                    if (x == bad) return false;
-                    else if (x == syntax.metaCharTable.esc) inEsc = true;
-                    p = q;
-                }
-            }
-        }
-        return false;
-    }
-
-    private static final int send[] = new int[]{':', ']'};
-
     private void fetchTokenInCCFor_charType(boolean flag, int type) {
         token.type = TokenType.CHAR_TYPE;
         token.setPropCType(type);
@@ -327,16 +241,19 @@
         if (peekIs('{') && syntax.opEscXBraceHex8()) {
             inc();
             int num = scanUnsignedHexadecimalNumber(8);
-            if (num < 0) newValueException(ERR_TOO_BIG_WIDE_CHAR_VALUE);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_WIDE_CHAR_VALUE);
+            }
             if (left()) {
                 int c2 = peek();
-                if (EncodingHelper.isXDigit(c2)) newValueException(ERR_TOO_LONG_WIDE_CHAR_VALUE);
+                if (EncodingHelper.isXDigit(c2)) {
+                    throw new ValueException(ERR_TOO_LONG_WIDE_CHAR_VALUE);
+                }
             }
 
             if (p > last + 1 && left() && peekIs('}')) {
                 inc();
                 token.type = TokenType.CODE_POINT;
-                token.base = 16;
                 token.setCode(num);
             } else {
                 /* can't read nothing or invalid format */
@@ -344,12 +261,13 @@
             }
         } else if (syntax.opEscXHex2()) {
             int num = scanUnsignedHexadecimalNumber(2);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER);
+            }
             if (p == last) { /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
             token.type = TokenType.RAW_BYTE;
-            token.base = 16;
             token.setC(num);
         }
     }
@@ -360,12 +278,13 @@
 
         if (syntax.op2EscUHex4()) {
             int num = scanUnsignedHexadecimalNumber(4);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER);
+            }
             if (p == last) {  /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
             token.type = TokenType.CODE_POINT;
-            token.base = 16;
             token.setCode(num);
         }
     }
@@ -375,12 +294,13 @@
             unfetch();
             int last = p;
             int num = scanUnsignedOctalNumber(3);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER);
+            }
             if (p == last) {  /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
             token.type = TokenType.RAW_BYTE;
-            token.base = 8;
             token.setC(num);
         }
     }
@@ -400,7 +320,6 @@
 
         fetch();
         token.type = TokenType.CHAR;
-        token.base = 0;
         token.setC(c);
         token.escaped = false;
 
@@ -410,7 +329,9 @@
             token.type = TokenType.CC_RANGE;
         } else if (c == syntax.metaCharTable.esc) {
             if (!syntax.backSlashEscapeInCC()) return token.type;
-            if (!left()) newSyntaxException(ERR_END_PATTERN_AT_ESCAPE);
+            if (!left()) {
+                throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
+            }
             fetch();
             token.escaped = true;
             token.setC(c);
@@ -508,9 +429,13 @@
         if (peekIs('{') && syntax.opEscXBraceHex8()) {
             inc();
             int num = scanUnsignedHexadecimalNumber(8);
-            if (num < 0) newValueException(ERR_TOO_BIG_WIDE_CHAR_VALUE);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_WIDE_CHAR_VALUE);
+            }
             if (left()) {
-                if (EncodingHelper.isXDigit(peek())) newValueException(ERR_TOO_LONG_WIDE_CHAR_VALUE);
+                if (EncodingHelper.isXDigit(peek())) {
+                    throw new ValueException(ERR_TOO_LONG_WIDE_CHAR_VALUE);
+                }
             }
 
             if (p > last + 1 && left() && peekIs('}')) {
@@ -523,12 +448,13 @@
             }
         } else if (syntax.opEscXHex2()) {
             int num = scanUnsignedHexadecimalNumber(2);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER);
+            }
             if (p == last) { /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
             token.type = TokenType.RAW_BYTE;
-            token.base = 16;
             token.setC(num);
         }
     }
@@ -539,12 +465,13 @@
 
         if (syntax.op2EscUHex4()) {
             int num = scanUnsignedHexadecimalNumber(4);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER);
+            }
             if (p == last) { /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
             token.type = TokenType.CODE_POINT;
-            token.base = 16;
             token.setCode(num);
         }
     }
@@ -556,12 +483,12 @@
         if (num < 0 || num > Config.MAX_BACKREF_NUM) { // goto skip_backref
         } else if (syntax.opDecimalBackref() && (num <= env.numMem || num <= 9)) { /* This spec. from GNU regex */
             if (syntax.strictCheckBackref()) {
-                if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) newValueException(ERR_INVALID_BACKREF);
+                if (num > env.numMem || env.memNodes == null || env.memNodes[num] == null) {
+                    throw new ValueException(ERR_INVALID_BACKREF);
+                }
             }
             token.type = TokenType.BACKREF;
-            token.setBackrefNum(1);
-            token.setBackrefRef1(num);
-            token.setBackrefByName(false);
+            token.setBackrefRef(num);
             return;
         }
 
@@ -579,40 +506,19 @@
         if (syntax.opEscOctal3()) {
             int last = p;
             int num = scanUnsignedOctalNumber(c == '0' ? 2 : 3);
-            if (num < 0) newValueException(ERR_TOO_BIG_NUMBER);
+            if (num < 0) {
+                throw new ValueException(ERR_TOO_BIG_NUMBER);
+            }
             if (p == last) { /* can't read nothing. */
                 num = 0; /* but, it's not error */
             }
             token.type = TokenType.RAW_BYTE;
-            token.base = 8;
             token.setC(num);
         } else if (c != '0') {
             inc();
         }
     }
 
-    private void fetchTokenFor_subexpCall() {
-        if (syntax.op2EscGSubexpCall()) {
-            if (left()) {
-                fetch();
-                if (c == '<' || c == '\'') {
-                    int last = p;
-                    int gNum = fetchName(c, true);
-                    int nameEnd = value;
-                    token.type = TokenType.CALL;
-                    token.setCallNameP(last);
-                    token.setCallNameEnd(nameEnd);
-                    token.setCallGNum(gNum);
-                } else {
-                    unfetch();
-                    syntaxWarn(Warnings.INVALID_SUBEXP_CALL);
-                }
-            } else {
-                syntaxWarn(Warnings.INVALID_SUBEXP_CALL);
-            }
-        }
-    }
-
     private void fetchTokenFor_metaChars() {
         if (c == syntax.metaCharTable.anyChar) {
             token.type = TokenType.ANYCHAR;
@@ -638,13 +544,14 @@
             }
 
             token.type = TokenType.STRING;
-            token.base = 0;
             token.backP = p;
 
             fetch();
 
             if (c == syntax.metaCharTable.esc && !syntax.op2IneffectiveEscape()) { // IS_MC_ESC_CODE(code, syn)
-                if (!left()) newSyntaxException(ERR_END_PATTERN_AT_ESCAPE);
+                if (!left()) {
+                    throw new SyntaxException(ERR_END_PATTERN_AT_ESCAPE);
+                }
 
                 token.backP = p;
                 fetch();
@@ -800,7 +707,9 @@
                             if (peekIs('#')) {
                                 fetch();
                                 while (true) {
-                                    if (!left()) newSyntaxException(ERR_END_PATTERN_IN_GROUP);
+                                    if (!left()) {
+                                        throw new SyntaxException(ERR_END_PATTERN_IN_GROUP);
+                                    }
                                     fetch();
                                     if (c == syntax.metaCharTable.esc) {
                                         if (left()) fetch();
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java	Fri Jul 26 14:07:32 2013 -0700
@@ -40,6 +40,9 @@
 import jdk.nashorn.internal.runtime.regexp.joni.constants.NodeType;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.TokenType;
 import jdk.nashorn.internal.runtime.regexp.joni.encoding.CharacterType;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.InternalException;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException;
+import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
 
 class Parser extends Lexer {
 
@@ -94,7 +97,9 @@
         }
 
         if (token.type == TokenType.CC_CLOSE) {
-            if (!codeExistCheck(']', true)) newSyntaxException(ERR_EMPTY_CHAR_CLASS);
+            if (!codeExistCheck(']', true)) {
+                throw new SyntaxException(ERR_EMPTY_CHAR_CLASS);
+            }
             env.ccEscWarn("]");
             token.type = TokenType.CHAR; /* allow []...] */
         }
@@ -125,32 +130,8 @@
                 break;
 
             case RAW_BYTE:
-                if (token.base != 0) { /* tok->base != 0 : octal or hexadec. */
-                    byte[] buf = new byte[4];
-                    int psave = p;
-                    int base = token.base;
-                    buf[0] = (byte)token.getC();
-                    int i;
-                    for (i=1; i<4; i++) {
-                        fetchTokenInCC();
-                        if (token.type != TokenType.RAW_BYTE || token.base != base) {
-                            fetched = true;
-                            break;
-                        }
-                        buf[i] = (byte)token.getC();
-                    }
-
-                    if (i == 1) {
-                        arg.v = buf[0] & 0xff;
-                        arg.inType = CCVALTYPE.SB; // goto raw_single
-                    } else {
-                        arg.v = EncodingHelper.mbcToCode(buf, 0, buf.length);
-                        arg.inType = CCVALTYPE.CODE_POINT;
-                    }
-                } else {
-                    arg.v = token.getC();
-                    arg.inType = CCVALTYPE.SB; // raw_single:
-                }
+                arg.v = token.getC();
+                arg.inType = CCVALTYPE.SB; // raw_single:
                 arg.vIsRaw = true;
                 parseCharClassValEntry2(cc, arg); // goto val_entry2
                 break;
@@ -211,7 +192,7 @@
                         parseCharClassValEntry2(cc, arg); // goto val_entry2 /* [0-9-a] is allowed as [0-9\-a] */
                         break;
                     }
-                    newSyntaxException(ERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS);
+                    throw new SyntaxException(ERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS);
                 }
                 break;
 
@@ -240,10 +221,10 @@
                 break;
 
             case EOT:
-                newSyntaxException(ERR_PREMATURE_END_OF_CHAR_CLASS);
+                throw new SyntaxException(ERR_PREMATURE_END_OF_CHAR_CLASS);
 
             default:
-                newInternalException(ERR_PARSER_BUG);
+                throw new InternalException(ERR_PARSER_BUG);
             } // switch
 
             if (!fetched) fetchTokenInCC();
@@ -304,13 +285,17 @@
     private Node parseEnclose(TokenType term) {
         Node node = null;
 
-        if (!left()) newSyntaxException(ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
+        if (!left()) {
+            throw new SyntaxException(ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
+        }
 
         int option = env.option;
 
         if (peekIs('?') && syntax.op2QMarkGroupEffect()) {
             inc();
-            if (!left()) newSyntaxException(ERR_END_PATTERN_IN_GROUP);
+            if (!left()) {
+                throw new SyntaxException(ERR_END_PATTERN_IN_GROUP);
+            }
 
             boolean listCapture = false;
 
@@ -339,18 +324,20 @@
                 } else if (c == '!') {
                     node = new AnchorNode(AnchorType.LOOK_BEHIND_NOT);
                 } else {
-                    newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+                    throw new SyntaxException(ERR_UNDEFINED_GROUP_OPTION);
                 }
                 break;
             case '@':
                 if (syntax.op2AtMarkCaptureHistory()) {
                     EncloseNode en = new EncloseNode(); // node_new_enclose_memory
                     int num = env.addMemEntry();
-                    if (num >= BitStatus.BIT_STATUS_BITS_NUM) newValueException(ERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY);
+                    if (num >= BitStatus.BIT_STATUS_BITS_NUM) {
+                        throw new ValueException(ERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY);
+                    }
                     en.regNum = num;
                     node = en;
                 } else {
-                    newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+                    throw new SyntaxException(ERR_UNDEFINED_GROUP_OPTION);
                 }
                 break;
 
@@ -379,7 +366,7 @@
                         if (syntax.op2OptionPerl()) {
                             option = bsOnOff(option, Option.MULTILINE, neg);
                         } else {
-                            newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+                            throw new SyntaxException(ERR_UNDEFINED_GROUP_OPTION);
                         }
                         break;
                     case 'm':
@@ -388,7 +375,7 @@
                         } else if (syntax.op2OptionRuby()) {
                             option = bsOnOff(option, Option.MULTILINE, neg);
                         } else {
-                            newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+                            throw new SyntaxException(ERR_UNDEFINED_GROUP_OPTION);
                         }
                         break;
                     // case 'p': #ifdef USE_POSIXLINE_OPTION // not defined
@@ -396,7 +383,7 @@
                     // break;
 
                     default:
-                        newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+                        throw new SyntaxException(ERR_UNDEFINED_GROUP_OPTION);
                     } // switch
 
                     if (c == ')') {
@@ -416,12 +403,14 @@
                         returnCode = 0;
                         return node;
                     }
-                    if (!left()) newSyntaxException(ERR_END_PATTERN_IN_GROUP);
+                    if (!left()) {
+                        throw new SyntaxException(ERR_END_PATTERN_IN_GROUP);
+                    }
                     fetch();
                 } // while
 
             default:
-                newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+                throw new SyntaxException(ERR_UNDEFINED_GROUP_OPTION);
             } // switch
 
         } else {
@@ -482,7 +471,9 @@
             }
             break;
         case SUBEXP_CLOSE:
-            if (!syntax.allowUnmatchedCloseSubexp()) newSyntaxException(ERR_UNMATCHED_CLOSE_PARENTHESIS);
+            if (!syntax.allowUnmatchedCloseSubexp()) {
+                throw new SyntaxException(ERR_UNMATCHED_CLOSE_PARENTHESIS);
+            }
             if (token.escaped) {
                 return parseExpTkRawByte(group); // goto tk_raw_byte
             } else {
@@ -523,7 +514,7 @@
                 break;
 
             default:
-                newInternalException(ERR_PARSER_BUG);
+                throw new InternalException(ERR_PARSER_BUG);
 
             } // inner switch
             break;
@@ -553,13 +544,8 @@
             break;
 
         case BACKREF:
-            int[]backRefs = token.getBackrefNum() > 1 ? token.getBackrefRefs() : new int[]{token.getBackrefRef1()};
-            node = new BackRefNode(token.getBackrefNum(),
-                            backRefs,
-                            token.getBackrefByName(),
-                            token.getBackrefExistLevel(), // #ifdef USE_BACKREF_AT_LEVEL
-                            token.getBackrefLevel(),      // ...
-                            env);
+            int backRef = token.getBackrefRef();
+            node = new BackRefNode(backRef, env);
             break;
 
         case ANCHOR:
@@ -570,7 +556,7 @@
         case INTERVAL:
             if (syntax.contextIndepRepeatOps()) {
                 if (syntax.contextInvalidRepeatOps()) {
-                    newSyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED);
+                    throw new SyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED);
                 } else {
                     node = StringNode.EMPTY; // node_new_empty
                 }
@@ -580,7 +566,7 @@
             break;
 
         default:
-            newInternalException(ERR_PARSER_BUG);
+            throw new InternalException(ERR_PARSER_BUG);
         } //switch
 
         //targetp = node;
@@ -615,36 +601,17 @@
         StringNode node = new StringNode((char)token.getC());
         node.setRaw();
 
-        int len = 1;
-        while (true) {
-            if (len >= 1) {
-                if (len == 1) {
-                    fetchToken();
-                    node.clearRaw();
-                    // !goto string_end;!
-                    return parseExpRepeat(node, group);
-                }
-            }
-
-            fetchToken();
-            if (token.type != TokenType.RAW_BYTE) {
-                /* Don't use this, it is wrong for little endian encodings. */
-                // USE_PAD_TO_SHORT_BYTE_CHAR ...
-
-                newValueException(ERR_TOO_SHORT_MULTI_BYTE_STRING);
-            }
-
-            // important: we don't use 0xff mask here neither in the compiler
-            // (in the template string) so we won't have to mask target
-            // strings when comparing against them in the matcher
-            node.cat((char)token.getC());
-            len++;
-        } // while
+        fetchToken();
+        node.clearRaw();
+        // !goto string_end;!
+        return parseExpRepeat(node, group);
     }
 
     private Node parseExpRepeat(Node target, boolean group) {
         while (token.type == TokenType.OP_REPEAT || token.type == TokenType.INTERVAL) { // repeat:
-            if (target.isInvalidQuantifier()) newSyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_INVALID);
+            if (target.isInvalidQuantifier()) {
+                throw new SyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_INVALID);
+            }
 
             QuantifierNode qtfr = new QuantifierNode(token.getRepeatLower(),
                                                      token.getRepeatUpper(),
@@ -676,7 +643,9 @@
 
     private Node parseExpRepeatForCar(Node top, ConsAltNode target, boolean group) {
         while (token.type == TokenType.OP_REPEAT || token.type == TokenType.INTERVAL) { // repeat:
-            if (target.car.isInvalidQuantifier()) newSyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_INVALID);
+            if (target.car.isInvalidQuantifier()) {
+                throw new SyntaxException(ERR_TARGET_OF_REPEAT_OPERATOR_INVALID);
+            }
 
             QuantifierNode qtfr = new QuantifierNode(token.getRepeatLower(),
                                                      token.getRepeatUpper(),
@@ -754,9 +723,9 @@
 
     private void parseSubExpError(TokenType term) {
         if (term == TokenType.SUBEXP_CLOSE) {
-            newSyntaxException(ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
+            throw new SyntaxException(ERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
         } else {
-            newInternalException(ERR_PARSER_BUG);
+            throw new InternalException(ERR_PARSER_BUG);
         }
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Regex.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Regex.java	Fri Jul 26 14:07:32 2013 -0700
@@ -19,19 +19,9 @@
  */
 package jdk.nashorn.internal.runtime.regexp.joni;
 
-import static jdk.nashorn.internal.runtime.regexp.joni.BitStatus.bsAt;
-import static jdk.nashorn.internal.runtime.regexp.joni.Option.isCaptureGroup;
-import static jdk.nashorn.internal.runtime.regexp.joni.Option.isDontCaptureGroup;
-
-import java.nio.file.Files;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import jdk.nashorn.internal.runtime.regexp.joni.ast.Node;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.AnchorType;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.RegexState;
 import jdk.nashorn.internal.runtime.regexp.joni.exception.ErrorMessages;
-import jdk.nashorn.internal.runtime.regexp.joni.exception.InternalException;
 import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
 
 public final class Regex implements RegexState {
@@ -39,31 +29,26 @@
     int[] code;             /* compiled pattern */
     int codeLength;
     boolean stackNeeded;
-    Object[]operands;       /* e.g. shared CClassNode */
+    Object[] operands;       /* e.g. shared CClassNode */
     int operandLength;
 
-    int state;              /* normal, searching, compiling */ // remove
     int numMem;             /* used memory(...) num counted from 1 */
     int numRepeat;          /* OP_REPEAT/OP_REPEAT_NG id-counter */
     int numNullCheck;       /* OP_NULL_CHECK_START/END id counter */
-    int numCall;            /* number of subexp call */
     int captureHistory;     /* (?@...) flag (1-31) */
     int btMemStart;         /* need backtrack flag */
     int btMemEnd;           /* need backtrack flag */
 
     int stackPopLevel;
 
-    int[]repeatRangeLo;
-    int[]repeatRangeHi;
+    int[] repeatRangeLo;
+    int[] repeatRangeHi;
 
     WarnCallback warnings;
     MatcherFactory factory;
     protected Analyser analyser;
 
     int options;
-    int userOptions;
-    Object userObject;
-    //final Syntax syntax;
     final int caseFoldFlag;
 
     /* optimization info (string search, char-map and anchors) */
@@ -247,46 +232,48 @@
     }
 
     public String optimizeInfoToString() {
-        String s = "";
-        s += "optimize: " + searchAlgorithm.getName() + "\n";
-        s += "  anchor:     " + OptAnchorInfo.anchorToString(anchor);
+        StringBuilder s = new StringBuilder();
+        s.append("optimize: ").append(searchAlgorithm.getName()).append("\n");
+        s.append("  anchor:     ").append(OptAnchorInfo.anchorToString(anchor));
 
         if ((anchor & AnchorType.END_BUF_MASK) != 0) {
-            s += MinMaxLen.distanceRangeToString(anchorDmin, anchorDmax);
+            s.append(MinMaxLen.distanceRangeToString(anchorDmin, anchorDmax));
         }
 
-        s += "\n";
+        s.append("\n");
 
         if (searchAlgorithm != SearchAlgorithm.NONE) {
-            s += "  sub anchor: " + OptAnchorInfo.anchorToString(subAnchor) + "\n";
+            s.append("  sub anchor: ").append(OptAnchorInfo.anchorToString(subAnchor)).append("\n");
         }
 
-        s += "dmin: " + dMin + " dmax: " + dMax + "\n";
-        s += "threshold length: " + thresholdLength + "\n";
+        s.append("dmin: ").append(dMin).append(" dmax: ").append(dMax).append("\n");
+        s.append("threshold length: ").append(thresholdLength).append("\n");
 
         if (exact != null) {
-            s += "exact: [" + new String(exact, exactP, exactEnd - exactP) + "]: length: " + (exactEnd - exactP) + "\n";
+            s.append("exact: [").append(exact, exactP, exactEnd - exactP).append("]: length: ").append(exactEnd - exactP).append("\n");
         } else if (searchAlgorithm == SearchAlgorithm.MAP) {
             int n=0;
             for (int i=0; i<Config.CHAR_TABLE_SIZE; i++) if (map[i] != 0) n++;
 
-            s += "map: n = " + n + "\n";
+            s.append("map: n = ").append(n).append("\n");
             if (n > 0) {
                 int c=0;
-                s += "[";
+                s.append("[");
                 for (int i=0; i<Config.CHAR_TABLE_SIZE; i++) {
                     if (map[i] != 0) {
-                        if (c > 0) s += ", ";
+                        if (c > 0) {
+                            s.append(", ");
+                        }
                         c++;
                         // TODO if (enc.isPrint(i)
-                        s += ((char)i);
+                        s.append((char)i);
                     }
                 }
-                s += "]\n";
+                s.append("]\n");
             }
         }
 
-        return s;
+        return s.toString();
     }
 
     public int getOptions() {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ScanEnvironment.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ScanEnvironment.java	Fri Jul 26 14:07:32 2013 -0700
@@ -39,13 +39,10 @@
 
     final public Regex reg;
 
-    int numCall;
     public int numMem;
 
     public Node memNodes[];
 
-    int currMaxRegNum;
-    boolean hasRecursion;
 
     public ScanEnvironment(Regex regex, Syntax syntax) {
         this.reg = regex;
@@ -60,13 +57,8 @@
         btMemEnd = bsClear();
         backrefedMem = bsClear();
 
-        numCall = 0;
         numMem = 0;
-
         memNodes = null;
-
-        currMaxRegNum = 0;
-        hasRecursion = false;
     }
 
     public int addMemEntry() {
@@ -117,11 +109,4 @@
         }
     }
 
-    void closeBracketWithoutEscapeWarn(String s) {
-        if (Config.USE_WARN) {
-            if (syntax.warnCCOpNotEscaped()) {
-                reg.warnings.warn("regular expression has '" + s + "' without escape");
-            }
-        }
-    }
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java	Fri Jul 26 14:07:32 2013 -0700
@@ -155,24 +155,4 @@
         return p < stop;
     }
 
-    protected void newSyntaxException(String message) {
-        throw new SyntaxException(message);
-    }
-
-    protected void newValueException(String message) {
-        throw new ValueException(message);
-    }
-
-    protected void newValueException(String message, String str) {
-        throw new ValueException(message, str);
-    }
-
-    protected void newValueException(String message, int p, int end) {
-        throw new ValueException(message, new String(chars, p, end - p));
-    }
-
-    protected void newInternalException(String message) {
-        throw new InternalException(message);
-    }
-
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Token.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Token.java	Fri Jul 26 14:07:32 2013 -0700
@@ -24,12 +24,10 @@
 final class Token {
     TokenType type;
     boolean escaped;
-    int base;               /* is number: 8, 16 (used in [....]) */
     int backP;
 
     // union fields
-    private int INT1, INT2, INT3, INT4, INT5;
-    private int []INTA1;
+    private int INT1, INT2, INT3, INT4;
 
     // union accessors
     int getC() {
@@ -53,13 +51,6 @@
         INT1 = anchor;
     }
 
-    int getSubtype() {
-        return INT1;
-    }
-    void setSubtype(int subtype) {
-        INT1 = subtype;
-    }
-
     // repeat union member
     int getRepeatLower() {
         return INT1;
@@ -89,72 +80,13 @@
         INT4 = possessive ? 1 : 0;
     }
 
-    // backref union member
-    int getBackrefNum() {
-        return INT1;
-    }
-    void setBackrefNum(int num) {
-        INT1 = num;
-    }
-
-    int getBackrefRef1() {
+    int getBackrefRef() {
         return INT2;
     }
-    void setBackrefRef1(int ref1) {
+    void setBackrefRef(int ref1) {
         INT2 = ref1;
     }
 
-    int[]getBackrefRefs() {
-        return INTA1;
-    }
-    void setBackrefRefs(int[]refs) {
-        INTA1 = refs;
-    }
-
-    boolean getBackrefByName() {
-        return INT3 != 0;
-    }
-    void setBackrefByName(boolean byName) {
-        INT3 = byName ? 1 : 0;
-    }
-
-    // USE_BACKREF_AT_LEVEL
-    boolean getBackrefExistLevel() {
-        return INT4 != 0;
-    }
-    void setBackrefExistLevel(boolean existLevel) {
-        INT4 = existLevel ? 1 : 0;
-    }
-
-    int getBackrefLevel() {
-        return INT5;
-    }
-    void setBackrefLevel(int level) {
-        INT5 = level;
-    }
-
-    // call union member
-    int getCallNameP() {
-        return INT1;
-    }
-    void setCallNameP(int nameP) {
-        INT1 = nameP;
-    }
-
-    int getCallNameEnd() {
-        return INT2;
-    }
-    void setCallNameEnd(int nameEnd) {
-        INT2 = nameEnd;
-    }
-
-    int getCallGNum() {
-        return INT3;
-    }
-    void setCallGNum(int gnum) {
-        INT3 = gnum;
-    }
-
     // prop union member
     int getPropCType() {
         return INT1;
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/BackRefNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/BackRefNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -20,41 +20,15 @@
 package jdk.nashorn.internal.runtime.regexp.joni.ast;
 
 import jdk.nashorn.internal.runtime.regexp.joni.ScanEnvironment;
-import jdk.nashorn.internal.runtime.regexp.joni.exception.ErrorMessages;
-import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
 
 public final class BackRefNode extends StateNode {
-    //private static int NODE_BACKREFS_SIZE = 6;
-
-    //int state;
-    public int backNum;
-    public int back[];
-
-    public int nestLevel;
-
-    public BackRefNode(int backNum, int[]backRefs, boolean byName, ScanEnvironment env) {
-        this.backNum = backNum;
-        if (byName) setNameRef();
+    public final int backRef;
 
-        for (int i=0; i<backNum; i++) {
-            if (backRefs[i] <= env.numMem && env.memNodes[backRefs[i]] == null) {
-                setRecursion(); /* /...(\1).../ */
-                break;
-            }
-        }
+    public BackRefNode(int backRef, ScanEnvironment env) {
+        this.backRef = backRef;
 
-        back = new int[backNum];
-        System.arraycopy(backRefs, 0, back, 0, backNum); // shall we really dup it ???
-    }
-
-    // #ifdef USE_BACKREF_AT_LEVEL
-    public BackRefNode(int backNum, int[]backRefs, boolean byName, boolean existLevel, int nestLevel, ScanEnvironment env) {
-        this(backNum, backRefs, byName, env);
-
-        if (existLevel) {
-            //state |= NST_NEST_LEVEL;
-            setNestLevel();
-            this.nestLevel = nestLevel;
+        if (backRef <= env.numMem && env.memNodes[backRef] == null) {
+            setRecursion(); /* /...(\1).../ */
         }
     }
 
@@ -71,28 +45,7 @@
     @Override
     public String toString(int level) {
         StringBuilder value = new StringBuilder(super.toString(level));
-        value.append("\n  backNum: " + backNum);
-        String backs = "";
-        for (int i=0; i<back.length; i++) backs += back[i] + ", ";
-        value.append("\n  back: " + backs);
-        value.append("\n  nextLevel: " + nestLevel);
+        value.append("\n  back: ").append(backRef);
         return value.toString();
     }
-
-    public void renumber(int[]map) {
-        if (!isNameRef()) throw new ValueException(ErrorMessages.ERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED);
-
-        int oldNum = backNum;
-
-        int pos = 0;
-        for (int i=0; i<oldNum; i++) {
-            int n = map[back[i]];
-            if (n > 0) {
-                back[pos] = n;
-                pos++;
-            }
-        }
-        backNum = pos;
-    }
-
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/CClassNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/CClassNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -77,39 +77,12 @@
     // node_new_cclass
     public CClassNode() {}
 
-    public CClassNode(int ctype, boolean not, int sbOut, int[]ranges) {
-        this(not, sbOut, ranges);
-        this.ctype = ctype;
-    }
-
     public void clear() {
         bs.clear();
         flags = 0;
         mbuf = null;
     }
 
-    // node_new_cclass_by_codepoint_range, only used by shared Char Classes
-    public CClassNode(boolean not, int sbOut, int[]ranges) {
-        if (not) setNot();
-        // bs.clear();
-
-        if (sbOut > 0 && ranges != null) {
-            int n = ranges[0];
-            for (int i=0; i<n; i++) {
-                int from = ranges[i * 2 + 1];
-                int to = ranges[i * 2 + 2];
-                for (int j=from; j<=to; j++) {
-                    if (j >= sbOut) {
-                        setupBuffer(ranges);
-                        return;
-                    }
-                    bs.set(j);
-                }
-            }
-        }
-        setupBuffer(ranges);
-    }
-
     @Override
     public int getType() {
         return CCLASS;
@@ -156,13 +129,6 @@
         return flags.toString();
     }
 
-    private void setupBuffer(int[]ranges) {
-        if (ranges != null) {
-            if (ranges[0] == 0) return;
-            mbuf = new CodeRangeBuffer(ranges);
-        }
-    }
-
     public boolean isEmpty() {
         return mbuf == null && bs.isEmpty();
     }
@@ -531,11 +497,7 @@
         boolean found;
 
         if (code > 0xff) {
-            if (mbuf == null) {
-                found = false;
-            } else {
-                found = EncodingHelper.isInCodeRange(mbuf.getCodeRange(), code);
-            }
+            found = mbuf != null && mbuf.isInCodeRange(code);
         } else {
             found = bs.at(code);
         }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/StateNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/StateNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -40,7 +40,6 @@
         if (isRecursion()) states.append("RECURSION ");
         if (isCalled()) states.append("CALLED ");
         if (isAddrFixed()) states.append("ADDR_FIXED ");
-        if (isNameRef()) states.append("NAME_REF ");
         if (isInRepeat()) states.append("IN_REPEAT ");
         if (isNestLevel()) states.append("NEST_LEVEL ");
         if (isByNumber()) states.append("BY_NUMBER ");
@@ -132,14 +131,6 @@
         state |= NST_ADDR_FIXED;
     }
 
-    public boolean isNameRef() {
-        return (state & NST_NAME_REF) != 0;
-    }
-
-    public void setNameRef() {
-        state |= NST_NAME_REF;
-    }
-
     public boolean isInRepeat() {
         return (state & NST_IN_REPEAT) != 0;
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/StringNode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/StringNode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -96,7 +96,7 @@
             if (chars[i] >= 0x20 && chars[i] < 0x7f) {
                 value.append(chars[i]);
             } else {
-                value.append(String.format("[0x%04x]", chars[i]));
+                value.append(String.format("[0x%04x]", (int)chars[i]));
             }
         }
         value.append("'");
@@ -122,10 +122,7 @@
     }
 
     public boolean canBeSplit() {
-        if (end > p) {
-            return 1 < (end - p);
-        }
-        return false;
+        return end > p && 1 < (end - p);
     }
 
     public void set(char[] chars, int p, int end) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/constants/OPCode.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/constants/OPCode.java	Fri Jul 26 14:07:32 2013 -0700
@@ -29,12 +29,6 @@
     final int EXACT4                        = 5;            /* single byte, N = 4 */
     final int EXACT5                        = 6;            /* single byte, N = 5 */
     final int EXACTN                        = 7;            /* single byte */
-    final int EXACTMB2N1                    = 8;            /* mb-length = 2 N = 1 */
-    final int EXACTMB2N2                    = 9;            /* mb-length = 2 N = 2 */
-    final int EXACTMB2N3                    = 10;           /* mb-length = 2 N = 3 */
-    final int EXACTMB2N                     = 11;           /* mb-length = 2 */
-    final int EXACTMB3N                     = 12;           /* mb-length = 3 */
-    final int EXACTMBN                      = 13;           /* other length */
 
     final int EXACT1_IC                     = 14;           /* single byte, N = 1, ignore case */
     final int EXACTN_IC                     = 15;           /* single byte,        ignore case */
@@ -125,28 +119,4 @@
     final int SET_OPTION_PUSH               = 86;           /* set option and push recover option */
     final int SET_OPTION                    = 87;           /* set option */
 
-    // single byte versions
-    final int ANYCHAR_SB                    = 88;           /* "."  */
-    final int ANYCHAR_ML_SB                 = 89;           /* "."  multi-line */
-    final int ANYCHAR_STAR_SB               = 90;           /* ".*" */
-    final int ANYCHAR_ML_STAR_SB            = 91;           /* ".*" multi-line */
-    final int ANYCHAR_STAR_PEEK_NEXT_SB     = 92;
-    final int ANYCHAR_ML_STAR_PEEK_NEXT_SB  = 93;
-    final int STATE_CHECK_ANYCHAR_STAR_SB   = 94;
-    final int STATE_CHECK_ANYCHAR_ML_STAR_SB= 95;
-
-    final int CCLASS_SB                     = 96;
-    final int CCLASS_NOT_SB                 = 97;
-    final int WORD_SB                       = 98;
-    final int NOT_WORD_SB                   = 99;
-    final int WORD_BOUND_SB                 = 100;
-    final int NOT_WORD_BOUND_SB             = 101;
-    final int WORD_BEGIN_SB                 = 102;
-    final int WORD_END_SB                   = 103;
-
-    final int LOOK_BEHIND_SB                = 104;
-
-    final int EXACT1_IC_SB                  = 105;           /* single byte, N = 1, ignore case */
-    final int EXACTN_IC_SB                  = 106;           /* single byte,        ignore case */
-
 }
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -50,6 +50,7 @@
 parser.error.no.func.decl.here.warn=Function declarations should only occur at program or function body level. Function declaration in nested block was converted to a function expression.
 parser.error.property.redefinition=Property "{0}" already defined
 parser.error.unexpected.token=Unexpected token: {0}
+parser.error.for.each.without.in=for each can only be used with for..in
 parser.error.many.vars.in.for.in.loop=Only one variable allowed in for..in loop
 parser.error.not.lvalue.for.in.loop=Invalid left side value of for..in loop
 parser.error.missing.catch.or.finally=Missing catch or finally after try
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties	Fri Jul 26 14:07:32 2013 -0700
@@ -192,6 +192,14 @@
     default=true                                   \
 }
 
+nashorn.option.no.java = {                         \
+    name="--no-java",                              \
+    short_name="-nj",                              \
+    is_undocumented=true,                          \
+    desc="No Java support",                        \
+    default=false                                  \
+}
+
 nashorn.option.no.syntax.extensions = {            \
     name="--no-syntax-extensions",                 \
     short_name="-nse",                             \
@@ -200,6 +208,14 @@
     default=false                                  \
 }
 
+nashorn.option.no.typed.arrays = {                 \
+    name="--no-typed-arrays",                      \
+    short_name="-nta",                             \
+    is_undocumented=true,                          \
+    desc="No Typed arrays support",                \
+    default=false                                  \
+}
+
 nashorn.option.package = {                                     \
     name="--package",                                          \
     is_undocumented=true,                                      \
--- a/nashorn/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/mozilla_compat.js	Fri Jul 26 14:07:32 2013 -0700
@@ -48,7 +48,7 @@
         var _packages = [];
         var global = this;
         var oldNoSuchProperty = global.__noSuchProperty__;
-        global.__noSuchProperty__ = function(name) {
+        var __noSuchProperty__ = function(name) {
             'use strict';
             for (var i in _packages) {
                 try {
@@ -69,6 +69,11 @@
             }
         }
 
+        Object.defineProperty(global, "__noSuchProperty__", {
+            writable: true, configurable: true, enumerable: false,
+            value: __noSuchProperty__
+        });
+
         var prefix = "[JavaPackage ";
         return function() {
             for (var i in arguments) {
--- a/nashorn/src/jdk/nashorn/internal/scripts/JO.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/scripts/JO.java	Fri Jul 26 14:07:32 2013 -0700
@@ -33,13 +33,14 @@
  */
 public class JO extends ScriptObject {
 
-    private static final PropertyMap map$ = PropertyMap.newMap(JO.class);
+    private static final PropertyMap map$ = PropertyMap.newMap().setIsShared();
 
     /**
-     * Constructor
+     * Returns the initial property map to be used.
+     * @return the initial property map.
      */
-    public JO() {
-        super(map$);
+    public static PropertyMap getInitialMap() {
+        return map$;
     }
 
     /**
@@ -52,16 +53,17 @@
     }
 
     /**
-     * Constructor given an initial prototype using the default property map
+     * Constructor given an initial prototype and an initial property map.
      *
      * @param proto the prototype object
+     * @param map the property map
      */
-    public JO(final ScriptObject proto) {
-        super(proto, map$);
+    public JO(final ScriptObject proto, final PropertyMap map) {
+        super(proto, map);
     }
 
     /**
-     * Used by FunctionObjectCreator. A method handle of this method is passed to the ScriptFunction constructor.
+     * A method handle of this method is passed to the ScriptFunction constructor.
      *
      * @param map  the property map to use for allocatorMap
      *
--- a/nashorn/src/jdk/nashorn/tools/Shell.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/src/jdk/nashorn/tools/Shell.java	Fri Jul 26 14:07:32 2013 -0700
@@ -47,6 +47,7 @@
 import jdk.nashorn.internal.parser.Parser;
 import jdk.nashorn.internal.runtime.Context;
 import jdk.nashorn.internal.runtime.ErrorManager;
+import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.Property;
 import jdk.nashorn.internal.runtime.ScriptEnvironment;
 import jdk.nashorn.internal.runtime.ScriptFunction;
@@ -434,6 +435,10 @@
                     break;
                 }
 
+                if (source.isEmpty()) {
+                    continue;
+                }
+
                 Object res;
                 try {
                     res = context.eval(global, source, global, "<shell>", env._strict);
@@ -446,7 +451,7 @@
                 }
 
                 if (res != null && res != ScriptRuntime.UNDEFINED) {
-                    err.println(ScriptRuntime.safeToString(res));
+                    err.println(JSType.toString(res));
                 }
             }
         } finally {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010946-2.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8010946: AccessController.doPrivileged() doesn't work as expected.
+ * This is actually a broader issue of having Dynalink correctly handle
+ * caller-sensitive methods.
+ *
+ * @test
+ * @run
+ */
+
+// Ensure these are CallerSensitiveDynamicMethods
+print(java.security.AccessController["doPrivileged(PrivilegedAction)"])
+print(java.lang.Class["forName(String)"])
+
+// Ensure this is not
+print(java.lang.String["valueOf(char)"])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010946-2.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+[jdk.internal.dynalink.beans.CallerSensitiveDynamicMethod Object java.security.AccessController.doPrivileged(PrivilegedAction)]
+[jdk.internal.dynalink.beans.CallerSensitiveDynamicMethod Class java.lang.Class.forName(String)]
+[jdk.internal.dynalink.beans.SimpleDynamicMethod String java.lang.String.valueOf(char)]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010946-privileged.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8010946: AccessController.doPrivileged() doesn't work as expected.
+ * This is actually a broader issue of having Dynalink correctly handle
+ * caller-sensitive methods.
+ * 
+ * NOTE: This is not a standalone test file, it is loaded by JDK-801946.js
+ * @subtest
+ */
+
+(function() {
+    var getProperty = java.lang.System.getProperty
+    var doPrivileged = java.security.AccessController["doPrivileged(PrivilegedAction)"]
+
+    this.executeUnprivileged = function() {
+        var x = getProperty("java.security.policy")
+        if(x != null) {
+            print("Successfully retrieved restricted system property.")
+        }
+    }
+
+    this.executePrivileged = function() {
+        doPrivileged(executeUnprivileged)
+    }
+})();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010946.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8010946: AccessController.doPrivileged() doesn't work as expected.
+ * This is actually a broader issue of having Dynalink correctly handle
+ * caller-sensitive methods.
+ *
+ * @test
+ * @run
+ */
+
+// This is unprivileged code that loads privileged code.
+load(__DIR__ + "JDK-8010946-privileged.js")
+
+try {
+    // This should fail, even though the code itself resides in the 
+    // privileged script, as we're invoking it without going through
+    // doPrivileged()
+    print("Attempting unprivileged execution...")
+    executeUnprivileged()
+    print("FAIL: Unprivileged execution succeeded!")
+} catch(e) {
+    print("Unprivileged execution failed with " + e)
+}
+
+print()
+
+// This should succeed, as it's going through doPrivileged().
+print("Attempting privileged execution...")
+executePrivileged()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8010946.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,5 @@
+Attempting unprivileged execution...
+Unprivileged execution failed with java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.security.policy" "read")
+
+Attempting privileged execution...
+Successfully retrieved restricted system property.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8012191.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8012191: noSuchProperty can't cope with vararg functions
+ *
+ * @test
+ * @run
+ */
+
+// ClassCastException: Cannot cast java.lang.String to [Ljava.lang.Object; 
+__noSuchProperty__ = function() {
+    print("obj.__noSuchProperty__ invoked for " + arguments[0]);
+}
+
+nonExistent;
+
+// related issue was seen in JSAdapter __get__, __set__ too
+var obj = new JSAdapter() {
+    __put__: function() {
+        print("JSAdapter.__put__");
+        print(arguments[0]);
+        print(arguments[1]);
+    },
+
+    __get__: function() {
+        print("JSAdapter.__get__");
+        print(arguments[0]);
+    }
+};
+
+obj.x = 343;
+obj.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8012191.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,6 @@
+obj.__noSuchProperty__ invoked for nonExistent
+JSAdapter.__put__
+x
+343
+JSAdapter.__get__
+y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8014785.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8014785: Ability to extend global instance by binding properties of another object
+ *
+ * @test
+ * @run
+ */
+
+var obj = { x: 34, y: 100 };
+var foo = {}
+
+// bind properties of "obj" to "foo" obj
+Object.bindProperties(foo, obj);
+
+// now we can access/write on foo properties
+print("foo.x = " + foo.x); // prints obj.x which is 34
+
+// update obj.x via foo.x
+foo.x = "hello";
+print("obj.x = " + obj.x); // prints "hello" now
+     
+obj.x = 42;   // foo.x also becomes 42
+print("obj.x = " + obj.x); // prints 42
+print("foo.x = " + foo.x); // prints 42
+
+// now bind a mirror object to an object
+var obj = loadWithNewGlobal({
+  name: "test",
+  script: "obj = { x: 33, y: 'hello' }"
+});
+
+Object.bindProperties(this, obj);
+print("x = " + x); // prints 33
+print("y = " + y); // prints "hello"
+
+x = Math.PI;               // changes obj.x to Math.PI
+print("obj.x = " +obj.x);  // prints Math.PI
+
+obj.y = 32;
+print("y = " + y);  // should print 32
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8014785.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,8 @@
+foo.x = 34
+obj.x = hello
+obj.x = 42
+foo.x = 42
+x = 33
+y = hello
+obj.x = 3.141592653589793
+y = 32
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8015356.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8015355: Array concatenation should ignore empty array elements.
+ * 
+ * @test
+ * @run
+ */
+
+print("***")
+print([].concat([,]).hasOwnProperty("0"))
+
+print("***")
+var x = [].concat([,'a',,'b',,'c'])
+for(var i in x) {
+  print(i + ": " + x[i])
+}
+
+print("***")
+x = x.concat(['d',,'e',,'f',,])
+for(var i in x) {
+  print(i + ": " + x[i])
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8015356.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,13 @@
+***
+false
+***
+1: a
+3: b
+5: c
+***
+1: a
+3: b
+5: c
+6: d
+8: e
+10: f
--- a/nashorn/test/script/basic/JDK-8016667.js	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/script/basic/JDK-8016667.js	Fri Jul 26 14:07:32 2013 -0700
@@ -32,3 +32,23 @@
     var friends = 1;
     (joe = friends) == null;
 } 
+
+//JDK-8019476 duplicate case of this
+Function("with(\nnull == (this % {}))( /x/g );"); 
+
+function f() {
+    with(null == (this % {}))(/x/g);
+}
+
+Function("return (null != [,,] <= this);"); 
+
+function f2() {
+    return (null != [,,] <= this);
+}
+
+Function("/*infloop*/L:for(var x; ([+(function (window)[,,])(function(q) { return q; }, -0)].some(new Function)); [11,12,13,14].some) {/*infloop*/do {;return this; } while(x); }"); 
+
+function f3() {
+    /*infloop*/L:for(var x; ([+(function (window)[,,])(function(q) { return q; }, -0)].some(new Function)); [11,12,13,14].some) {/*infloop*/do {;return this; } while(x); }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8016681.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8016681: regex capture behaves differently than on V8
+ *
+ * @test
+ * @run
+ */
+
+// regexp similar to the one used in marked.js
+/^((?:[^\n]+\n?(?!( *[-*_]){3,} *(?:\n+|$)| *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)|([^\n]+)\n *(=|-){3,} *\n*))+)\n*/
+    .exec("a\n\nb")
+    .forEach(function(e) { print(e); });
+
+// simplified regexp
+/(x(?!(a))(?!(b))y)/
+    .exec("xy")
+    .forEach(function(e) { print(e); });
+
+// should not match as cross-negative-lookeahead backreference \2 should be undefined
+print(/(x(?!(a))(?!(b)\2))/.exec("xbc"));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8016681.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,15 @@
+a
+
+
+a
+
+undefined
+undefined
+undefined
+undefined
+undefined
+xy
+xy
+undefined
+undefined
+null
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8017084.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,17625 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8017084: Use spill properties for large object literals
+ *
+ * @test
+ * @run
+ */
+
+var x = {
+    a: 1,
+    b: 2,
+    c: 3,
+    d: 4,
+    e: 5,
+    f: 6,
+    g: 7,
+    h: 8,
+    i: 9,
+    j: 10,
+    k: 11,
+    l: 12,
+    m: 13,
+    n: 14,
+    o: 15,
+    p: 16,
+    q: 17,
+    r: 18,
+    s: 19,
+    t: 20,
+    u: 21,
+    v: 22,
+    w: 23,
+    x: 24,
+    y: 25,
+    az: 26,
+    aa: 27,
+    ab: 28,
+    ac: 29,
+    ad: 30,
+    ae: 31,
+    af: 32,
+    ag: 33,
+    ah: 34,
+    ai: 35,
+    aj: 36,
+    ak: 37,
+    al: 38,
+    am: 39,
+    an: 40,
+    ao: 41,
+    ap: 42,
+    aq: 43,
+    ar: 44,
+    as: 45,
+    at: 46,
+    au: 47,
+    av: 48,
+    aw: 49,
+    ax: 50,
+    ay: 51,
+    bz: 52,
+    ba: 53,
+    bb: 54,
+    bc: 55,
+    bd: 56,
+    be: 57,
+    bf: 58,
+    bg: 59,
+    bh: 60,
+    bi: 61,
+    bj: 62,
+    bk: 63,
+    bl: 64,
+    bm: 65,
+    bn: 66,
+    bo: 67,
+    bp: 68,
+    bq: 69,
+    br: 70,
+    bs: 71,
+    bt: 72,
+    bu: 73,
+    bv: 74,
+    bw: 75,
+    bx: 76,
+    by: 77,
+    cz: 78,
+    ca: 79,
+    cb: 80,
+    cc: 81,
+    cd: 82,
+    ce: 83,
+    cf: 84,
+    cg: 85,
+    ch: 86,
+    ci: 87,
+    cj: 88,
+    ck: 89,
+    cl: 90,
+    cm: 91,
+    cn: 92,
+    co: 93,
+    cp: 94,
+    cq: 95,
+    cr: 96,
+    cs: 97,
+    ct: 98,
+    cu: 99,
+    cv: 100,
+    cw: 101,
+    cx: 102,
+    cy: 103,
+    dz: 104,
+    da: 105,
+    db: 106,
+    dc: 107,
+    dd: 108,
+    de: 109,
+    df: 110,
+    dg: 111,
+    dh: 112,
+    di: 113,
+    dj: 114,
+    dk: 115,
+    dl: 116,
+    dm: 117,
+    dn: 118,
+    do: 119,
+    dp: 120,
+    dq: 121,
+    dr: 122,
+    ds: 123,
+    dt: 124,
+    du: 125,
+    dv: 126,
+    dw: 127,
+    dx: 128,
+    dy: 129,
+    ez: 130,
+    ea: 131,
+    eb: 132,
+    ec: 133,
+    ed: 134,
+    ee: 135,
+    ef: 136,
+    eg: 137,
+    eh: 138,
+    ei: 139,
+    ej: 140,
+    ek: 141,
+    el: 142,
+    em: 143,
+    en: 144,
+    eo: 145,
+    ep: 146,
+    eq: 147,
+    er: 148,
+    es: 149,
+    et: 150,
+    eu: 151,
+    ev: 152,
+    ew: 153,
+    ex: 154,
+    ey: 155,
+    fz: 156,
+    fa: 157,
+    fb: 158,
+    fc: 159,
+    fd: 160,
+    fe: 161,
+    ff: 162,
+    fg: 163,
+    fh: 164,
+    fi: 165,
+    fj: 166,
+    fk: 167,
+    fl: 168,
+    fm: 169,
+    fn: 170,
+    fo: 171,
+    fp: 172,
+    fq: 173,
+    fr: 174,
+    fs: 175,
+    ft: 176,
+    fu: 177,
+    fv: 178,
+    fw: 179,
+    fx: 180,
+    fy: 181,
+    gz: 182,
+    ga: 183,
+    gb: 184,
+    gc: 185,
+    gd: 186,
+    ge: 187,
+    gf: 188,
+    gg: 189,
+    gh: 190,
+    gi: 191,
+    gj: 192,
+    gk: 193,
+    gl: 194,
+    gm: 195,
+    gn: 196,
+    go: 197,
+    gp: 198,
+    gq: 199,
+    gr: 200,
+    gs: 201,
+    gt: 202,
+    gu: 203,
+    gv: 204,
+    gw: 205,
+    gx: 206,
+    gy: 207,
+    hz: 208,
+    ha: 209,
+    hb: 210,
+    hc: 211,
+    hd: 212,
+    he: 213,
+    hf: 214,
+    hg: 215,
+    hh: 216,
+    hi: 217,
+    hj: 218,
+    hk: 219,
+    hl: 220,
+    hm: 221,
+    hn: 222,
+    ho: 223,
+    hp: 224,
+    hq: 225,
+    hr: 226,
+    hs: 227,
+    ht: 228,
+    hu: 229,
+    hv: 230,
+    hw: 231,
+    hx: 232,
+    hy: 233,
+    iz: 234,
+    ia: 235,
+    ib: 236,
+    ic: 237,
+    id: 238,
+    ie: 239,
+    if: 240,
+    ig: 241,
+    ih: 242,
+    ii: 243,
+    ij: 244,
+    ik: 245,
+    il: 246,
+    im: 247,
+    in: 248,
+    io: 249,
+    ip: 250,
+    iq: 251,
+    ir: 252,
+    is: 253,
+    it: 254,
+    iu: 255,
+    iv: 256,
+    iw: 257,
+    ix: 258,
+    iy: 259,
+    jz: 260,
+    ja: 261,
+    jb: 262,
+    jc: 263,
+    jd: 264,
+    je: 265,
+    jf: 266,
+    jg: 267,
+    jh: 268,
+    ji: 269,
+    jj: 270,
+    jk: 271,
+    jl: 272,
+    jm: 273,
+    jn: 274,
+    jo: 275,
+    jp: 276,
+    jq: 277,
+    jr: 278,
+    js: 279,
+    jt: 280,
+    ju: 281,
+    jv: 282,
+    jw: 283,
+    jx: 284,
+    jy: 285,
+    kz: 286,
+    ka: 287,
+    kb: 288,
+    kc: 289,
+    kd: 290,
+    ke: 291,
+    kf: 292,
+    kg: 293,
+    kh: 294,
+    ki: 295,
+    kj: 296,
+    kk: 297,
+    kl: 298,
+    km: 299,
+    kn: 300,
+    ko: 301,
+    kp: 302,
+    kq: 303,
+    kr: 304,
+    ks: 305,
+    kt: 306,
+    ku: 307,
+    kv: 308,
+    kw: 309,
+    kx: 310,
+    ky: 311,
+    lz: 312,
+    la: 313,
+    lb: 314,
+    lc: 315,
+    ld: 316,
+    le: 317,
+    lf: 318,
+    lg: 319,
+    lh: 320,
+    li: 321,
+    lj: 322,
+    lk: 323,
+    ll: 324,
+    lm: 325,
+    ln: 326,
+    lo: 327,
+    lp: 328,
+    lq: 329,
+    lr: 330,
+    ls: 331,
+    lt: 332,
+    lu: 333,
+    lv: 334,
+    lw: 335,
+    lx: 336,
+    ly: 337,
+    mz: 338,
+    ma: 339,
+    mb: 340,
+    mc: 341,
+    md: 342,
+    me: 343,
+    mf: 344,
+    mg: 345,
+    mh: 346,
+    mi: 347,
+    mj: 348,
+    mk: 349,
+    ml: 350,
+    mm: 351,
+    mn: 352,
+    mo: 353,
+    mp: 354,
+    mq: 355,
+    mr: 356,
+    ms: 357,
+    mt: 358,
+    mu: 359,
+    mv: 360,
+    mw: 361,
+    mx: 362,
+    my: 363,
+    nz: 364,
+    na: 365,
+    nb: 366,
+    nc: 367,
+    nd: 368,
+    ne: 369,
+    nf: 370,
+    ng: 371,
+    nh: 372,
+    ni: 373,
+    nj: 374,
+    nk: 375,
+    nl: 376,
+    nm: 377,
+    nn: 378,
+    no: 379,
+    np: 380,
+    nq: 381,
+    nr: 382,
+    ns: 383,
+    nt: 384,
+    nu: 385,
+    nv: 386,
+    nw: 387,
+    nx: 388,
+    ny: 389,
+    oz: 390,
+    oa: 391,
+    ob: 392,
+    oc: 393,
+    od: 394,
+    oe: 395,
+    of: 396,
+    og: 397,
+    oh: 398,
+    oi: 399,
+    oj: 400,
+    ok: 401,
+    ol: 402,
+    om: 403,
+    on: 404,
+    oo: 405,
+    op: 406,
+    oq: 407,
+    or: 408,
+    os: 409,
+    ot: 410,
+    ou: 411,
+    ov: 412,
+    ow: 413,
+    ox: 414,
+    oy: 415,
+    pz: 416,
+    pa: 417,
+    pb: 418,
+    pc: 419,
+    pd: 420,
+    pe: 421,
+    pf: 422,
+    pg: 423,
+    ph: 424,
+    pi: 425,
+    pj: 426,
+    pk: 427,
+    pl: 428,
+    pm: 429,
+    pn: 430,
+    po: 431,
+    pp: 432,
+    pq: 433,
+    pr: 434,
+    ps: 435,
+    pt: 436,
+    pu: 437,
+    pv: 438,
+    pw: 439,
+    px: 440,
+    py: 441,
+    qz: 442,
+    qa: 443,
+    qb: 444,
+    qc: 445,
+    qd: 446,
+    qe: 447,
+    qf: 448,
+    qg: 449,
+    qh: 450,
+    qi: 451,
+    qj: 452,
+    qk: 453,
+    ql: 454,
+    qm: 455,
+    qn: 456,
+    qo: 457,
+    qp: 458,
+    qq: 459,
+    qr: 460,
+    qs: 461,
+    qt: 462,
+    qu: 463,
+    qv: 464,
+    qw: 465,
+    qx: 466,
+    qy: 467,
+    rz: 468,
+    ra: 469,
+    rb: 470,
+    rc: 471,
+    rd: 472,
+    re: 473,
+    rf: 474,
+    rg: 475,
+    rh: 476,
+    ri: 477,
+    rj: 478,
+    rk: 479,
+    rl: 480,
+    rm: 481,
+    rn: 482,
+    ro: 483,
+    rp: 484,
+    rq: 485,
+    rr: 486,
+    rs: 487,
+    rt: 488,
+    ru: 489,
+    rv: 490,
+    rw: 491,
+    rx: 492,
+    ry: 493,
+    sz: 494,
+    sa: 495,
+    sb: 496,
+    sc: 497,
+    sd: 498,
+    se: 499,
+    sf: 500,
+    sg: 501,
+    sh: 502,
+    si: 503,
+    sj: 504,
+    sk: 505,
+    sl: 506,
+    sm: 507,
+    sn: 508,
+    so: 509,
+    sp: 510,
+    sq: 511,
+    sr: 512,
+    ss: 513,
+    st: 514,
+    su: 515,
+    sv: 516,
+    sw: 517,
+    sx: 518,
+    sy: 519,
+    tz: 520,
+    ta: 521,
+    tb: 522,
+    tc: 523,
+    td: 524,
+    te: 525,
+    tf: 526,
+    tg: 527,
+    th: 528,
+    ti: 529,
+    tj: 530,
+    tk: 531,
+    tl: 532,
+    tm: 533,
+    tn: 534,
+    to: 535,
+    tp: 536,
+    tq: 537,
+    tr: 538,
+    ts: 539,
+    tt: 540,
+    tu: 541,
+    tv: 542,
+    tw: 543,
+    tx: 544,
+    ty: 545,
+    uz: 546,
+    ua: 547,
+    ub: 548,
+    uc: 549,
+    ud: 550,
+    ue: 551,
+    uf: 552,
+    ug: 553,
+    uh: 554,
+    ui: 555,
+    uj: 556,
+    uk: 557,
+    ul: 558,
+    um: 559,
+    un: 560,
+    uo: 561,
+    up: 562,
+    uq: 563,
+    ur: 564,
+    us: 565,
+    ut: 566,
+    uu: 567,
+    uv: 568,
+    uw: 569,
+    ux: 570,
+    uy: 571,
+    vz: 572,
+    va: 573,
+    vb: 574,
+    vc: 575,
+    vd: 576,
+    ve: 577,
+    vf: 578,
+    vg: 579,
+    vh: 580,
+    vi: 581,
+    vj: 582,
+    vk: 583,
+    vl: 584,
+    vm: 585,
+    vn: 586,
+    vo: 587,
+    vp: 588,
+    vq: 589,
+    vr: 590,
+    vs: 591,
+    vt: 592,
+    vu: 593,
+    vv: 594,
+    vw: 595,
+    vx: 596,
+    vy: 597,
+    wz: 598,
+    wa: 599,
+    wb: 600,
+    wc: 601,
+    wd: 602,
+    we: 603,
+    wf: 604,
+    wg: 605,
+    wh: 606,
+    wi: 607,
+    wj: 608,
+    wk: 609,
+    wl: 610,
+    wm: 611,
+    wn: 612,
+    wo: 613,
+    wp: 614,
+    wq: 615,
+    wr: 616,
+    ws: 617,
+    wt: 618,
+    wu: 619,
+    wv: 620,
+    ww: 621,
+    wx: 622,
+    wy: 623,
+    xz: 624,
+    xa: 625,
+    xb: 626,
+    xc: 627,
+    xd: 628,
+    xe: 629,
+    xf: 630,
+    xg: 631,
+    xh: 632,
+    xi: 633,
+    xj: 634,
+    xk: 635,
+    xl: 636,
+    xm: 637,
+    xn: 638,
+    xo: 639,
+    xp: 640,
+    xq: 641,
+    xr: 642,
+    xs: 643,
+    xt: 644,
+    xu: 645,
+    xv: 646,
+    xw: 647,
+    xx: 648,
+    xy: 649,
+    yz: 650,
+    ya: 651,
+    yb: 652,
+    yc: 653,
+    yd: 654,
+    ye: 655,
+    yf: 656,
+    yg: 657,
+    yh: 658,
+    yi: 659,
+    yj: 660,
+    yk: 661,
+    yl: 662,
+    ym: 663,
+    yn: 664,
+    yo: 665,
+    yp: 666,
+    yq: 667,
+    yr: 668,
+    ys: 669,
+    yt: 670,
+    yu: 671,
+    yv: 672,
+    yw: 673,
+    yx: 674,
+    yy: 675,
+    azz: 676,
+    aza: 677,
+    azb: 678,
+    azc: 679,
+    azd: 680,
+    aze: 681,
+    azf: 682,
+    azg: 683,
+    azh: 684,
+    azi: 685,
+    azj: 686,
+    azk: 687,
+    azl: 688,
+    azm: 689,
+    azn: 690,
+    azo: 691,
+    azp: 692,
+    azq: 693,
+    azr: 694,
+    azs: 695,
+    azt: 696,
+    azu: 697,
+    azv: 698,
+    azw: 699,
+    azx: 700,
+    azy: 701,
+    aaz: 702,
+    aaa: 703,
+    aab: 704,
+    aac: 705,
+    aad: 706,
+    aae: 707,
+    aaf: 708,
+    aag: 709,
+    aah: 710,
+    aai: 711,
+    aaj: 712,
+    aak: 713,
+    aal: 714,
+    aam: 715,
+    aan: 716,
+    aao: 717,
+    aap: 718,
+    aaq: 719,
+    aar: 720,
+    aas: 721,
+    aat: 722,
+    aau: 723,
+    aav: 724,
+    aaw: 725,
+    aax: 726,
+    aay: 727,
+    abz: 728,
+    aba: 729,
+    abb: 730,
+    abc: 731,
+    abd: 732,
+    abe: 733,
+    abf: 734,
+    abg: 735,
+    abh: 736,
+    abi: 737,
+    abj: 738,
+    abk: 739,
+    abl: 740,
+    abm: 741,
+    abn: 742,
+    abo: 743,
+    abp: 744,
+    abq: 745,
+    abr: 746,
+    abs: 747,
+    abt: 748,
+    abu: 749,
+    abv: 750,
+    abw: 751,
+    abx: 752,
+    aby: 753,
+    acz: 754,
+    aca: 755,
+    acb: 756,
+    acc: 757,
+    acd: 758,
+    ace: 759,
+    acf: 760,
+    acg: 761,
+    ach: 762,
+    aci: 763,
+    acj: 764,
+    ack: 765,
+    acl: 766,
+    acm: 767,
+    acn: 768,
+    aco: 769,
+    acp: 770,
+    acq: 771,
+    acr: 772,
+    acs: 773,
+    act: 774,
+    acu: 775,
+    acv: 776,
+    acw: 777,
+    acx: 778,
+    acy: 779,
+    adz: 780,
+    ada: 781,
+    adb: 782,
+    adc: 783,
+    add: 784,
+    ade: 785,
+    adf: 786,
+    adg: 787,
+    adh: 788,
+    adi: 789,
+    adj: 790,
+    adk: 791,
+    adl: 792,
+    adm: 793,
+    adn: 794,
+    ado: 795,
+    adp: 796,
+    adq: 797,
+    adr: 798,
+    ads: 799,
+    adt: 800,
+    adu: 801,
+    adv: 802,
+    adw: 803,
+    adx: 804,
+    ady: 805,
+    aez: 806,
+    aea: 807,
+    aeb: 808,
+    aec: 809,
+    aed: 810,
+    aee: 811,
+    aef: 812,
+    aeg: 813,
+    aeh: 814,
+    aei: 815,
+    aej: 816,
+    aek: 817,
+    ael: 818,
+    aem: 819,
+    aen: 820,
+    aeo: 821,
+    aep: 822,
+    aeq: 823,
+    aer: 824,
+    aes: 825,
+    aet: 826,
+    aeu: 827,
+    aev: 828,
+    aew: 829,
+    aex: 830,
+    aey: 831,
+    afz: 832,
+    afa: 833,
+    afb: 834,
+    afc: 835,
+    afd: 836,
+    afe: 837,
+    aff: 838,
+    afg: 839,
+    afh: 840,
+    afi: 841,
+    afj: 842,
+    afk: 843,
+    afl: 844,
+    afm: 845,
+    afn: 846,
+    afo: 847,
+    afp: 848,
+    afq: 849,
+    afr: 850,
+    afs: 851,
+    aft: 852,
+    afu: 853,
+    afv: 854,
+    afw: 855,
+    afx: 856,
+    afy: 857,
+    agz: 858,
+    aga: 859,
+    agb: 860,
+    agc: 861,
+    agd: 862,
+    age: 863,
+    agf: 864,
+    agg: 865,
+    agh: 866,
+    agi: 867,
+    agj: 868,
+    agk: 869,
+    agl: 870,
+    agm: 871,
+    agn: 872,
+    ago: 873,
+    agp: 874,
+    agq: 875,
+    agr: 876,
+    ags: 877,
+    agt: 878,
+    agu: 879,
+    agv: 880,
+    agw: 881,
+    agx: 882,
+    agy: 883,
+    ahz: 884,
+    aha: 885,
+    ahb: 886,
+    ahc: 887,
+    ahd: 888,
+    ahe: 889,
+    ahf: 890,
+    ahg: 891,
+    ahh: 892,
+    ahi: 893,
+    ahj: 894,
+    ahk: 895,
+    ahl: 896,
+    ahm: 897,
+    ahn: 898,
+    aho: 899,
+    ahp: 900,
+    ahq: 901,
+    ahr: 902,
+    ahs: 903,
+    aht: 904,
+    ahu: 905,
+    ahv: 906,
+    ahw: 907,
+    ahx: 908,
+    ahy: 909,
+    aiz: 910,
+    aia: 911,
+    aib: 912,
+    aic: 913,
+    aid: 914,
+    aie: 915,
+    aif: 916,
+    aig: 917,
+    aih: 918,
+    aii: 919,
+    aij: 920,
+    aik: 921,
+    ail: 922,
+    aim: 923,
+    ain: 924,
+    aio: 925,
+    aip: 926,
+    aiq: 927,
+    air: 928,
+    ais: 929,
+    ait: 930,
+    aiu: 931,
+    aiv: 932,
+    aiw: 933,
+    aix: 934,
+    aiy: 935,
+    ajz: 936,
+    aja: 937,
+    ajb: 938,
+    ajc: 939,
+    ajd: 940,
+    aje: 941,
+    ajf: 942,
+    ajg: 943,
+    ajh: 944,
+    aji: 945,
+    ajj: 946,
+    ajk: 947,
+    ajl: 948,
+    ajm: 949,
+    ajn: 950,
+    ajo: 951,
+    ajp: 952,
+    ajq: 953,
+    ajr: 954,
+    ajs: 955,
+    ajt: 956,
+    aju: 957,
+    ajv: 958,
+    ajw: 959,
+    ajx: 960,
+    ajy: 961,
+    akz: 962,
+    aka: 963,
+    akb: 964,
+    akc: 965,
+    akd: 966,
+    ake: 967,
+    akf: 968,
+    akg: 969,
+    akh: 970,
+    aki: 971,
+    akj: 972,
+    akk: 973,
+    akl: 974,
+    akm: 975,
+    akn: 976,
+    ako: 977,
+    akp: 978,
+    akq: 979,
+    akr: 980,
+    aks: 981,
+    akt: 982,
+    aku: 983,
+    akv: 984,
+    akw: 985,
+    akx: 986,
+    aky: 987,
+    alz: 988,
+    ala: 989,
+    alb: 990,
+    alc: 991,
+    ald: 992,
+    ale: 993,
+    alf: 994,
+    alg: 995,
+    alh: 996,
+    ali: 997,
+    alj: 998,
+    alk: 999,
+    all: 1000,
+    alm: 1001,
+    aln: 1002,
+    alo: 1003,
+    alp: 1004,
+    alq: 1005,
+    alr: 1006,
+    als: 1007,
+    alt: 1008,
+    alu: 1009,
+    alv: 1010,
+    alw: 1011,
+    alx: 1012,
+    aly: 1013,
+    amz: 1014,
+    ama: 1015,
+    amb: 1016,
+    amc: 1017,
+    amd: 1018,
+    ame: 1019,
+    amf: 1020,
+    amg: 1021,
+    amh: 1022,
+    ami: 1023,
+    amj: 1024,
+    amk: 1025,
+    aml: 1026,
+    amm: 1027,
+    amn: 1028,
+    amo: 1029,
+    amp: 1030,
+    amq: 1031,
+    amr: 1032,
+    ams: 1033,
+    amt: 1034,
+    amu: 1035,
+    amv: 1036,
+    amw: 1037,
+    amx: 1038,
+    amy: 1039,
+    anz: 1040,
+    ana: 1041,
+    anb: 1042,
+    anc: 1043,
+    and: 1044,
+    ane: 1045,
+    anf: 1046,
+    ang: 1047,
+    anh: 1048,
+    ani: 1049,
+    anj: 1050,
+    ank: 1051,
+    anl: 1052,
+    anm: 1053,
+    ann: 1054,
+    ano: 1055,
+    anp: 1056,
+    anq: 1057,
+    anr: 1058,
+    ans: 1059,
+    ant: 1060,
+    anu: 1061,
+    anv: 1062,
+    anw: 1063,
+    anx: 1064,
+    any: 1065,
+    aoz: 1066,
+    aoa: 1067,
+    aob: 1068,
+    aoc: 1069,
+    aod: 1070,
+    aoe: 1071,
+    aof: 1072,
+    aog: 1073,
+    aoh: 1074,
+    aoi: 1075,
+    aoj: 1076,
+    aok: 1077,
+    aol: 1078,
+    aom: 1079,
+    aon: 1080,
+    aoo: 1081,
+    aop: 1082,
+    aoq: 1083,
+    aor: 1084,
+    aos: 1085,
+    aot: 1086,
+    aou: 1087,
+    aov: 1088,
+    aow: 1089,
+    aox: 1090,
+    aoy: 1091,
+    apz: 1092,
+    apa: 1093,
+    apb: 1094,
+    apc: 1095,
+    apd: 1096,
+    ape: 1097,
+    apf: 1098,
+    apg: 1099,
+    aph: 1100,
+    api: 1101,
+    apj: 1102,
+    apk: 1103,
+    apl: 1104,
+    apm: 1105,
+    apn: 1106,
+    apo: 1107,
+    app: 1108,
+    apq: 1109,
+    apr: 1110,
+    aps: 1111,
+    apt: 1112,
+    apu: 1113,
+    apv: 1114,
+    apw: 1115,
+    apx: 1116,
+    apy: 1117,
+    aqz: 1118,
+    aqa: 1119,
+    aqb: 1120,
+    aqc: 1121,
+    aqd: 1122,
+    aqe: 1123,
+    aqf: 1124,
+    aqg: 1125,
+    aqh: 1126,
+    aqi: 1127,
+    aqj: 1128,
+    aqk: 1129,
+    aql: 1130,
+    aqm: 1131,
+    aqn: 1132,
+    aqo: 1133,
+    aqp: 1134,
+    aqq: 1135,
+    aqr: 1136,
+    aqs: 1137,
+    aqt: 1138,
+    aqu: 1139,
+    aqv: 1140,
+    aqw: 1141,
+    aqx: 1142,
+    aqy: 1143,
+    arz: 1144,
+    ara: 1145,
+    arb: 1146,
+    arc: 1147,
+    ard: 1148,
+    are: 1149,
+    arf: 1150,
+    arg: 1151,
+    arh: 1152,
+    ari: 1153,
+    arj: 1154,
+    ark: 1155,
+    arl: 1156,
+    arm: 1157,
+    arn: 1158,
+    aro: 1159,
+    arp: 1160,
+    arq: 1161,
+    arr: 1162,
+    ars: 1163,
+    art: 1164,
+    aru: 1165,
+    arv: 1166,
+    arw: 1167,
+    arx: 1168,
+    ary: 1169,
+    asz: 1170,
+    asa: 1171,
+    asb: 1172,
+    asc: 1173,
+    asd: 1174,
+    ase: 1175,
+    asf: 1176,
+    asg: 1177,
+    ash: 1178,
+    asi: 1179,
+    asj: 1180,
+    ask: 1181,
+    asl: 1182,
+    asm: 1183,
+    asn: 1184,
+    aso: 1185,
+    asp: 1186,
+    asq: 1187,
+    asr: 1188,
+    ass: 1189,
+    ast: 1190,
+    asu: 1191,
+    asv: 1192,
+    asw: 1193,
+    asx: 1194,
+    asy: 1195,
+    atz: 1196,
+    ata: 1197,
+    atb: 1198,
+    atc: 1199,
+    atd: 1200,
+    ate: 1201,
+    atf: 1202,
+    atg: 1203,
+    ath: 1204,
+    ati: 1205,
+    atj: 1206,
+    atk: 1207,
+    atl: 1208,
+    atm: 1209,
+    atn: 1210,
+    ato: 1211,
+    atp: 1212,
+    atq: 1213,
+    atr: 1214,
+    ats: 1215,
+    att: 1216,
+    atu: 1217,
+    atv: 1218,
+    atw: 1219,
+    atx: 1220,
+    aty: 1221,
+    auz: 1222,
+    aua: 1223,
+    aub: 1224,
+    auc: 1225,
+    aud: 1226,
+    aue: 1227,
+    auf: 1228,
+    aug: 1229,
+    auh: 1230,
+    aui: 1231,
+    auj: 1232,
+    auk: 1233,
+    aul: 1234,
+    aum: 1235,
+    aun: 1236,
+    auo: 1237,
+    aup: 1238,
+    auq: 1239,
+    aur: 1240,
+    aus: 1241,
+    aut: 1242,
+    auu: 1243,
+    auv: 1244,
+    auw: 1245,
+    aux: 1246,
+    auy: 1247,
+    avz: 1248,
+    ava: 1249,
+    avb: 1250,
+    avc: 1251,
+    avd: 1252,
+    ave: 1253,
+    avf: 1254,
+    avg: 1255,
+    avh: 1256,
+    avi: 1257,
+    avj: 1258,
+    avk: 1259,
+    avl: 1260,
+    avm: 1261,
+    avn: 1262,
+    avo: 1263,
+    avp: 1264,
+    avq: 1265,
+    avr: 1266,
+    avs: 1267,
+    avt: 1268,
+    avu: 1269,
+    avv: 1270,
+    avw: 1271,
+    avx: 1272,
+    avy: 1273,
+    awz: 1274,
+    awa: 1275,
+    awb: 1276,
+    awc: 1277,
+    awd: 1278,
+    awe: 1279,
+    awf: 1280,
+    awg: 1281,
+    awh: 1282,
+    awi: 1283,
+    awj: 1284,
+    awk: 1285,
+    awl: 1286,
+    awm: 1287,
+    awn: 1288,
+    awo: 1289,
+    awp: 1290,
+    awq: 1291,
+    awr: 1292,
+    aws: 1293,
+    awt: 1294,
+    awu: 1295,
+    awv: 1296,
+    aww: 1297,
+    awx: 1298,
+    awy: 1299,
+    axz: 1300,
+    axa: 1301,
+    axb: 1302,
+    axc: 1303,
+    axd: 1304,
+    axe: 1305,
+    axf: 1306,
+    axg: 1307,
+    axh: 1308,
+    axi: 1309,
+    axj: 1310,
+    axk: 1311,
+    axl: 1312,
+    axm: 1313,
+    axn: 1314,
+    axo: 1315,
+    axp: 1316,
+    axq: 1317,
+    axr: 1318,
+    axs: 1319,
+    axt: 1320,
+    axu: 1321,
+    axv: 1322,
+    axw: 1323,
+    axx: 1324,
+    axy: 1325,
+    ayz: 1326,
+    aya: 1327,
+    ayb: 1328,
+    ayc: 1329,
+    ayd: 1330,
+    aye: 1331,
+    ayf: 1332,
+    ayg: 1333,
+    ayh: 1334,
+    ayi: 1335,
+    ayj: 1336,
+    ayk: 1337,
+    ayl: 1338,
+    aym: 1339,
+    ayn: 1340,
+    ayo: 1341,
+    ayp: 1342,
+    ayq: 1343,
+    ayr: 1344,
+    ays: 1345,
+    ayt: 1346,
+    ayu: 1347,
+    ayv: 1348,
+    ayw: 1349,
+    ayx: 1350,
+    ayy: 1351,
+    bzz: 1352,
+    bza: 1353,
+    bzb: 1354,
+    bzc: 1355,
+    bzd: 1356,
+    bze: 1357,
+    bzf: 1358,
+    bzg: 1359,
+    bzh: 1360,
+    bzi: 1361,
+    bzj: 1362,
+    bzk: 1363,
+    bzl: 1364,
+    bzm: 1365,
+    bzn: 1366,
+    bzo: 1367,
+    bzp: 1368,
+    bzq: 1369,
+    bzr: 1370,
+    bzs: 1371,
+    bzt: 1372,
+    bzu: 1373,
+    bzv: 1374,
+    bzw: 1375,
+    bzx: 1376,
+    bzy: 1377,
+    baz: 1378,
+    baa: 1379,
+    bab: 1380,
+    bac: 1381,
+    bad: 1382,
+    bae: 1383,
+    baf: 1384,
+    bag: 1385,
+    bah: 1386,
+    bai: 1387,
+    baj: 1388,
+    bak: 1389,
+    bal: 1390,
+    bam: 1391,
+    ban: 1392,
+    bao: 1393,
+    bap: 1394,
+    baq: 1395,
+    bar: 1396,
+    bas: 1397,
+    bat: 1398,
+    bau: 1399,
+    bav: 1400,
+    baw: 1401,
+    bax: 1402,
+    bay: 1403,
+    bbz: 1404,
+    bba: 1405,
+    bbb: 1406,
+    bbc: 1407,
+    bbd: 1408,
+    bbe: 1409,
+    bbf: 1410,
+    bbg: 1411,
+    bbh: 1412,
+    bbi: 1413,
+    bbj: 1414,
+    bbk: 1415,
+    bbl: 1416,
+    bbm: 1417,
+    bbn: 1418,
+    bbo: 1419,
+    bbp: 1420,
+    bbq: 1421,
+    bbr: 1422,
+    bbs: 1423,
+    bbt: 1424,
+    bbu: 1425,
+    bbv: 1426,
+    bbw: 1427,
+    bbx: 1428,
+    bby: 1429,
+    bcz: 1430,
+    bca: 1431,
+    bcb: 1432,
+    bcc: 1433,
+    bcd: 1434,
+    bce: 1435,
+    bcf: 1436,
+    bcg: 1437,
+    bch: 1438,
+    bci: 1439,
+    bcj: 1440,
+    bck: 1441,
+    bcl: 1442,
+    bcm: 1443,
+    bcn: 1444,
+    bco: 1445,
+    bcp: 1446,
+    bcq: 1447,
+    bcr: 1448,
+    bcs: 1449,
+    bct: 1450,
+    bcu: 1451,
+    bcv: 1452,
+    bcw: 1453,
+    bcx: 1454,
+    bcy: 1455,
+    bdz: 1456,
+    bda: 1457,
+    bdb: 1458,
+    bdc: 1459,
+    bdd: 1460,
+    bde: 1461,
+    bdf: 1462,
+    bdg: 1463,
+    bdh: 1464,
+    bdi: 1465,
+    bdj: 1466,
+    bdk: 1467,
+    bdl: 1468,
+    bdm: 1469,
+    bdn: 1470,
+    bdo: 1471,
+    bdp: 1472,
+    bdq: 1473,
+    bdr: 1474,
+    bds: 1475,
+    bdt: 1476,
+    bdu: 1477,
+    bdv: 1478,
+    bdw: 1479,
+    bdx: 1480,
+    bdy: 1481,
+    bez: 1482,
+    bea: 1483,
+    beb: 1484,
+    bec: 1485,
+    bed: 1486,
+    bee: 1487,
+    bef: 1488,
+    beg: 1489,
+    beh: 1490,
+    bei: 1491,
+    bej: 1492,
+    bek: 1493,
+    bel: 1494,
+    bem: 1495,
+    ben: 1496,
+    beo: 1497,
+    bep: 1498,
+    beq: 1499,
+    ber: 1500,
+    bes: 1501,
+    bet: 1502,
+    beu: 1503,
+    bev: 1504,
+    bew: 1505,
+    bex: 1506,
+    bey: 1507,
+    bfz: 1508,
+    bfa: 1509,
+    bfb: 1510,
+    bfc: 1511,
+    bfd: 1512,
+    bfe: 1513,
+    bff: 1514,
+    bfg: 1515,
+    bfh: 1516,
+    bfi: 1517,
+    bfj: 1518,
+    bfk: 1519,
+    bfl: 1520,
+    bfm: 1521,
+    bfn: 1522,
+    bfo: 1523,
+    bfp: 1524,
+    bfq: 1525,
+    bfr: 1526,
+    bfs: 1527,
+    bft: 1528,
+    bfu: 1529,
+    bfv: 1530,
+    bfw: 1531,
+    bfx: 1532,
+    bfy: 1533,
+    bgz: 1534,
+    bga: 1535,
+    bgb: 1536,
+    bgc: 1537,
+    bgd: 1538,
+    bge: 1539,
+    bgf: 1540,
+    bgg: 1541,
+    bgh: 1542,
+    bgi: 1543,
+    bgj: 1544,
+    bgk: 1545,
+    bgl: 1546,
+    bgm: 1547,
+    bgn: 1548,
+    bgo: 1549,
+    bgp: 1550,
+    bgq: 1551,
+    bgr: 1552,
+    bgs: 1553,
+    bgt: 1554,
+    bgu: 1555,
+    bgv: 1556,
+    bgw: 1557,
+    bgx: 1558,
+    bgy: 1559,
+    bhz: 1560,
+    bha: 1561,
+    bhb: 1562,
+    bhc: 1563,
+    bhd: 1564,
+    bhe: 1565,
+    bhf: 1566,
+    bhg: 1567,
+    bhh: 1568,
+    bhi: 1569,
+    bhj: 1570,
+    bhk: 1571,
+    bhl: 1572,
+    bhm: 1573,
+    bhn: 1574,
+    bho: 1575,
+    bhp: 1576,
+    bhq: 1577,
+    bhr: 1578,
+    bhs: 1579,
+    bht: 1580,
+    bhu: 1581,
+    bhv: 1582,
+    bhw: 1583,
+    bhx: 1584,
+    bhy: 1585,
+    biz: 1586,
+    bia: 1587,
+    bib: 1588,
+    bic: 1589,
+    bid: 1590,
+    bie: 1591,
+    bif: 1592,
+    big: 1593,
+    bih: 1594,
+    bii: 1595,
+    bij: 1596,
+    bik: 1597,
+    bil: 1598,
+    bim: 1599,
+    bin: 1600,
+    bio: 1601,
+    bip: 1602,
+    biq: 1603,
+    bir: 1604,
+    bis: 1605,
+    bit: 1606,
+    biu: 1607,
+    biv: 1608,
+    biw: 1609,
+    bix: 1610,
+    biy: 1611,
+    bjz: 1612,
+    bja: 1613,
+    bjb: 1614,
+    bjc: 1615,
+    bjd: 1616,
+    bje: 1617,
+    bjf: 1618,
+    bjg: 1619,
+    bjh: 1620,
+    bji: 1621,
+    bjj: 1622,
+    bjk: 1623,
+    bjl: 1624,
+    bjm: 1625,
+    bjn: 1626,
+    bjo: 1627,
+    bjp: 1628,
+    bjq: 1629,
+    bjr: 1630,
+    bjs: 1631,
+    bjt: 1632,
+    bju: 1633,
+    bjv: 1634,
+    bjw: 1635,
+    bjx: 1636,
+    bjy: 1637,
+    bkz: 1638,
+    bka: 1639,
+    bkb: 1640,
+    bkc: 1641,
+    bkd: 1642,
+    bke: 1643,
+    bkf: 1644,
+    bkg: 1645,
+    bkh: 1646,
+    bki: 1647,
+    bkj: 1648,
+    bkk: 1649,
+    bkl: 1650,
+    bkm: 1651,
+    bkn: 1652,
+    bko: 1653,
+    bkp: 1654,
+    bkq: 1655,
+    bkr: 1656,
+    bks: 1657,
+    bkt: 1658,
+    bku: 1659,
+    bkv: 1660,
+    bkw: 1661,
+    bkx: 1662,
+    bky: 1663,
+    blz: 1664,
+    bla: 1665,
+    blb: 1666,
+    blc: 1667,
+    bld: 1668,
+    ble: 1669,
+    blf: 1670,
+    blg: 1671,
+    blh: 1672,
+    bli: 1673,
+    blj: 1674,
+    blk: 1675,
+    bll: 1676,
+    blm: 1677,
+    bln: 1678,
+    blo: 1679,
+    blp: 1680,
+    blq: 1681,
+    blr: 1682,
+    bls: 1683,
+    blt: 1684,
+    blu: 1685,
+    blv: 1686,
+    blw: 1687,
+    blx: 1688,
+    bly: 1689,
+    bmz: 1690,
+    bma: 1691,
+    bmb: 1692,
+    bmc: 1693,
+    bmd: 1694,
+    bme: 1695,
+    bmf: 1696,
+    bmg: 1697,
+    bmh: 1698,
+    bmi: 1699,
+    bmj: 1700,
+    bmk: 1701,
+    bml: 1702,
+    bmm: 1703,
+    bmn: 1704,
+    bmo: 1705,
+    bmp: 1706,
+    bmq: 1707,
+    bmr: 1708,
+    bms: 1709,
+    bmt: 1710,
+    bmu: 1711,
+    bmv: 1712,
+    bmw: 1713,
+    bmx: 1714,
+    bmy: 1715,
+    bnz: 1716,
+    bna: 1717,
+    bnb: 1718,
+    bnc: 1719,
+    bnd: 1720,
+    bne: 1721,
+    bnf: 1722,
+    bng: 1723,
+    bnh: 1724,
+    bni: 1725,
+    bnj: 1726,
+    bnk: 1727,
+    bnl: 1728,
+    bnm: 1729,
+    bnn: 1730,
+    bno: 1731,
+    bnp: 1732,
+    bnq: 1733,
+    bnr: 1734,
+    bns: 1735,
+    bnt: 1736,
+    bnu: 1737,
+    bnv: 1738,
+    bnw: 1739,
+    bnx: 1740,
+    bny: 1741,
+    boz: 1742,
+    boa: 1743,
+    bob: 1744,
+    boc: 1745,
+    bod: 1746,
+    boe: 1747,
+    bof: 1748,
+    bog: 1749,
+    boh: 1750,
+    boi: 1751,
+    boj: 1752,
+    bok: 1753,
+    bol: 1754,
+    bom: 1755,
+    bon: 1756,
+    boo: 1757,
+    bop: 1758,
+    boq: 1759,
+    bor: 1760,
+    bos: 1761,
+    bot: 1762,
+    bou: 1763,
+    bov: 1764,
+    bow: 1765,
+    box: 1766,
+    boy: 1767,
+    bpz: 1768,
+    bpa: 1769,
+    bpb: 1770,
+    bpc: 1771,
+    bpd: 1772,
+    bpe: 1773,
+    bpf: 1774,
+    bpg: 1775,
+    bph: 1776,
+    bpi: 1777,
+    bpj: 1778,
+    bpk: 1779,
+    bpl: 1780,
+    bpm: 1781,
+    bpn: 1782,
+    bpo: 1783,
+    bpp: 1784,
+    bpq: 1785,
+    bpr: 1786,
+    bps: 1787,
+    bpt: 1788,
+    bpu: 1789,
+    bpv: 1790,
+    bpw: 1791,
+    bpx: 1792,
+    bpy: 1793,
+    bqz: 1794,
+    bqa: 1795,
+    bqb: 1796,
+    bqc: 1797,
+    bqd: 1798,
+    bqe: 1799,
+    bqf: 1800,
+    bqg: 1801,
+    bqh: 1802,
+    bqi: 1803,
+    bqj: 1804,
+    bqk: 1805,
+    bql: 1806,
+    bqm: 1807,
+    bqn: 1808,
+    bqo: 1809,
+    bqp: 1810,
+    bqq: 1811,
+    bqr: 1812,
+    bqs: 1813,
+    bqt: 1814,
+    bqu: 1815,
+    bqv: 1816,
+    bqw: 1817,
+    bqx: 1818,
+    bqy: 1819,
+    brz: 1820,
+    bra: 1821,
+    brb: 1822,
+    brc: 1823,
+    brd: 1824,
+    bre: 1825,
+    brf: 1826,
+    brg: 1827,
+    brh: 1828,
+    bri: 1829,
+    brj: 1830,
+    brk: 1831,
+    brl: 1832,
+    brm: 1833,
+    brn: 1834,
+    bro: 1835,
+    brp: 1836,
+    brq: 1837,
+    brr: 1838,
+    brs: 1839,
+    brt: 1840,
+    bru: 1841,
+    brv: 1842,
+    brw: 1843,
+    brx: 1844,
+    bry: 1845,
+    bsz: 1846,
+    bsa: 1847,
+    bsb: 1848,
+    bsc: 1849,
+    bsd: 1850,
+    bse: 1851,
+    bsf: 1852,
+    bsg: 1853,
+    bsh: 1854,
+    bsi: 1855,
+    bsj: 1856,
+    bsk: 1857,
+    bsl: 1858,
+    bsm: 1859,
+    bsn: 1860,
+    bso: 1861,
+    bsp: 1862,
+    bsq: 1863,
+    bsr: 1864,
+    bss: 1865,
+    bst: 1866,
+    bsu: 1867,
+    bsv: 1868,
+    bsw: 1869,
+    bsx: 1870,
+    bsy: 1871,
+    btz: 1872,
+    bta: 1873,
+    btb: 1874,
+    btc: 1875,
+    btd: 1876,
+    bte: 1877,
+    btf: 1878,
+    btg: 1879,
+    bth: 1880,
+    bti: 1881,
+    btj: 1882,
+    btk: 1883,
+    btl: 1884,
+    btm: 1885,
+    btn: 1886,
+    bto: 1887,
+    btp: 1888,
+    btq: 1889,
+    btr: 1890,
+    bts: 1891,
+    btt: 1892,
+    btu: 1893,
+    btv: 1894,
+    btw: 1895,
+    btx: 1896,
+    bty: 1897,
+    buz: 1898,
+    bua: 1899,
+    bub: 1900,
+    buc: 1901,
+    bud: 1902,
+    bue: 1903,
+    buf: 1904,
+    bug: 1905,
+    buh: 1906,
+    bui: 1907,
+    buj: 1908,
+    buk: 1909,
+    bul: 1910,
+    bum: 1911,
+    bun: 1912,
+    buo: 1913,
+    bup: 1914,
+    buq: 1915,
+    bur: 1916,
+    bus: 1917,
+    but: 1918,
+    buu: 1919,
+    buv: 1920,
+    buw: 1921,
+    bux: 1922,
+    buy: 1923,
+    bvz: 1924,
+    bva: 1925,
+    bvb: 1926,
+    bvc: 1927,
+    bvd: 1928,
+    bve: 1929,
+    bvf: 1930,
+    bvg: 1931,
+    bvh: 1932,
+    bvi: 1933,
+    bvj: 1934,
+    bvk: 1935,
+    bvl: 1936,
+    bvm: 1937,
+    bvn: 1938,
+    bvo: 1939,
+    bvp: 1940,
+    bvq: 1941,
+    bvr: 1942,
+    bvs: 1943,
+    bvt: 1944,
+    bvu: 1945,
+    bvv: 1946,
+    bvw: 1947,
+    bvx: 1948,
+    bvy: 1949,
+    bwz: 1950,
+    bwa: 1951,
+    bwb: 1952,
+    bwc: 1953,
+    bwd: 1954,
+    bwe: 1955,
+    bwf: 1956,
+    bwg: 1957,
+    bwh: 1958,
+    bwi: 1959,
+    bwj: 1960,
+    bwk: 1961,
+    bwl: 1962,
+    bwm: 1963,
+    bwn: 1964,
+    bwo: 1965,
+    bwp: 1966,
+    bwq: 1967,
+    bwr: 1968,
+    bws: 1969,
+    bwt: 1970,
+    bwu: 1971,
+    bwv: 1972,
+    bww: 1973,
+    bwx: 1974,
+    bwy: 1975,
+    bxz: 1976,
+    bxa: 1977,
+    bxb: 1978,
+    bxc: 1979,
+    bxd: 1980,
+    bxe: 1981,
+    bxf: 1982,
+    bxg: 1983,
+    bxh: 1984,
+    bxi: 1985,
+    bxj: 1986,
+    bxk: 1987,
+    bxl: 1988,
+    bxm: 1989,
+    bxn: 1990,
+    bxo: 1991,
+    bxp: 1992,
+    bxq: 1993,
+    bxr: 1994,
+    bxs: 1995,
+    bxt: 1996,
+    bxu: 1997,
+    bxv: 1998,
+    bxw: 1999,
+    bxx: 2000,
+    bxy: 2001,
+    byz: 2002,
+    bya: 2003,
+    byb: 2004,
+    byc: 2005,
+    byd: 2006,
+    bye: 2007,
+    byf: 2008,
+    byg: 2009,
+    byh: 2010,
+    byi: 2011,
+    byj: 2012,
+    byk: 2013,
+    byl: 2014,
+    bym: 2015,
+    byn: 2016,
+    byo: 2017,
+    byp: 2018,
+    byq: 2019,
+    byr: 2020,
+    bys: 2021,
+    byt: 2022,
+    byu: 2023,
+    byv: 2024,
+    byw: 2025,
+    byx: 2026,
+    byy: 2027,
+    czz: 2028,
+    cza: 2029,
+    czb: 2030,
+    czc: 2031,
+    czd: 2032,
+    cze: 2033,
+    czf: 2034,
+    czg: 2035,
+    czh: 2036,
+    czi: 2037,
+    czj: 2038,
+    czk: 2039,
+    czl: 2040,
+    czm: 2041,
+    czn: 2042,
+    czo: 2043,
+    czp: 2044,
+    czq: 2045,
+    czr: 2046,
+    czs: 2047,
+    czt: 2048,
+    czu: 2049,
+    czv: 2050,
+    czw: 2051,
+    czx: 2052,
+    czy: 2053,
+    caz: 2054,
+    caa: 2055,
+    cab: 2056,
+    cac: 2057,
+    cad: 2058,
+    cae: 2059,
+    caf: 2060,
+    cag: 2061,
+    cah: 2062,
+    cai: 2063,
+    caj: 2064,
+    cak: 2065,
+    cal: 2066,
+    cam: 2067,
+    can: 2068,
+    cao: 2069,
+    cap: 2070,
+    caq: 2071,
+    car: 2072,
+    cas: 2073,
+    cat: 2074,
+    cau: 2075,
+    cav: 2076,
+    caw: 2077,
+    cax: 2078,
+    cay: 2079,
+    cbz: 2080,
+    cba: 2081,
+    cbb: 2082,
+    cbc: 2083,
+    cbd: 2084,
+    cbe: 2085,
+    cbf: 2086,
+    cbg: 2087,
+    cbh: 2088,
+    cbi: 2089,
+    cbj: 2090,
+    cbk: 2091,
+    cbl: 2092,
+    cbm: 2093,
+    cbn: 2094,
+    cbo: 2095,
+    cbp: 2096,
+    cbq: 2097,
+    cbr: 2098,
+    cbs: 2099,
+    cbt: 2100,
+    cbu: 2101,
+    cbv: 2102,
+    cbw: 2103,
+    cbx: 2104,
+    cby: 2105,
+    ccz: 2106,
+    cca: 2107,
+    ccb: 2108,
+    ccc: 2109,
+    ccd: 2110,
+    cce: 2111,
+    ccf: 2112,
+    ccg: 2113,
+    cch: 2114,
+    cci: 2115,
+    ccj: 2116,
+    cck: 2117,
+    ccl: 2118,
+    ccm: 2119,
+    ccn: 2120,
+    cco: 2121,
+    ccp: 2122,
+    ccq: 2123,
+    ccr: 2124,
+    ccs: 2125,
+    cct: 2126,
+    ccu: 2127,
+    ccv: 2128,
+    ccw: 2129,
+    ccx: 2130,
+    ccy: 2131,
+    cdz: 2132,
+    cda: 2133,
+    cdb: 2134,
+    cdc: 2135,
+    cdd: 2136,
+    cde: 2137,
+    cdf: 2138,
+    cdg: 2139,
+    cdh: 2140,
+    cdi: 2141,
+    cdj: 2142,
+    cdk: 2143,
+    cdl: 2144,
+    cdm: 2145,
+    cdn: 2146,
+    cdo: 2147,
+    cdp: 2148,
+    cdq: 2149,
+    cdr: 2150,
+    cds: 2151,
+    cdt: 2152,
+    cdu: 2153,
+    cdv: 2154,
+    cdw: 2155,
+    cdx: 2156,
+    cdy: 2157,
+    cez: 2158,
+    cea: 2159,
+    ceb: 2160,
+    cec: 2161,
+    ced: 2162,
+    cee: 2163,
+    cef: 2164,
+    ceg: 2165,
+    ceh: 2166,
+    cei: 2167,
+    cej: 2168,
+    cek: 2169,
+    cel: 2170,
+    cem: 2171,
+    cen: 2172,
+    ceo: 2173,
+    cep: 2174,
+    ceq: 2175,
+    cer: 2176,
+    ces: 2177,
+    cet: 2178,
+    ceu: 2179,
+    cev: 2180,
+    cew: 2181,
+    cex: 2182,
+    cey: 2183,
+    cfz: 2184,
+    cfa: 2185,
+    cfb: 2186,
+    cfc: 2187,
+    cfd: 2188,
+    cfe: 2189,
+    cff: 2190,
+    cfg: 2191,
+    cfh: 2192,
+    cfi: 2193,
+    cfj: 2194,
+    cfk: 2195,
+    cfl: 2196,
+    cfm: 2197,
+    cfn: 2198,
+    cfo: 2199,
+    cfp: 2200,
+    cfq: 2201,
+    cfr: 2202,
+    cfs: 2203,
+    cft: 2204,
+    cfu: 2205,
+    cfv: 2206,
+    cfw: 2207,
+    cfx: 2208,
+    cfy: 2209,
+    cgz: 2210,
+    cga: 2211,
+    cgb: 2212,
+    cgc: 2213,
+    cgd: 2214,
+    cge: 2215,
+    cgf: 2216,
+    cgg: 2217,
+    cgh: 2218,
+    cgi: 2219,
+    cgj: 2220,
+    cgk: 2221,
+    cgl: 2222,
+    cgm: 2223,
+    cgn: 2224,
+    cgo: 2225,
+    cgp: 2226,
+    cgq: 2227,
+    cgr: 2228,
+    cgs: 2229,
+    cgt: 2230,
+    cgu: 2231,
+    cgv: 2232,
+    cgw: 2233,
+    cgx: 2234,
+    cgy: 2235,
+    chz: 2236,
+    cha: 2237,
+    chb: 2238,
+    chc: 2239,
+    chd: 2240,
+    che: 2241,
+    chf: 2242,
+    chg: 2243,
+    chh: 2244,
+    chi: 2245,
+    chj: 2246,
+    chk: 2247,
+    chl: 2248,
+    chm: 2249,
+    chn: 2250,
+    cho: 2251,
+    chp: 2252,
+    chq: 2253,
+    chr: 2254,
+    chs: 2255,
+    cht: 2256,
+    chu: 2257,
+    chv: 2258,
+    chw: 2259,
+    chx: 2260,
+    chy: 2261,
+    ciz: 2262,
+    cia: 2263,
+    cib: 2264,
+    cic: 2265,
+    cid: 2266,
+    cie: 2267,
+    cif: 2268,
+    cig: 2269,
+    cih: 2270,
+    cii: 2271,
+    cij: 2272,
+    cik: 2273,
+    cil: 2274,
+    cim: 2275,
+    cin: 2276,
+    cio: 2277,
+    cip: 2278,
+    ciq: 2279,
+    cir: 2280,
+    cis: 2281,
+    cit: 2282,
+    ciu: 2283,
+    civ: 2284,
+    ciw: 2285,
+    cix: 2286,
+    ciy: 2287,
+    cjz: 2288,
+    cja: 2289,
+    cjb: 2290,
+    cjc: 2291,
+    cjd: 2292,
+    cje: 2293,
+    cjf: 2294,
+    cjg: 2295,
+    cjh: 2296,
+    cji: 2297,
+    cjj: 2298,
+    cjk: 2299,
+    cjl: 2300,
+    cjm: 2301,
+    cjn: 2302,
+    cjo: 2303,
+    cjp: 2304,
+    cjq: 2305,
+    cjr: 2306,
+    cjs: 2307,
+    cjt: 2308,
+    cju: 2309,
+    cjv: 2310,
+    cjw: 2311,
+    cjx: 2312,
+    cjy: 2313,
+    ckz: 2314,
+    cka: 2315,
+    ckb: 2316,
+    ckc: 2317,
+    ckd: 2318,
+    cke: 2319,
+    ckf: 2320,
+    ckg: 2321,
+    ckh: 2322,
+    cki: 2323,
+    ckj: 2324,
+    ckk: 2325,
+    ckl: 2326,
+    ckm: 2327,
+    ckn: 2328,
+    cko: 2329,
+    ckp: 2330,
+    ckq: 2331,
+    ckr: 2332,
+    cks: 2333,
+    ckt: 2334,
+    cku: 2335,
+    ckv: 2336,
+    ckw: 2337,
+    ckx: 2338,
+    cky: 2339,
+    clz: 2340,
+    cla: 2341,
+    clb: 2342,
+    clc: 2343,
+    cld: 2344,
+    cle: 2345,
+    clf: 2346,
+    clg: 2347,
+    clh: 2348,
+    cli: 2349,
+    clj: 2350,
+    clk: 2351,
+    cll: 2352,
+    clm: 2353,
+    cln: 2354,
+    clo: 2355,
+    clp: 2356,
+    clq: 2357,
+    clr: 2358,
+    cls: 2359,
+    clt: 2360,
+    clu: 2361,
+    clv: 2362,
+    clw: 2363,
+    clx: 2364,
+    cly: 2365,
+    cmz: 2366,
+    cma: 2367,
+    cmb: 2368,
+    cmc: 2369,
+    cmd: 2370,
+    cme: 2371,
+    cmf: 2372,
+    cmg: 2373,
+    cmh: 2374,
+    cmi: 2375,
+    cmj: 2376,
+    cmk: 2377,
+    cml: 2378,
+    cmm: 2379,
+    cmn: 2380,
+    cmo: 2381,
+    cmp: 2382,
+    cmq: 2383,
+    cmr: 2384,
+    cms: 2385,
+    cmt: 2386,
+    cmu: 2387,
+    cmv: 2388,
+    cmw: 2389,
+    cmx: 2390,
+    cmy: 2391,
+    cnz: 2392,
+    cna: 2393,
+    cnb: 2394,
+    cnc: 2395,
+    cnd: 2396,
+    cne: 2397,
+    cnf: 2398,
+    cng: 2399,
+    cnh: 2400,
+    cni: 2401,
+    cnj: 2402,
+    cnk: 2403,
+    cnl: 2404,
+    cnm: 2405,
+    cnn: 2406,
+    cno: 2407,
+    cnp: 2408,
+    cnq: 2409,
+    cnr: 2410,
+    cns: 2411,
+    cnt: 2412,
+    cnu: 2413,
+    cnv: 2414,
+    cnw: 2415,
+    cnx: 2416,
+    cny: 2417,
+    coz: 2418,
+    coa: 2419,
+    cob: 2420,
+    coc: 2421,
+    cod: 2422,
+    coe: 2423,
+    cof: 2424,
+    cog: 2425,
+    coh: 2426,
+    coi: 2427,
+    coj: 2428,
+    cok: 2429,
+    col: 2430,
+    com: 2431,
+    con: 2432,
+    coo: 2433,
+    cop: 2434,
+    coq: 2435,
+    cor: 2436,
+    cos: 2437,
+    cot: 2438,
+    cou: 2439,
+    cov: 2440,
+    cow: 2441,
+    cox: 2442,
+    coy: 2443,
+    cpz: 2444,
+    cpa: 2445,
+    cpb: 2446,
+    cpc: 2447,
+    cpd: 2448,
+    cpe: 2449,
+    cpf: 2450,
+    cpg: 2451,
+    cph: 2452,
+    cpi: 2453,
+    cpj: 2454,
+    cpk: 2455,
+    cpl: 2456,
+    cpm: 2457,
+    cpn: 2458,
+    cpo: 2459,
+    cpp: 2460,
+    cpq: 2461,
+    cpr: 2462,
+    cps: 2463,
+    cpt: 2464,
+    cpu: 2465,
+    cpv: 2466,
+    cpw: 2467,
+    cpx: 2468,
+    cpy: 2469,
+    cqz: 2470,
+    cqa: 2471,
+    cqb: 2472,
+    cqc: 2473,
+    cqd: 2474,
+    cqe: 2475,
+    cqf: 2476,
+    cqg: 2477,
+    cqh: 2478,
+    cqi: 2479,
+    cqj: 2480,
+    cqk: 2481,
+    cql: 2482,
+    cqm: 2483,
+    cqn: 2484,
+    cqo: 2485,
+    cqp: 2486,
+    cqq: 2487,
+    cqr: 2488,
+    cqs: 2489,
+    cqt: 2490,
+    cqu: 2491,
+    cqv: 2492,
+    cqw: 2493,
+    cqx: 2494,
+    cqy: 2495,
+    crz: 2496,
+    cra: 2497,
+    crb: 2498,
+    crc: 2499,
+    crd: 2500,
+    cre: 2501,
+    crf: 2502,
+    crg: 2503,
+    crh: 2504,
+    cri: 2505,
+    crj: 2506,
+    crk: 2507,
+    crl: 2508,
+    crm: 2509,
+    crn: 2510,
+    cro: 2511,
+    crp: 2512,
+    crq: 2513,
+    crr: 2514,
+    crs: 2515,
+    crt: 2516,
+    cru: 2517,
+    crv: 2518,
+    crw: 2519,
+    crx: 2520,
+    cry: 2521,
+    csz: 2522,
+    csa: 2523,
+    csb: 2524,
+    csc: 2525,
+    csd: 2526,
+    cse: 2527,
+    csf: 2528,
+    csg: 2529,
+    csh: 2530,
+    csi: 2531,
+    csj: 2532,
+    csk: 2533,
+    csl: 2534,
+    csm: 2535,
+    csn: 2536,
+    cso: 2537,
+    csp: 2538,
+    csq: 2539,
+    csr: 2540,
+    css: 2541,
+    cst: 2542,
+    csu: 2543,
+    csv: 2544,
+    csw: 2545,
+    csx: 2546,
+    csy: 2547,
+    ctz: 2548,
+    cta: 2549,
+    ctb: 2550,
+    ctc: 2551,
+    ctd: 2552,
+    cte: 2553,
+    ctf: 2554,
+    ctg: 2555,
+    cth: 2556,
+    cti: 2557,
+    ctj: 2558,
+    ctk: 2559,
+    ctl: 2560,
+    ctm: 2561,
+    ctn: 2562,
+    cto: 2563,
+    ctp: 2564,
+    ctq: 2565,
+    ctr: 2566,
+    cts: 2567,
+    ctt: 2568,
+    ctu: 2569,
+    ctv: 2570,
+    ctw: 2571,
+    ctx: 2572,
+    cty: 2573,
+    cuz: 2574,
+    cua: 2575,
+    cub: 2576,
+    cuc: 2577,
+    cud: 2578,
+    cue: 2579,
+    cuf: 2580,
+    cug: 2581,
+    cuh: 2582,
+    cui: 2583,
+    cuj: 2584,
+    cuk: 2585,
+    cul: 2586,
+    cum: 2587,
+    cun: 2588,
+    cuo: 2589,
+    cup: 2590,
+    cuq: 2591,
+    cur: 2592,
+    cus: 2593,
+    cut: 2594,
+    cuu: 2595,
+    cuv: 2596,
+    cuw: 2597,
+    cux: 2598,
+    cuy: 2599,
+    cvz: 2600,
+    cva: 2601,
+    cvb: 2602,
+    cvc: 2603,
+    cvd: 2604,
+    cve: 2605,
+    cvf: 2606,
+    cvg: 2607,
+    cvh: 2608,
+    cvi: 2609,
+    cvj: 2610,
+    cvk: 2611,
+    cvl: 2612,
+    cvm: 2613,
+    cvn: 2614,
+    cvo: 2615,
+    cvp: 2616,
+    cvq: 2617,
+    cvr: 2618,
+    cvs: 2619,
+    cvt: 2620,
+    cvu: 2621,
+    cvv: 2622,
+    cvw: 2623,
+    cvx: 2624,
+    cvy: 2625,
+    cwz: 2626,
+    cwa: 2627,
+    cwb: 2628,
+    cwc: 2629,
+    cwd: 2630,
+    cwe: 2631,
+    cwf: 2632,
+    cwg: 2633,
+    cwh: 2634,
+    cwi: 2635,
+    cwj: 2636,
+    cwk: 2637,
+    cwl: 2638,
+    cwm: 2639,
+    cwn: 2640,
+    cwo: 2641,
+    cwp: 2642,
+    cwq: 2643,
+    cwr: 2644,
+    cws: 2645,
+    cwt: 2646,
+    cwu: 2647,
+    cwv: 2648,
+    cww: 2649,
+    cwx: 2650,
+    cwy: 2651,
+    cxz: 2652,
+    cxa: 2653,
+    cxb: 2654,
+    cxc: 2655,
+    cxd: 2656,
+    cxe: 2657,
+    cxf: 2658,
+    cxg: 2659,
+    cxh: 2660,
+    cxi: 2661,
+    cxj: 2662,
+    cxk: 2663,
+    cxl: 2664,
+    cxm: 2665,
+    cxn: 2666,
+    cxo: 2667,
+    cxp: 2668,
+    cxq: 2669,
+    cxr: 2670,
+    cxs: 2671,
+    cxt: 2672,
+    cxu: 2673,
+    cxv: 2674,
+    cxw: 2675,
+    cxx: 2676,
+    cxy: 2677,
+    cyz: 2678,
+    cya: 2679,
+    cyb: 2680,
+    cyc: 2681,
+    cyd: 2682,
+    cye: 2683,
+    cyf: 2684,
+    cyg: 2685,
+    cyh: 2686,
+    cyi: 2687,
+    cyj: 2688,
+    cyk: 2689,
+    cyl: 2690,
+    cym: 2691,
+    cyn: 2692,
+    cyo: 2693,
+    cyp: 2694,
+    cyq: 2695,
+    cyr: 2696,
+    cys: 2697,
+    cyt: 2698,
+    cyu: 2699,
+    cyv: 2700,
+    cyw: 2701,
+    cyx: 2702,
+    cyy: 2703,
+    dzz: 2704,
+    dza: 2705,
+    dzb: 2706,
+    dzc: 2707,
+    dzd: 2708,
+    dze: 2709,
+    dzf: 2710,
+    dzg: 2711,
+    dzh: 2712,
+    dzi: 2713,
+    dzj: 2714,
+    dzk: 2715,
+    dzl: 2716,
+    dzm: 2717,
+    dzn: 2718,
+    dzo: 2719,
+    dzp: 2720,
+    dzq: 2721,
+    dzr: 2722,
+    dzs: 2723,
+    dzt: 2724,
+    dzu: 2725,
+    dzv: 2726,
+    dzw: 2727,
+    dzx: 2728,
+    dzy: 2729,
+    daz: 2730,
+    daa: 2731,
+    dab: 2732,
+    dac: 2733,
+    dad: 2734,
+    dae: 2735,
+    daf: 2736,
+    dag: 2737,
+    dah: 2738,
+    dai: 2739,
+    daj: 2740,
+    dak: 2741,
+    dal: 2742,
+    dam: 2743,
+    dan: 2744,
+    dao: 2745,
+    dap: 2746,
+    daq: 2747,
+    dar: 2748,
+    das: 2749,
+    dat: 2750,
+    dau: 2751,
+    dav: 2752,
+    daw: 2753,
+    dax: 2754,
+    day: 2755,
+    dbz: 2756,
+    dba: 2757,
+    dbb: 2758,
+    dbc: 2759,
+    dbd: 2760,
+    dbe: 2761,
+    dbf: 2762,
+    dbg: 2763,
+    dbh: 2764,
+    dbi: 2765,
+    dbj: 2766,
+    dbk: 2767,
+    dbl: 2768,
+    dbm: 2769,
+    dbn: 2770,
+    dbo: 2771,
+    dbp: 2772,
+    dbq: 2773,
+    dbr: 2774,
+    dbs: 2775,
+    dbt: 2776,
+    dbu: 2777,
+    dbv: 2778,
+    dbw: 2779,
+    dbx: 2780,
+    dby: 2781,
+    dcz: 2782,
+    dca: 2783,
+    dcb: 2784,
+    dcc: 2785,
+    dcd: 2786,
+    dce: 2787,
+    dcf: 2788,
+    dcg: 2789,
+    dch: 2790,
+    dci: 2791,
+    dcj: 2792,
+    dck: 2793,
+    dcl: 2794,
+    dcm: 2795,
+    dcn: 2796,
+    dco: 2797,
+    dcp: 2798,
+    dcq: 2799,
+    dcr: 2800,
+    dcs: 2801,
+    dct: 2802,
+    dcu: 2803,
+    dcv: 2804,
+    dcw: 2805,
+    dcx: 2806,
+    dcy: 2807,
+    ddz: 2808,
+    dda: 2809,
+    ddb: 2810,
+    ddc: 2811,
+    ddd: 2812,
+    dde: 2813,
+    ddf: 2814,
+    ddg: 2815,
+    ddh: 2816,
+    ddi: 2817,
+    ddj: 2818,
+    ddk: 2819,
+    ddl: 2820,
+    ddm: 2821,
+    ddn: 2822,
+    ddo: 2823,
+    ddp: 2824,
+    ddq: 2825,
+    ddr: 2826,
+    dds: 2827,
+    ddt: 2828,
+    ddu: 2829,
+    ddv: 2830,
+    ddw: 2831,
+    ddx: 2832,
+    ddy: 2833,
+    dez: 2834,
+    dea: 2835,
+    deb: 2836,
+    dec: 2837,
+    ded: 2838,
+    dee: 2839,
+    def: 2840,
+    deg: 2841,
+    deh: 2842,
+    dei: 2843,
+    dej: 2844,
+    dek: 2845,
+    del: 2846,
+    dem: 2847,
+    den: 2848,
+    deo: 2849,
+    dep: 2850,
+    deq: 2851,
+    der: 2852,
+    des: 2853,
+    det: 2854,
+    deu: 2855,
+    dev: 2856,
+    dew: 2857,
+    dex: 2858,
+    dey: 2859,
+    dfz: 2860,
+    dfa: 2861,
+    dfb: 2862,
+    dfc: 2863,
+    dfd: 2864,
+    dfe: 2865,
+    dff: 2866,
+    dfg: 2867,
+    dfh: 2868,
+    dfi: 2869,
+    dfj: 2870,
+    dfk: 2871,
+    dfl: 2872,
+    dfm: 2873,
+    dfn: 2874,
+    dfo: 2875,
+    dfp: 2876,
+    dfq: 2877,
+    dfr: 2878,
+    dfs: 2879,
+    dft: 2880,
+    dfu: 2881,
+    dfv: 2882,
+    dfw: 2883,
+    dfx: 2884,
+    dfy: 2885,
+    dgz: 2886,
+    dga: 2887,
+    dgb: 2888,
+    dgc: 2889,
+    dgd: 2890,
+    dge: 2891,
+    dgf: 2892,
+    dgg: 2893,
+    dgh: 2894,
+    dgi: 2895,
+    dgj: 2896,
+    dgk: 2897,
+    dgl: 2898,
+    dgm: 2899,
+    dgn: 2900,
+    dgo: 2901,
+    dgp: 2902,
+    dgq: 2903,
+    dgr: 2904,
+    dgs: 2905,
+    dgt: 2906,
+    dgu: 2907,
+    dgv: 2908,
+    dgw: 2909,
+    dgx: 2910,
+    dgy: 2911,
+    dhz: 2912,
+    dha: 2913,
+    dhb: 2914,
+    dhc: 2915,
+    dhd: 2916,
+    dhe: 2917,
+    dhf: 2918,
+    dhg: 2919,
+    dhh: 2920,
+    dhi: 2921,
+    dhj: 2922,
+    dhk: 2923,
+    dhl: 2924,
+    dhm: 2925,
+    dhn: 2926,
+    dho: 2927,
+    dhp: 2928,
+    dhq: 2929,
+    dhr: 2930,
+    dhs: 2931,
+    dht: 2932,
+    dhu: 2933,
+    dhv: 2934,
+    dhw: 2935,
+    dhx: 2936,
+    dhy: 2937,
+    diz: 2938,
+    dia: 2939,
+    dib: 2940,
+    dic: 2941,
+    did: 2942,
+    die: 2943,
+    dif: 2944,
+    dig: 2945,
+    dih: 2946,
+    dii: 2947,
+    dij: 2948,
+    dik: 2949,
+    dil: 2950,
+    dim: 2951,
+    din: 2952,
+    dio: 2953,
+    dip: 2954,
+    diq: 2955,
+    dir: 2956,
+    dis: 2957,
+    dit: 2958,
+    diu: 2959,
+    div: 2960,
+    diw: 2961,
+    dix: 2962,
+    diy: 2963,
+    djz: 2964,
+    dja: 2965,
+    djb: 2966,
+    djc: 2967,
+    djd: 2968,
+    dje: 2969,
+    djf: 2970,
+    djg: 2971,
+    djh: 2972,
+    dji: 2973,
+    djj: 2974,
+    djk: 2975,
+    djl: 2976,
+    djm: 2977,
+    djn: 2978,
+    djo: 2979,
+    djp: 2980,
+    djq: 2981,
+    djr: 2982,
+    djs: 2983,
+    djt: 2984,
+    dju: 2985,
+    djv: 2986,
+    djw: 2987,
+    djx: 2988,
+    djy: 2989,
+    dkz: 2990,
+    dka: 2991,
+    dkb: 2992,
+    dkc: 2993,
+    dkd: 2994,
+    dke: 2995,
+    dkf: 2996,
+    dkg: 2997,
+    dkh: 2998,
+    dki: 2999,
+    dkj: 3000,
+    dkk: 3001,
+    dkl: 3002,
+    dkm: 3003,
+    dkn: 3004,
+    dko: 3005,
+    dkp: 3006,
+    dkq: 3007,
+    dkr: 3008,
+    dks: 3009,
+    dkt: 3010,
+    dku: 3011,
+    dkv: 3012,
+    dkw: 3013,
+    dkx: 3014,
+    dky: 3015,
+    dlz: 3016,
+    dla: 3017,
+    dlb: 3018,
+    dlc: 3019,
+    dld: 3020,
+    dle: 3021,
+    dlf: 3022,
+    dlg: 3023,
+    dlh: 3024,
+    dli: 3025,
+    dlj: 3026,
+    dlk: 3027,
+    dll: 3028,
+    dlm: 3029,
+    dln: 3030,
+    dlo: 3031,
+    dlp: 3032,
+    dlq: 3033,
+    dlr: 3034,
+    dls: 3035,
+    dlt: 3036,
+    dlu: 3037,
+    dlv: 3038,
+    dlw: 3039,
+    dlx: 3040,
+    dly: 3041,
+    dmz: 3042,
+    dma: 3043,
+    dmb: 3044,
+    dmc: 3045,
+    dmd: 3046,
+    dme: 3047,
+    dmf: 3048,
+    dmg: 3049,
+    dmh: 3050,
+    dmi: 3051,
+    dmj: 3052,
+    dmk: 3053,
+    dml: 3054,
+    dmm: 3055,
+    dmn: 3056,
+    dmo: 3057,
+    dmp: 3058,
+    dmq: 3059,
+    dmr: 3060,
+    dms: 3061,
+    dmt: 3062,
+    dmu: 3063,
+    dmv: 3064,
+    dmw: 3065,
+    dmx: 3066,
+    dmy: 3067,
+    dnz: 3068,
+    dna: 3069,
+    dnb: 3070,
+    dnc: 3071,
+    dnd: 3072,
+    dne: 3073,
+    dnf: 3074,
+    dng: 3075,
+    dnh: 3076,
+    dni: 3077,
+    dnj: 3078,
+    dnk: 3079,
+    dnl: 3080,
+    dnm: 3081,
+    dnn: 3082,
+    dno: 3083,
+    dnp: 3084,
+    dnq: 3085,
+    dnr: 3086,
+    dns: 3087,
+    dnt: 3088,
+    dnu: 3089,
+    dnv: 3090,
+    dnw: 3091,
+    dnx: 3092,
+    dny: 3093,
+    doz: 3094,
+    doa: 3095,
+    dob: 3096,
+    doc: 3097,
+    dod: 3098,
+    doe: 3099,
+    dof: 3100,
+    dog: 3101,
+    doh: 3102,
+    doi: 3103,
+    doj: 3104,
+    dok: 3105,
+    dol: 3106,
+    dom: 3107,
+    don: 3108,
+    doo: 3109,
+    dop: 3110,
+    doq: 3111,
+    dor: 3112,
+    dos: 3113,
+    dot: 3114,
+    dou: 3115,
+    dov: 3116,
+    dow: 3117,
+    dox: 3118,
+    doy: 3119,
+    dpz: 3120,
+    dpa: 3121,
+    dpb: 3122,
+    dpc: 3123,
+    dpd: 3124,
+    dpe: 3125,
+    dpf: 3126,
+    dpg: 3127,
+    dph: 3128,
+    dpi: 3129,
+    dpj: 3130,
+    dpk: 3131,
+    dpl: 3132,
+    dpm: 3133,
+    dpn: 3134,
+    dpo: 3135,
+    dpp: 3136,
+    dpq: 3137,
+    dpr: 3138,
+    dps: 3139,
+    dpt: 3140,
+    dpu: 3141,
+    dpv: 3142,
+    dpw: 3143,
+    dpx: 3144,
+    dpy: 3145,
+    dqz: 3146,
+    dqa: 3147,
+    dqb: 3148,
+    dqc: 3149,
+    dqd: 3150,
+    dqe: 3151,
+    dqf: 3152,
+    dqg: 3153,
+    dqh: 3154,
+    dqi: 3155,
+    dqj: 3156,
+    dqk: 3157,
+    dql: 3158,
+    dqm: 3159,
+    dqn: 3160,
+    dqo: 3161,
+    dqp: 3162,
+    dqq: 3163,
+    dqr: 3164,
+    dqs: 3165,
+    dqt: 3166,
+    dqu: 3167,
+    dqv: 3168,
+    dqw: 3169,
+    dqx: 3170,
+    dqy: 3171,
+    drz: 3172,
+    dra: 3173,
+    drb: 3174,
+    drc: 3175,
+    drd: 3176,
+    dre: 3177,
+    drf: 3178,
+    drg: 3179,
+    drh: 3180,
+    dri: 3181,
+    drj: 3182,
+    drk: 3183,
+    drl: 3184,
+    drm: 3185,
+    drn: 3186,
+    dro: 3187,
+    drp: 3188,
+    drq: 3189,
+    drr: 3190,
+    drs: 3191,
+    drt: 3192,
+    dru: 3193,
+    drv: 3194,
+    drw: 3195,
+    drx: 3196,
+    dry: 3197,
+    dsz: 3198,
+    dsa: 3199,
+    dsb: 3200,
+    dsc: 3201,
+    dsd: 3202,
+    dse: 3203,
+    dsf: 3204,
+    dsg: 3205,
+    dsh: 3206,
+    dsi: 3207,
+    dsj: 3208,
+    dsk: 3209,
+    dsl: 3210,
+    dsm: 3211,
+    dsn: 3212,
+    dso: 3213,
+    dsp: 3214,
+    dsq: 3215,
+    dsr: 3216,
+    dss: 3217,
+    dst: 3218,
+    dsu: 3219,
+    dsv: 3220,
+    dsw: 3221,
+    dsx: 3222,
+    dsy: 3223,
+    dtz: 3224,
+    dta: 3225,
+    dtb: 3226,
+    dtc: 3227,
+    dtd: 3228,
+    dte: 3229,
+    dtf: 3230,
+    dtg: 3231,
+    dth: 3232,
+    dti: 3233,
+    dtj: 3234,
+    dtk: 3235,
+    dtl: 3236,
+    dtm: 3237,
+    dtn: 3238,
+    dto: 3239,
+    dtp: 3240,
+    dtq: 3241,
+    dtr: 3242,
+    dts: 3243,
+    dtt: 3244,
+    dtu: 3245,
+    dtv: 3246,
+    dtw: 3247,
+    dtx: 3248,
+    dty: 3249,
+    duz: 3250,
+    dua: 3251,
+    dub: 3252,
+    duc: 3253,
+    dud: 3254,
+    due: 3255,
+    duf: 3256,
+    dug: 3257,
+    duh: 3258,
+    dui: 3259,
+    duj: 3260,
+    duk: 3261,
+    dul: 3262,
+    dum: 3263,
+    dun: 3264,
+    duo: 3265,
+    dup: 3266,
+    duq: 3267,
+    dur: 3268,
+    dus: 3269,
+    dut: 3270,
+    duu: 3271,
+    duv: 3272,
+    duw: 3273,
+    dux: 3274,
+    duy: 3275,
+    dvz: 3276,
+    dva: 3277,
+    dvb: 3278,
+    dvc: 3279,
+    dvd: 3280,
+    dve: 3281,
+    dvf: 3282,
+    dvg: 3283,
+    dvh: 3284,
+    dvi: 3285,
+    dvj: 3286,
+    dvk: 3287,
+    dvl: 3288,
+    dvm: 3289,
+    dvn: 3290,
+    dvo: 3291,
+    dvp: 3292,
+    dvq: 3293,
+    dvr: 3294,
+    dvs: 3295,
+    dvt: 3296,
+    dvu: 3297,
+    dvv: 3298,
+    dvw: 3299,
+    dvx: 3300,
+    dvy: 3301,
+    dwz: 3302,
+    dwa: 3303,
+    dwb: 3304,
+    dwc: 3305,
+    dwd: 3306,
+    dwe: 3307,
+    dwf: 3308,
+    dwg: 3309,
+    dwh: 3310,
+    dwi: 3311,
+    dwj: 3312,
+    dwk: 3313,
+    dwl: 3314,
+    dwm: 3315,
+    dwn: 3316,
+    dwo: 3317,
+    dwp: 3318,
+    dwq: 3319,
+    dwr: 3320,
+    dws: 3321,
+    dwt: 3322,
+    dwu: 3323,
+    dwv: 3324,
+    dww: 3325,
+    dwx: 3326,
+    dwy: 3327,
+    dxz: 3328,
+    dxa: 3329,
+    dxb: 3330,
+    dxc: 3331,
+    dxd: 3332,
+    dxe: 3333,
+    dxf: 3334,
+    dxg: 3335,
+    dxh: 3336,
+    dxi: 3337,
+    dxj: 3338,
+    dxk: 3339,
+    dxl: 3340,
+    dxm: 3341,
+    dxn: 3342,
+    dxo: 3343,
+    dxp: 3344,
+    dxq: 3345,
+    dxr: 3346,
+    dxs: 3347,
+    dxt: 3348,
+    dxu: 3349,
+    dxv: 3350,
+    dxw: 3351,
+    dxx: 3352,
+    dxy: 3353,
+    dyz: 3354,
+    dya: 3355,
+    dyb: 3356,
+    dyc: 3357,
+    dyd: 3358,
+    dye: 3359,
+    dyf: 3360,
+    dyg: 3361,
+    dyh: 3362,
+    dyi: 3363,
+    dyj: 3364,
+    dyk: 3365,
+    dyl: 3366,
+    dym: 3367,
+    dyn: 3368,
+    dyo: 3369,
+    dyp: 3370,
+    dyq: 3371,
+    dyr: 3372,
+    dys: 3373,
+    dyt: 3374,
+    dyu: 3375,
+    dyv: 3376,
+    dyw: 3377,
+    dyx: 3378,
+    dyy: 3379,
+    ezz: 3380,
+    eza: 3381,
+    ezb: 3382,
+    ezc: 3383,
+    ezd: 3384,
+    eze: 3385,
+    ezf: 3386,
+    ezg: 3387,
+    ezh: 3388,
+    ezi: 3389,
+    ezj: 3390,
+    ezk: 3391,
+    ezl: 3392,
+    ezm: 3393,
+    ezn: 3394,
+    ezo: 3395,
+    ezp: 3396,
+    ezq: 3397,
+    ezr: 3398,
+    ezs: 3399,
+    ezt: 3400,
+    ezu: 3401,
+    ezv: 3402,
+    ezw: 3403,
+    ezx: 3404,
+    ezy: 3405,
+    eaz: 3406,
+    eaa: 3407,
+    eab: 3408,
+    eac: 3409,
+    ead: 3410,
+    eae: 3411,
+    eaf: 3412,
+    eag: 3413,
+    eah: 3414,
+    eai: 3415,
+    eaj: 3416,
+    eak: 3417,
+    eal: 3418,
+    eam: 3419,
+    ean: 3420,
+    eao: 3421,
+    eap: 3422,
+    eaq: 3423,
+    ear: 3424,
+    eas: 3425,
+    eat: 3426,
+    eau: 3427,
+    eav: 3428,
+    eaw: 3429,
+    eax: 3430,
+    eay: 3431,
+    ebz: 3432,
+    eba: 3433,
+    ebb: 3434,
+    ebc: 3435,
+    ebd: 3436,
+    ebe: 3437,
+    ebf: 3438,
+    ebg: 3439,
+    ebh: 3440,
+    ebi: 3441,
+    ebj: 3442,
+    ebk: 3443,
+    ebl: 3444,
+    ebm: 3445,
+    ebn: 3446,
+    ebo: 3447,
+    ebp: 3448,
+    ebq: 3449,
+    ebr: 3450,
+    ebs: 3451,
+    ebt: 3452,
+    ebu: 3453,
+    ebv: 3454,
+    ebw: 3455,
+    ebx: 3456,
+    eby: 3457,
+    ecz: 3458,
+    eca: 3459,
+    ecb: 3460,
+    ecc: 3461,
+    ecd: 3462,
+    ece: 3463,
+    ecf: 3464,
+    ecg: 3465,
+    ech: 3466,
+    eci: 3467,
+    ecj: 3468,
+    eck: 3469,
+    ecl: 3470,
+    ecm: 3471,
+    ecn: 3472,
+    eco: 3473,
+    ecp: 3474,
+    ecq: 3475,
+    ecr: 3476,
+    ecs: 3477,
+    ect: 3478,
+    ecu: 3479,
+    ecv: 3480,
+    ecw: 3481,
+    ecx: 3482,
+    ecy: 3483,
+    edz: 3484,
+    eda: 3485,
+    edb: 3486,
+    edc: 3487,
+    edd: 3488,
+    ede: 3489,
+    edf: 3490,
+    edg: 3491,
+    edh: 3492,
+    edi: 3493,
+    edj: 3494,
+    edk: 3495,
+    edl: 3496,
+    edm: 3497,
+    edn: 3498,
+    edo: 3499,
+    edp: 3500,
+    edq: 3501,
+    edr: 3502,
+    eds: 3503,
+    edt: 3504,
+    edu: 3505,
+    edv: 3506,
+    edw: 3507,
+    edx: 3508,
+    edy: 3509,
+    eez: 3510,
+    eea: 3511,
+    eeb: 3512,
+    eec: 3513,
+    eed: 3514,
+    eee: 3515,
+    eef: 3516,
+    eeg: 3517,
+    eeh: 3518,
+    eei: 3519,
+    eej: 3520,
+    eek: 3521,
+    eel: 3522,
+    eem: 3523,
+    een: 3524,
+    eeo: 3525,
+    eep: 3526,
+    eeq: 3527,
+    eer: 3528,
+    ees: 3529,
+    eet: 3530,
+    eeu: 3531,
+    eev: 3532,
+    eew: 3533,
+    eex: 3534,
+    eey: 3535,
+    efz: 3536,
+    efa: 3537,
+    efb: 3538,
+    efc: 3539,
+    efd: 3540,
+    efe: 3541,
+    eff: 3542,
+    efg: 3543,
+    efh: 3544,
+    efi: 3545,
+    efj: 3546,
+    efk: 3547,
+    efl: 3548,
+    efm: 3549,
+    efn: 3550,
+    efo: 3551,
+    efp: 3552,
+    efq: 3553,
+    efr: 3554,
+    efs: 3555,
+    eft: 3556,
+    efu: 3557,
+    efv: 3558,
+    efw: 3559,
+    efx: 3560,
+    efy: 3561,
+    egz: 3562,
+    ega: 3563,
+    egb: 3564,
+    egc: 3565,
+    egd: 3566,
+    ege: 3567,
+    egf: 3568,
+    egg: 3569,
+    egh: 3570,
+    egi: 3571,
+    egj: 3572,
+    egk: 3573,
+    egl: 3574,
+    egm: 3575,
+    egn: 3576,
+    ego: 3577,
+    egp: 3578,
+    egq: 3579,
+    egr: 3580,
+    egs: 3581,
+    egt: 3582,
+    egu: 3583,
+    egv: 3584,
+    egw: 3585,
+    egx: 3586,
+    egy: 3587,
+    ehz: 3588,
+    eha: 3589,
+    ehb: 3590,
+    ehc: 3591,
+    ehd: 3592,
+    ehe: 3593,
+    ehf: 3594,
+    ehg: 3595,
+    ehh: 3596,
+    ehi: 3597,
+    ehj: 3598,
+    ehk: 3599,
+    ehl: 3600,
+    ehm: 3601,
+    ehn: 3602,
+    eho: 3603,
+    ehp: 3604,
+    ehq: 3605,
+    ehr: 3606,
+    ehs: 3607,
+    eht: 3608,
+    ehu: 3609,
+    ehv: 3610,
+    ehw: 3611,
+    ehx: 3612,
+    ehy: 3613,
+    eiz: 3614,
+    eia: 3615,
+    eib: 3616,
+    eic: 3617,
+    eid: 3618,
+    eie: 3619,
+    eif: 3620,
+    eig: 3621,
+    eih: 3622,
+    eii: 3623,
+    eij: 3624,
+    eik: 3625,
+    eil: 3626,
+    eim: 3627,
+    ein: 3628,
+    eio: 3629,
+    eip: 3630,
+    eiq: 3631,
+    eir: 3632,
+    eis: 3633,
+    eit: 3634,
+    eiu: 3635,
+    eiv: 3636,
+    eiw: 3637,
+    eix: 3638,
+    eiy: 3639,
+    ejz: 3640,
+    eja: 3641,
+    ejb: 3642,
+    ejc: 3643,
+    ejd: 3644,
+    eje: 3645,
+    ejf: 3646,
+    ejg: 3647,
+    ejh: 3648,
+    eji: 3649,
+    ejj: 3650,
+    ejk: 3651,
+    ejl: 3652,
+    ejm: 3653,
+    ejn: 3654,
+    ejo: 3655,
+    ejp: 3656,
+    ejq: 3657,
+    ejr: 3658,
+    ejs: 3659,
+    ejt: 3660,
+    eju: 3661,
+    ejv: 3662,
+    ejw: 3663,
+    ejx: 3664,
+    ejy: 3665,
+    ekz: 3666,
+    eka: 3667,
+    ekb: 3668,
+    ekc: 3669,
+    ekd: 3670,
+    eke: 3671,
+    ekf: 3672,
+    ekg: 3673,
+    ekh: 3674,
+    eki: 3675,
+    ekj: 3676,
+    ekk: 3677,
+    ekl: 3678,
+    ekm: 3679,
+    ekn: 3680,
+    eko: 3681,
+    ekp: 3682,
+    ekq: 3683,
+    ekr: 3684,
+    eks: 3685,
+    ekt: 3686,
+    eku: 3687,
+    ekv: 3688,
+    ekw: 3689,
+    ekx: 3690,
+    eky: 3691,
+    elz: 3692,
+    ela: 3693,
+    elb: 3694,
+    elc: 3695,
+    eld: 3696,
+    ele: 3697,
+    elf: 3698,
+    elg: 3699,
+    elh: 3700,
+    eli: 3701,
+    elj: 3702,
+    elk: 3703,
+    ell: 3704,
+    elm: 3705,
+    eln: 3706,
+    elo: 3707,
+    elp: 3708,
+    elq: 3709,
+    elr: 3710,
+    els: 3711,
+    elt: 3712,
+    elu: 3713,
+    elv: 3714,
+    elw: 3715,
+    elx: 3716,
+    ely: 3717,
+    emz: 3718,
+    ema: 3719,
+    emb: 3720,
+    emc: 3721,
+    emd: 3722,
+    eme: 3723,
+    emf: 3724,
+    emg: 3725,
+    emh: 3726,
+    emi: 3727,
+    emj: 3728,
+    emk: 3729,
+    eml: 3730,
+    emm: 3731,
+    emn: 3732,
+    emo: 3733,
+    emp: 3734,
+    emq: 3735,
+    emr: 3736,
+    ems: 3737,
+    emt: 3738,
+    emu: 3739,
+    emv: 3740,
+    emw: 3741,
+    emx: 3742,
+    emy: 3743,
+    enz: 3744,
+    ena: 3745,
+    enb: 3746,
+    enc: 3747,
+    end: 3748,
+    ene: 3749,
+    enf: 3750,
+    eng: 3751,
+    enh: 3752,
+    eni: 3753,
+    enj: 3754,
+    enk: 3755,
+    enl: 3756,
+    enm: 3757,
+    enn: 3758,
+    eno: 3759,
+    enp: 3760,
+    enq: 3761,
+    enr: 3762,
+    ens: 3763,
+    ent: 3764,
+    enu: 3765,
+    env: 3766,
+    enw: 3767,
+    enx: 3768,
+    eny: 3769,
+    eoz: 3770,
+    eoa: 3771,
+    eob: 3772,
+    eoc: 3773,
+    eod: 3774,
+    eoe: 3775,
+    eof: 3776,
+    eog: 3777,
+    eoh: 3778,
+    eoi: 3779,
+    eoj: 3780,
+    eok: 3781,
+    eol: 3782,
+    eom: 3783,
+    eon: 3784,
+    eoo: 3785,
+    eop: 3786,
+    eoq: 3787,
+    eor: 3788,
+    eos: 3789,
+    eot: 3790,
+    eou: 3791,
+    eov: 3792,
+    eow: 3793,
+    eox: 3794,
+    eoy: 3795,
+    epz: 3796,
+    epa: 3797,
+    epb: 3798,
+    epc: 3799,
+    epd: 3800,
+    epe: 3801,
+    epf: 3802,
+    epg: 3803,
+    eph: 3804,
+    epi: 3805,
+    epj: 3806,
+    epk: 3807,
+    epl: 3808,
+    epm: 3809,
+    epn: 3810,
+    epo: 3811,
+    epp: 3812,
+    epq: 3813,
+    epr: 3814,
+    eps: 3815,
+    ept: 3816,
+    epu: 3817,
+    epv: 3818,
+    epw: 3819,
+    epx: 3820,
+    epy: 3821,
+    eqz: 3822,
+    eqa: 3823,
+    eqb: 3824,
+    eqc: 3825,
+    eqd: 3826,
+    eqe: 3827,
+    eqf: 3828,
+    eqg: 3829,
+    eqh: 3830,
+    eqi: 3831,
+    eqj: 3832,
+    eqk: 3833,
+    eql: 3834,
+    eqm: 3835,
+    eqn: 3836,
+    eqo: 3837,
+    eqp: 3838,
+    eqq: 3839,
+    eqr: 3840,
+    eqs: 3841,
+    eqt: 3842,
+    equ: 3843,
+    eqv: 3844,
+    eqw: 3845,
+    eqx: 3846,
+    eqy: 3847,
+    erz: 3848,
+    era: 3849,
+    erb: 3850,
+    erc: 3851,
+    erd: 3852,
+    ere: 3853,
+    erf: 3854,
+    erg: 3855,
+    erh: 3856,
+    eri: 3857,
+    erj: 3858,
+    erk: 3859,
+    erl: 3860,
+    erm: 3861,
+    ern: 3862,
+    ero: 3863,
+    erp: 3864,
+    erq: 3865,
+    err: 3866,
+    ers: 3867,
+    ert: 3868,
+    eru: 3869,
+    erv: 3870,
+    erw: 3871,
+    erx: 3872,
+    ery: 3873,
+    esz: 3874,
+    esa: 3875,
+    esb: 3876,
+    esc: 3877,
+    esd: 3878,
+    ese: 3879,
+    esf: 3880,
+    esg: 3881,
+    esh: 3882,
+    esi: 3883,
+    esj: 3884,
+    esk: 3885,
+    esl: 3886,
+    esm: 3887,
+    esn: 3888,
+    eso: 3889,
+    esp: 3890,
+    esq: 3891,
+    esr: 3892,
+    ess: 3893,
+    est: 3894,
+    esu: 3895,
+    esv: 3896,
+    esw: 3897,
+    esx: 3898,
+    esy: 3899,
+    etz: 3900,
+    eta: 3901,
+    etb: 3902,
+    etc: 3903,
+    etd: 3904,
+    ete: 3905,
+    etf: 3906,
+    etg: 3907,
+    eth: 3908,
+    eti: 3909,
+    etj: 3910,
+    etk: 3911,
+    etl: 3912,
+    etm: 3913,
+    etn: 3914,
+    eto: 3915,
+    etp: 3916,
+    etq: 3917,
+    etr: 3918,
+    ets: 3919,
+    ett: 3920,
+    etu: 3921,
+    etv: 3922,
+    etw: 3923,
+    etx: 3924,
+    ety: 3925,
+    euz: 3926,
+    eua: 3927,
+    eub: 3928,
+    euc: 3929,
+    eud: 3930,
+    eue: 3931,
+    euf: 3932,
+    eug: 3933,
+    euh: 3934,
+    eui: 3935,
+    euj: 3936,
+    euk: 3937,
+    eul: 3938,
+    eum: 3939,
+    eun: 3940,
+    euo: 3941,
+    eup: 3942,
+    euq: 3943,
+    eur: 3944,
+    eus: 3945,
+    eut: 3946,
+    euu: 3947,
+    euv: 3948,
+    euw: 3949,
+    eux: 3950,
+    euy: 3951,
+    evz: 3952,
+    eva: 3953,
+    evb: 3954,
+    evc: 3955,
+    evd: 3956,
+    eve: 3957,
+    evf: 3958,
+    evg: 3959,
+    evh: 3960,
+    evi: 3961,
+    evj: 3962,
+    evk: 3963,
+    evl: 3964,
+    evm: 3965,
+    evn: 3966,
+    evo: 3967,
+    evp: 3968,
+    evq: 3969,
+    evr: 3970,
+    evs: 3971,
+    evt: 3972,
+    evu: 3973,
+    evv: 3974,
+    evw: 3975,
+    evx: 3976,
+    evy: 3977,
+    ewz: 3978,
+    ewa: 3979,
+    ewb: 3980,
+    ewc: 3981,
+    ewd: 3982,
+    ewe: 3983,
+    ewf: 3984,
+    ewg: 3985,
+    ewh: 3986,
+    ewi: 3987,
+    ewj: 3988,
+    ewk: 3989,
+    ewl: 3990,
+    ewm: 3991,
+    ewn: 3992,
+    ewo: 3993,
+    ewp: 3994,
+    ewq: 3995,
+    ewr: 3996,
+    ews: 3997,
+    ewt: 3998,
+    ewu: 3999,
+    ewv: 4000,
+    eww: 4001,
+    ewx: 4002,
+    ewy: 4003,
+    exz: 4004,
+    exa: 4005,
+    exb: 4006,
+    exc: 4007,
+    exd: 4008,
+    exe: 4009,
+    exf: 4010,
+    exg: 4011,
+    exh: 4012,
+    exi: 4013,
+    exj: 4014,
+    exk: 4015,
+    exl: 4016,
+    exm: 4017,
+    exn: 4018,
+    exo: 4019,
+    exp: 4020,
+    exq: 4021,
+    exr: 4022,
+    exs: 4023,
+    ext: 4024,
+    exu: 4025,
+    exv: 4026,
+    exw: 4027,
+    exx: 4028,
+    exy: 4029,
+    eyz: 4030,
+    eya: 4031,
+    eyb: 4032,
+    eyc: 4033,
+    eyd: 4034,
+    eye: 4035,
+    eyf: 4036,
+    eyg: 4037,
+    eyh: 4038,
+    eyi: 4039,
+    eyj: 4040,
+    eyk: 4041,
+    eyl: 4042,
+    eym: 4043,
+    eyn: 4044,
+    eyo: 4045,
+    eyp: 4046,
+    eyq: 4047,
+    eyr: 4048,
+    eys: 4049,
+    eyt: 4050,
+    eyu: 4051,
+    eyv: 4052,
+    eyw: 4053,
+    eyx: 4054,
+    eyy: 4055,
+    fzz: 4056,
+    fza: 4057,
+    fzb: 4058,
+    fzc: 4059,
+    fzd: 4060,
+    fze: 4061,
+    fzf: 4062,
+    fzg: 4063,
+    fzh: 4064,
+    fzi: 4065,
+    fzj: 4066,
+    fzk: 4067,
+    fzl: 4068,
+    fzm: 4069,
+    fzn: 4070,
+    fzo: 4071,
+    fzp: 4072,
+    fzq: 4073,
+    fzr: 4074,
+    fzs: 4075,
+    fzt: 4076,
+    fzu: 4077,
+    fzv: 4078,
+    fzw: 4079,
+    fzx: 4080,
+    fzy: 4081,
+    faz: 4082,
+    faa: 4083,
+    fab: 4084,
+    fac: 4085,
+    fad: 4086,
+    fae: 4087,
+    faf: 4088,
+    fag: 4089,
+    fah: 4090,
+    fai: 4091,
+    faj: 4092,
+    fak: 4093,
+    fal: 4094,
+    fam: 4095,
+    fan: 4096,
+    fao: 4097,
+    fap: 4098,
+    faq: 4099,
+    far: 4100,
+    fas: 4101,
+    fat: 4102,
+    fau: 4103,
+    fav: 4104,
+    faw: 4105,
+    fax: 4106,
+    fay: 4107,
+    fbz: 4108,
+    fba: 4109,
+    fbb: 4110,
+    fbc: 4111,
+    fbd: 4112,
+    fbe: 4113,
+    fbf: 4114,
+    fbg: 4115,
+    fbh: 4116,
+    fbi: 4117,
+    fbj: 4118,
+    fbk: 4119,
+    fbl: 4120,
+    fbm: 4121,
+    fbn: 4122,
+    fbo: 4123,
+    fbp: 4124,
+    fbq: 4125,
+    fbr: 4126,
+    fbs: 4127,
+    fbt: 4128,
+    fbu: 4129,
+    fbv: 4130,
+    fbw: 4131,
+    fbx: 4132,
+    fby: 4133,
+    fcz: 4134,
+    fca: 4135,
+    fcb: 4136,
+    fcc: 4137,
+    fcd: 4138,
+    fce: 4139,
+    fcf: 4140,
+    fcg: 4141,
+    fch: 4142,
+    fci: 4143,
+    fcj: 4144,
+    fck: 4145,
+    fcl: 4146,
+    fcm: 4147,
+    fcn: 4148,
+    fco: 4149,
+    fcp: 4150,
+    fcq: 4151,
+    fcr: 4152,
+    fcs: 4153,
+    fct: 4154,
+    fcu: 4155,
+    fcv: 4156,
+    fcw: 4157,
+    fcx: 4158,
+    fcy: 4159,
+    fdz: 4160,
+    fda: 4161,
+    fdb: 4162,
+    fdc: 4163,
+    fdd: 4164,
+    fde: 4165,
+    fdf: 4166,
+    fdg: 4167,
+    fdh: 4168,
+    fdi: 4169,
+    fdj: 4170,
+    fdk: 4171,
+    fdl: 4172,
+    fdm: 4173,
+    fdn: 4174,
+    fdo: 4175,
+    fdp: 4176,
+    fdq: 4177,
+    fdr: 4178,
+    fds: 4179,
+    fdt: 4180,
+    fdu: 4181,
+    fdv: 4182,
+    fdw: 4183,
+    fdx: 4184,
+    fdy: 4185,
+    fez: 4186,
+    fea: 4187,
+    feb: 4188,
+    fec: 4189,
+    fed: 4190,
+    fee: 4191,
+    fef: 4192,
+    feg: 4193,
+    feh: 4194,
+    fei: 4195,
+    fej: 4196,
+    fek: 4197,
+    fel: 4198,
+    fem: 4199,
+    fen: 4200,
+    feo: 4201,
+    fep: 4202,
+    feq: 4203,
+    fer: 4204,
+    fes: 4205,
+    fet: 4206,
+    feu: 4207,
+    fev: 4208,
+    few: 4209,
+    fex: 4210,
+    fey: 4211,
+    ffz: 4212,
+    ffa: 4213,
+    ffb: 4214,
+    ffc: 4215,
+    ffd: 4216,
+    ffe: 4217,
+    fff: 4218,
+    ffg: 4219,
+    ffh: 4220,
+    ffi: 4221,
+    ffj: 4222,
+    ffk: 4223,
+    ffl: 4224,
+    ffm: 4225,
+    ffn: 4226,
+    ffo: 4227,
+    ffp: 4228,
+    ffq: 4229,
+    ffr: 4230,
+    ffs: 4231,
+    fft: 4232,
+    ffu: 4233,
+    ffv: 4234,
+    ffw: 4235,
+    ffx: 4236,
+    ffy: 4237,
+    fgz: 4238,
+    fga: 4239,
+    fgb: 4240,
+    fgc: 4241,
+    fgd: 4242,
+    fge: 4243,
+    fgf: 4244,
+    fgg: 4245,
+    fgh: 4246,
+    fgi: 4247,
+    fgj: 4248,
+    fgk: 4249,
+    fgl: 4250,
+    fgm: 4251,
+    fgn: 4252,
+    fgo: 4253,
+    fgp: 4254,
+    fgq: 4255,
+    fgr: 4256,
+    fgs: 4257,
+    fgt: 4258,
+    fgu: 4259,
+    fgv: 4260,
+    fgw: 4261,
+    fgx: 4262,
+    fgy: 4263,
+    fhz: 4264,
+    fha: 4265,
+    fhb: 4266,
+    fhc: 4267,
+    fhd: 4268,
+    fhe: 4269,
+    fhf: 4270,
+    fhg: 4271,
+    fhh: 4272,
+    fhi: 4273,
+    fhj: 4274,
+    fhk: 4275,
+    fhl: 4276,
+    fhm: 4277,
+    fhn: 4278,
+    fho: 4279,
+    fhp: 4280,
+    fhq: 4281,
+    fhr: 4282,
+    fhs: 4283,
+    fht: 4284,
+    fhu: 4285,
+    fhv: 4286,
+    fhw: 4287,
+    fhx: 4288,
+    fhy: 4289,
+    fiz: 4290,
+    fia: 4291,
+    fib: 4292,
+    fic: 4293,
+    fid: 4294,
+    fie: 4295,
+    fif: 4296,
+    fig: 4297,
+    fih: 4298,
+    fii: 4299,
+    fij: 4300,
+    fik: 4301,
+    fil: 4302,
+    fim: 4303,
+    fin: 4304,
+    fio: 4305,
+    fip: 4306,
+    fiq: 4307,
+    fir: 4308,
+    fis: 4309,
+    fit: 4310,
+    fiu: 4311,
+    fiv: 4312,
+    fiw: 4313,
+    fix: 4314,
+    fiy: 4315,
+    fjz: 4316,
+    fja: 4317,
+    fjb: 4318,
+    fjc: 4319,
+    fjd: 4320,
+    fje: 4321,
+    fjf: 4322,
+    fjg: 4323,
+    fjh: 4324,
+    fji: 4325,
+    fjj: 4326,
+    fjk: 4327,
+    fjl: 4328,
+    fjm: 4329,
+    fjn: 4330,
+    fjo: 4331,
+    fjp: 4332,
+    fjq: 4333,
+    fjr: 4334,
+    fjs: 4335,
+    fjt: 4336,
+    fju: 4337,
+    fjv: 4338,
+    fjw: 4339,
+    fjx: 4340,
+    fjy: 4341,
+    fkz: 4342,
+    fka: 4343,
+    fkb: 4344,
+    fkc: 4345,
+    fkd: 4346,
+    fke: 4347,
+    fkf: 4348,
+    fkg: 4349,
+    fkh: 4350,
+    fki: 4351,
+    fkj: 4352,
+    fkk: 4353,
+    fkl: 4354,
+    fkm: 4355,
+    fkn: 4356,
+    fko: 4357,
+    fkp: 4358,
+    fkq: 4359,
+    fkr: 4360,
+    fks: 4361,
+    fkt: 4362,
+    fku: 4363,
+    fkv: 4364,
+    fkw: 4365,
+    fkx: 4366,
+    fky: 4367,
+    flz: 4368,
+    fla: 4369,
+    flb: 4370,
+    flc: 4371,
+    fld: 4372,
+    fle: 4373,
+    flf: 4374,
+    flg: 4375,
+    flh: 4376,
+    fli: 4377,
+    flj: 4378,
+    flk: 4379,
+    fll: 4380,
+    flm: 4381,
+    fln: 4382,
+    flo: 4383,
+    flp: 4384,
+    flq: 4385,
+    flr: 4386,
+    fls: 4387,
+    flt: 4388,
+    flu: 4389,
+    flv: 4390,
+    flw: 4391,
+    flx: 4392,
+    fly: 4393,
+    fmz: 4394,
+    fma: 4395,
+    fmb: 4396,
+    fmc: 4397,
+    fmd: 4398,
+    fme: 4399,
+    fmf: 4400,
+    fmg: 4401,
+    fmh: 4402,
+    fmi: 4403,
+    fmj: 4404,
+    fmk: 4405,
+    fml: 4406,
+    fmm: 4407,
+    fmn: 4408,
+    fmo: 4409,
+    fmp: 4410,
+    fmq: 4411,
+    fmr: 4412,
+    fms: 4413,
+    fmt: 4414,
+    fmu: 4415,
+    fmv: 4416,
+    fmw: 4417,
+    fmx: 4418,
+    fmy: 4419,
+    fnz: 4420,
+    fna: 4421,
+    fnb: 4422,
+    fnc: 4423,
+    fnd: 4424,
+    fne: 4425,
+    fnf: 4426,
+    fng: 4427,
+    fnh: 4428,
+    fni: 4429,
+    fnj: 4430,
+    fnk: 4431,
+    fnl: 4432,
+    fnm: 4433,
+    fnn: 4434,
+    fno: 4435,
+    fnp: 4436,
+    fnq: 4437,
+    fnr: 4438,
+    fns: 4439,
+    fnt: 4440,
+    fnu: 4441,
+    fnv: 4442,
+    fnw: 4443,
+    fnx: 4444,
+    fny: 4445,
+    foz: 4446,
+    foa: 4447,
+    fob: 4448,
+    foc: 4449,
+    fod: 4450,
+    foe: 4451,
+    fof: 4452,
+    fog: 4453,
+    foh: 4454,
+    foi: 4455,
+    foj: 4456,
+    fok: 4457,
+    fol: 4458,
+    fom: 4459,
+    fon: 4460,
+    foo: 4461,
+    fop: 4462,
+    foq: 4463,
+    for: 4464,
+    fos: 4465,
+    fot: 4466,
+    fou: 4467,
+    fov: 4468,
+    fow: 4469,
+    fox: 4470,
+    foy: 4471,
+    fpz: 4472,
+    fpa: 4473,
+    fpb: 4474,
+    fpc: 4475,
+    fpd: 4476,
+    fpe: 4477,
+    fpf: 4478,
+    fpg: 4479,
+    fph: 4480,
+    fpi: 4481,
+    fpj: 4482,
+    fpk: 4483,
+    fpl: 4484,
+    fpm: 4485,
+    fpn: 4486,
+    fpo: 4487,
+    fpp: 4488,
+    fpq: 4489,
+    fpr: 4490,
+    fps: 4491,
+    fpt: 4492,
+    fpu: 4493,
+    fpv: 4494,
+    fpw: 4495,
+    fpx: 4496,
+    fpy: 4497,
+    fqz: 4498,
+    fqa: 4499,
+    fqb: 4500,
+    fqc: 4501,
+    fqd: 4502,
+    fqe: 4503,
+    fqf: 4504,
+    fqg: 4505,
+    fqh: 4506,
+    fqi: 4507,
+    fqj: 4508,
+    fqk: 4509,
+    fql: 4510,
+    fqm: 4511,
+    fqn: 4512,
+    fqo: 4513,
+    fqp: 4514,
+    fqq: 4515,
+    fqr: 4516,
+    fqs: 4517,
+    fqt: 4518,
+    fqu: 4519,
+    fqv: 4520,
+    fqw: 4521,
+    fqx: 4522,
+    fqy: 4523,
+    frz: 4524,
+    fra: 4525,
+    frb: 4526,
+    frc: 4527,
+    frd: 4528,
+    fre: 4529,
+    frf: 4530,
+    frg: 4531,
+    frh: 4532,
+    fri: 4533,
+    frj: 4534,
+    frk: 4535,
+    frl: 4536,
+    frm: 4537,
+    frn: 4538,
+    fro: 4539,
+    frp: 4540,
+    frq: 4541,
+    frr: 4542,
+    frs: 4543,
+    frt: 4544,
+    fru: 4545,
+    frv: 4546,
+    frw: 4547,
+    frx: 4548,
+    fry: 4549,
+    fsz: 4550,
+    fsa: 4551,
+    fsb: 4552,
+    fsc: 4553,
+    fsd: 4554,
+    fse: 4555,
+    fsf: 4556,
+    fsg: 4557,
+    fsh: 4558,
+    fsi: 4559,
+    fsj: 4560,
+    fsk: 4561,
+    fsl: 4562,
+    fsm: 4563,
+    fsn: 4564,
+    fso: 4565,
+    fsp: 4566,
+    fsq: 4567,
+    fsr: 4568,
+    fss: 4569,
+    fst: 4570,
+    fsu: 4571,
+    fsv: 4572,
+    fsw: 4573,
+    fsx: 4574,
+    fsy: 4575,
+    ftz: 4576,
+    fta: 4577,
+    ftb: 4578,
+    ftc: 4579,
+    ftd: 4580,
+    fte: 4581,
+    ftf: 4582,
+    ftg: 4583,
+    fth: 4584,
+    fti: 4585,
+    ftj: 4586,
+    ftk: 4587,
+    ftl: 4588,
+    ftm: 4589,
+    ftn: 4590,
+    fto: 4591,
+    ftp: 4592,
+    ftq: 4593,
+    ftr: 4594,
+    fts: 4595,
+    ftt: 4596,
+    ftu: 4597,
+    ftv: 4598,
+    ftw: 4599,
+    ftx: 4600,
+    fty: 4601,
+    fuz: 4602,
+    fua: 4603,
+    fub: 4604,
+    fuc: 4605,
+    fud: 4606,
+    fue: 4607,
+    fuf: 4608,
+    fug: 4609,
+    fuh: 4610,
+    fui: 4611,
+    fuj: 4612,
+    fuk: 4613,
+    ful: 4614,
+    fum: 4615,
+    fun: 4616,
+    fuo: 4617,
+    fup: 4618,
+    fuq: 4619,
+    fur: 4620,
+    fus: 4621,
+    fut: 4622,
+    fuu: 4623,
+    fuv: 4624,
+    fuw: 4625,
+    fux: 4626,
+    fuy: 4627,
+    fvz: 4628,
+    fva: 4629,
+    fvb: 4630,
+    fvc: 4631,
+    fvd: 4632,
+    fve: 4633,
+    fvf: 4634,
+    fvg: 4635,
+    fvh: 4636,
+    fvi: 4637,
+    fvj: 4638,
+    fvk: 4639,
+    fvl: 4640,
+    fvm: 4641,
+    fvn: 4642,
+    fvo: 4643,
+    fvp: 4644,
+    fvq: 4645,
+    fvr: 4646,
+    fvs: 4647,
+    fvt: 4648,
+    fvu: 4649,
+    fvv: 4650,
+    fvw: 4651,
+    fvx: 4652,
+    fvy: 4653,
+    fwz: 4654,
+    fwa: 4655,
+    fwb: 4656,
+    fwc: 4657,
+    fwd: 4658,
+    fwe: 4659,
+    fwf: 4660,
+    fwg: 4661,
+    fwh: 4662,
+    fwi: 4663,
+    fwj: 4664,
+    fwk: 4665,
+    fwl: 4666,
+    fwm: 4667,
+    fwn: 4668,
+    fwo: 4669,
+    fwp: 4670,
+    fwq: 4671,
+    fwr: 4672,
+    fws: 4673,
+    fwt: 4674,
+    fwu: 4675,
+    fwv: 4676,
+    fww: 4677,
+    fwx: 4678,
+    fwy: 4679,
+    fxz: 4680,
+    fxa: 4681,
+    fxb: 4682,
+    fxc: 4683,
+    fxd: 4684,
+    fxe: 4685,
+    fxf: 4686,
+    fxg: 4687,
+    fxh: 4688,
+    fxi: 4689,
+    fxj: 4690,
+    fxk: 4691,
+    fxl: 4692,
+    fxm: 4693,
+    fxn: 4694,
+    fxo: 4695,
+    fxp: 4696,
+    fxq: 4697,
+    fxr: 4698,
+    fxs: 4699,
+    fxt: 4700,
+    fxu: 4701,
+    fxv: 4702,
+    fxw: 4703,
+    fxx: 4704,
+    fxy: 4705,
+    fyz: 4706,
+    fya: 4707,
+    fyb: 4708,
+    fyc: 4709,
+    fyd: 4710,
+    fye: 4711,
+    fyf: 4712,
+    fyg: 4713,
+    fyh: 4714,
+    fyi: 4715,
+    fyj: 4716,
+    fyk: 4717,
+    fyl: 4718,
+    fym: 4719,
+    fyn: 4720,
+    fyo: 4721,
+    fyp: 4722,
+    fyq: 4723,
+    fyr: 4724,
+    fys: 4725,
+    fyt: 4726,
+    fyu: 4727,
+    fyv: 4728,
+    fyw: 4729,
+    fyx: 4730,
+    fyy: 4731,
+    gzz: 4732,
+    gza: 4733,
+    gzb: 4734,
+    gzc: 4735,
+    gzd: 4736,
+    gze: 4737,
+    gzf: 4738,
+    gzg: 4739,
+    gzh: 4740,
+    gzi: 4741,
+    gzj: 4742,
+    gzk: 4743,
+    gzl: 4744,
+    gzm: 4745,
+    gzn: 4746,
+    gzo: 4747,
+    gzp: 4748,
+    gzq: 4749,
+    gzr: 4750,
+    gzs: 4751,
+    gzt: 4752,
+    gzu: 4753,
+    gzv: 4754,
+    gzw: 4755,
+    gzx: 4756,
+    gzy: 4757,
+    gaz: 4758,
+    gaa: 4759,
+    gab: 4760,
+    gac: 4761,
+    gad: 4762,
+    gae: 4763,
+    gaf: 4764,
+    gag: 4765,
+    gah: 4766,
+    gai: 4767,
+    gaj: 4768,
+    gak: 4769,
+    gal: 4770,
+    gam: 4771,
+    gan: 4772,
+    gao: 4773,
+    gap: 4774,
+    gaq: 4775,
+    gar: 4776,
+    gas: 4777,
+    gat: 4778,
+    gau: 4779,
+    gav: 4780,
+    gaw: 4781,
+    gax: 4782,
+    gay: 4783,
+    gbz: 4784,
+    gba: 4785,
+    gbb: 4786,
+    gbc: 4787,
+    gbd: 4788,
+    gbe: 4789,
+    gbf: 4790,
+    gbg: 4791,
+    gbh: 4792,
+    gbi: 4793,
+    gbj: 4794,
+    gbk: 4795,
+    gbl: 4796,
+    gbm: 4797,
+    gbn: 4798,
+    gbo: 4799,
+    gbp: 4800,
+    gbq: 4801,
+    gbr: 4802,
+    gbs: 4803,
+    gbt: 4804,
+    gbu: 4805,
+    gbv: 4806,
+    gbw: 4807,
+    gbx: 4808,
+    gby: 4809,
+    gcz: 4810,
+    gca: 4811,
+    gcb: 4812,
+    gcc: 4813,
+    gcd: 4814,
+    gce: 4815,
+    gcf: 4816,
+    gcg: 4817,
+    gch: 4818,
+    gci: 4819,
+    gcj: 4820,
+    gck: 4821,
+    gcl: 4822,
+    gcm: 4823,
+    gcn: 4824,
+    gco: 4825,
+    gcp: 4826,
+    gcq: 4827,
+    gcr: 4828,
+    gcs: 4829,
+    gct: 4830,
+    gcu: 4831,
+    gcv: 4832,
+    gcw: 4833,
+    gcx: 4834,
+    gcy: 4835,
+    gdz: 4836,
+    gda: 4837,
+    gdb: 4838,
+    gdc: 4839,
+    gdd: 4840,
+    gde: 4841,
+    gdf: 4842,
+    gdg: 4843,
+    gdh: 4844,
+    gdi: 4845,
+    gdj: 4846,
+    gdk: 4847,
+    gdl: 4848,
+    gdm: 4849,
+    gdn: 4850,
+    gdo: 4851,
+    gdp: 4852,
+    gdq: 4853,
+    gdr: 4854,
+    gds: 4855,
+    gdt: 4856,
+    gdu: 4857,
+    gdv: 4858,
+    gdw: 4859,
+    gdx: 4860,
+    gdy: 4861,
+    gez: 4862,
+    gea: 4863,
+    geb: 4864,
+    gec: 4865,
+    ged: 4866,
+    gee: 4867,
+    gef: 4868,
+    geg: 4869,
+    geh: 4870,
+    gei: 4871,
+    gej: 4872,
+    gek: 4873,
+    gel: 4874,
+    gem: 4875,
+    gen: 4876,
+    geo: 4877,
+    gep: 4878,
+    geq: 4879,
+    ger: 4880,
+    ges: 4881,
+    get: 4882,
+    geu: 4883,
+    gev: 4884,
+    gew: 4885,
+    gex: 4886,
+    gey: 4887,
+    gfz: 4888,
+    gfa: 4889,
+    gfb: 4890,
+    gfc: 4891,
+    gfd: 4892,
+    gfe: 4893,
+    gff: 4894,
+    gfg: 4895,
+    gfh: 4896,
+    gfi: 4897,
+    gfj: 4898,
+    gfk: 4899,
+    gfl: 4900,
+    gfm: 4901,
+    gfn: 4902,
+    gfo: 4903,
+    gfp: 4904,
+    gfq: 4905,
+    gfr: 4906,
+    gfs: 4907,
+    gft: 4908,
+    gfu: 4909,
+    gfv: 4910,
+    gfw: 4911,
+    gfx: 4912,
+    gfy: 4913,
+    ggz: 4914,
+    gga: 4915,
+    ggb: 4916,
+    ggc: 4917,
+    ggd: 4918,
+    gge: 4919,
+    ggf: 4920,
+    ggg: 4921,
+    ggh: 4922,
+    ggi: 4923,
+    ggj: 4924,
+    ggk: 4925,
+    ggl: 4926,
+    ggm: 4927,
+    ggn: 4928,
+    ggo: 4929,
+    ggp: 4930,
+    ggq: 4931,
+    ggr: 4932,
+    ggs: 4933,
+    ggt: 4934,
+    ggu: 4935,
+    ggv: 4936,
+    ggw: 4937,
+    ggx: 4938,
+    ggy: 4939,
+    ghz: 4940,
+    gha: 4941,
+    ghb: 4942,
+    ghc: 4943,
+    ghd: 4944,
+    ghe: 4945,
+    ghf: 4946,
+    ghg: 4947,
+    ghh: 4948,
+    ghi: 4949,
+    ghj: 4950,
+    ghk: 4951,
+    ghl: 4952,
+    ghm: 4953,
+    ghn: 4954,
+    gho: 4955,
+    ghp: 4956,
+    ghq: 4957,
+    ghr: 4958,
+    ghs: 4959,
+    ght: 4960,
+    ghu: 4961,
+    ghv: 4962,
+    ghw: 4963,
+    ghx: 4964,
+    ghy: 4965,
+    giz: 4966,
+    gia: 4967,
+    gib: 4968,
+    gic: 4969,
+    gid: 4970,
+    gie: 4971,
+    gif: 4972,
+    gig: 4973,
+    gih: 4974,
+    gii: 4975,
+    gij: 4976,
+    gik: 4977,
+    gil: 4978,
+    gim: 4979,
+    gin: 4980,
+    gio: 4981,
+    gip: 4982,
+    giq: 4983,
+    gir: 4984,
+    gis: 4985,
+    git: 4986,
+    giu: 4987,
+    giv: 4988,
+    giw: 4989,
+    gix: 4990,
+    giy: 4991,
+    gjz: 4992,
+    gja: 4993,
+    gjb: 4994,
+    gjc: 4995,
+    gjd: 4996,
+    gje: 4997,
+    gjf: 4998,
+    gjg: 4999,
+    gjh: 5000,
+    gji: 5001,
+    gjj: 5002,
+    gjk: 5003,
+    gjl: 5004,
+    gjm: 5005,
+    gjn: 5006,
+    gjo: 5007,
+    gjp: 5008,
+    gjq: 5009,
+    gjr: 5010,
+    gjs: 5011,
+    gjt: 5012,
+    gju: 5013,
+    gjv: 5014,
+    gjw: 5015,
+    gjx: 5016,
+    gjy: 5017,
+    gkz: 5018,
+    gka: 5019,
+    gkb: 5020,
+    gkc: 5021,
+    gkd: 5022,
+    gke: 5023,
+    gkf: 5024,
+    gkg: 5025,
+    gkh: 5026,
+    gki: 5027,
+    gkj: 5028,
+    gkk: 5029,
+    gkl: 5030,
+    gkm: 5031,
+    gkn: 5032,
+    gko: 5033,
+    gkp: 5034,
+    gkq: 5035,
+    gkr: 5036,
+    gks: 5037,
+    gkt: 5038,
+    gku: 5039,
+    gkv: 5040,
+    gkw: 5041,
+    gkx: 5042,
+    gky: 5043,
+    glz: 5044,
+    gla: 5045,
+    glb: 5046,
+    glc: 5047,
+    gld: 5048,
+    gle: 5049,
+    glf: 5050,
+    glg: 5051,
+    glh: 5052,
+    gli: 5053,
+    glj: 5054,
+    glk: 5055,
+    gll: 5056,
+    glm: 5057,
+    gln: 5058,
+    glo: 5059,
+    glp: 5060,
+    glq: 5061,
+    glr: 5062,
+    gls: 5063,
+    glt: 5064,
+    glu: 5065,
+    glv: 5066,
+    glw: 5067,
+    glx: 5068,
+    gly: 5069,
+    gmz: 5070,
+    gma: 5071,
+    gmb: 5072,
+    gmc: 5073,
+    gmd: 5074,
+    gme: 5075,
+    gmf: 5076,
+    gmg: 5077,
+    gmh: 5078,
+    gmi: 5079,
+    gmj: 5080,
+    gmk: 5081,
+    gml: 5082,
+    gmm: 5083,
+    gmn: 5084,
+    gmo: 5085,
+    gmp: 5086,
+    gmq: 5087,
+    gmr: 5088,
+    gms: 5089,
+    gmt: 5090,
+    gmu: 5091,
+    gmv: 5092,
+    gmw: 5093,
+    gmx: 5094,
+    gmy: 5095,
+    gnz: 5096,
+    gna: 5097,
+    gnb: 5098,
+    gnc: 5099,
+    gnd: 5100,
+    gne: 5101,
+    gnf: 5102,
+    gng: 5103,
+    gnh: 5104,
+    gni: 5105,
+    gnj: 5106,
+    gnk: 5107,
+    gnl: 5108,
+    gnm: 5109,
+    gnn: 5110,
+    gno: 5111,
+    gnp: 5112,
+    gnq: 5113,
+    gnr: 5114,
+    gns: 5115,
+    gnt: 5116,
+    gnu: 5117,
+    gnv: 5118,
+    gnw: 5119,
+    gnx: 5120,
+    gny: 5121,
+    goz: 5122,
+    goa: 5123,
+    gob: 5124,
+    goc: 5125,
+    god: 5126,
+    goe: 5127,
+    gof: 5128,
+    gog: 5129,
+    goh: 5130,
+    goi: 5131,
+    goj: 5132,
+    gok: 5133,
+    gol: 5134,
+    gom: 5135,
+    gon: 5136,
+    goo: 5137,
+    gop: 5138,
+    goq: 5139,
+    gor: 5140,
+    gos: 5141,
+    got: 5142,
+    gou: 5143,
+    gov: 5144,
+    gow: 5145,
+    gox: 5146,
+    goy: 5147,
+    gpz: 5148,
+    gpa: 5149,
+    gpb: 5150,
+    gpc: 5151,
+    gpd: 5152,
+    gpe: 5153,
+    gpf: 5154,
+    gpg: 5155,
+    gph: 5156,
+    gpi: 5157,
+    gpj: 5158,
+    gpk: 5159,
+    gpl: 5160,
+    gpm: 5161,
+    gpn: 5162,
+    gpo: 5163,
+    gpp: 5164,
+    gpq: 5165,
+    gpr: 5166,
+    gps: 5167,
+    gpt: 5168,
+    gpu: 5169,
+    gpv: 5170,
+    gpw: 5171,
+    gpx: 5172,
+    gpy: 5173,
+    gqz: 5174,
+    gqa: 5175,
+    gqb: 5176,
+    gqc: 5177,
+    gqd: 5178,
+    gqe: 5179,
+    gqf: 5180,
+    gqg: 5181,
+    gqh: 5182,
+    gqi: 5183,
+    gqj: 5184,
+    gqk: 5185,
+    gql: 5186,
+    gqm: 5187,
+    gqn: 5188,
+    gqo: 5189,
+    gqp: 5190,
+    gqq: 5191,
+    gqr: 5192,
+    gqs: 5193,
+    gqt: 5194,
+    gqu: 5195,
+    gqv: 5196,
+    gqw: 5197,
+    gqx: 5198,
+    gqy: 5199,
+    grz: 5200,
+    gra: 5201,
+    grb: 5202,
+    grc: 5203,
+    grd: 5204,
+    gre: 5205,
+    grf: 5206,
+    grg: 5207,
+    grh: 5208,
+    gri: 5209,
+    grj: 5210,
+    grk: 5211,
+    grl: 5212,
+    grm: 5213,
+    grn: 5214,
+    gro: 5215,
+    grp: 5216,
+    grq: 5217,
+    grr: 5218,
+    grs: 5219,
+    grt: 5220,
+    gru: 5221,
+    grv: 5222,
+    grw: 5223,
+    grx: 5224,
+    gry: 5225,
+    gsz: 5226,
+    gsa: 5227,
+    gsb: 5228,
+    gsc: 5229,
+    gsd: 5230,
+    gse: 5231,
+    gsf: 5232,
+    gsg: 5233,
+    gsh: 5234,
+    gsi: 5235,
+    gsj: 5236,
+    gsk: 5237,
+    gsl: 5238,
+    gsm: 5239,
+    gsn: 5240,
+    gso: 5241,
+    gsp: 5242,
+    gsq: 5243,
+    gsr: 5244,
+    gss: 5245,
+    gst: 5246,
+    gsu: 5247,
+    gsv: 5248,
+    gsw: 5249,
+    gsx: 5250,
+    gsy: 5251,
+    gtz: 5252,
+    gta: 5253,
+    gtb: 5254,
+    gtc: 5255,
+    gtd: 5256,
+    gte: 5257,
+    gtf: 5258,
+    gtg: 5259,
+    gth: 5260,
+    gti: 5261,
+    gtj: 5262,
+    gtk: 5263,
+    gtl: 5264,
+    gtm: 5265,
+    gtn: 5266,
+    gto: 5267,
+    gtp: 5268,
+    gtq: 5269,
+    gtr: 5270,
+    gts: 5271,
+    gtt: 5272,
+    gtu: 5273,
+    gtv: 5274,
+    gtw: 5275,
+    gtx: 5276,
+    gty: 5277,
+    guz: 5278,
+    gua: 5279,
+    gub: 5280,
+    guc: 5281,
+    gud: 5282,
+    gue: 5283,
+    guf: 5284,
+    gug: 5285,
+    guh: 5286,
+    gui: 5287,
+    guj: 5288,
+    guk: 5289,
+    gul: 5290,
+    gum: 5291,
+    gun: 5292,
+    guo: 5293,
+    gup: 5294,
+    guq: 5295,
+    gur: 5296,
+    gus: 5297,
+    gut: 5298,
+    guu: 5299,
+    guv: 5300,
+    guw: 5301,
+    gux: 5302,
+    guy: 5303,
+    gvz: 5304,
+    gva: 5305,
+    gvb: 5306,
+    gvc: 5307,
+    gvd: 5308,
+    gve: 5309,
+    gvf: 5310,
+    gvg: 5311,
+    gvh: 5312,
+    gvi: 5313,
+    gvj: 5314,
+    gvk: 5315,
+    gvl: 5316,
+    gvm: 5317,
+    gvn: 5318,
+    gvo: 5319,
+    gvp: 5320,
+    gvq: 5321,
+    gvr: 5322,
+    gvs: 5323,
+    gvt: 5324,
+    gvu: 5325,
+    gvv: 5326,
+    gvw: 5327,
+    gvx: 5328,
+    gvy: 5329,
+    gwz: 5330,
+    gwa: 5331,
+    gwb: 5332,
+    gwc: 5333,
+    gwd: 5334,
+    gwe: 5335,
+    gwf: 5336,
+    gwg: 5337,
+    gwh: 5338,
+    gwi: 5339,
+    gwj: 5340,
+    gwk: 5341,
+    gwl: 5342,
+    gwm: 5343,
+    gwn: 5344,
+    gwo: 5345,
+    gwp: 5346,
+    gwq: 5347,
+    gwr: 5348,
+    gws: 5349,
+    gwt: 5350,
+    gwu: 5351,
+    gwv: 5352,
+    gww: 5353,
+    gwx: 5354,
+    gwy: 5355,
+    gxz: 5356,
+    gxa: 5357,
+    gxb: 5358,
+    gxc: 5359,
+    gxd: 5360,
+    gxe: 5361,
+    gxf: 5362,
+    gxg: 5363,
+    gxh: 5364,
+    gxi: 5365,
+    gxj: 5366,
+    gxk: 5367,
+    gxl: 5368,
+    gxm: 5369,
+    gxn: 5370,
+    gxo: 5371,
+    gxp: 5372,
+    gxq: 5373,
+    gxr: 5374,
+    gxs: 5375,
+    gxt: 5376,
+    gxu: 5377,
+    gxv: 5378,
+    gxw: 5379,
+    gxx: 5380,
+    gxy: 5381,
+    gyz: 5382,
+    gya: 5383,
+    gyb: 5384,
+    gyc: 5385,
+    gyd: 5386,
+    gye: 5387,
+    gyf: 5388,
+    gyg: 5389,
+    gyh: 5390,
+    gyi: 5391,
+    gyj: 5392,
+    gyk: 5393,
+    gyl: 5394,
+    gym: 5395,
+    gyn: 5396,
+    gyo: 5397,
+    gyp: 5398,
+    gyq: 5399,
+    gyr: 5400,
+    gys: 5401,
+    gyt: 5402,
+    gyu: 5403,
+    gyv: 5404,
+    gyw: 5405,
+    gyx: 5406,
+    gyy: 5407,
+    hzz: 5408,
+    hza: 5409,
+    hzb: 5410,
+    hzc: 5411,
+    hzd: 5412,
+    hze: 5413,
+    hzf: 5414,
+    hzg: 5415,
+    hzh: 5416,
+    hzi: 5417,
+    hzj: 5418,
+    hzk: 5419,
+    hzl: 5420,
+    hzm: 5421,
+    hzn: 5422,
+    hzo: 5423,
+    hzp: 5424,
+    hzq: 5425,
+    hzr: 5426,
+    hzs: 5427,
+    hzt: 5428,
+    hzu: 5429,
+    hzv: 5430,
+    hzw: 5431,
+    hzx: 5432,
+    hzy: 5433,
+    haz: 5434,
+    haa: 5435,
+    hab: 5436,
+    hac: 5437,
+    had: 5438,
+    hae: 5439,
+    haf: 5440,
+    hag: 5441,
+    hah: 5442,
+    hai: 5443,
+    haj: 5444,
+    hak: 5445,
+    hal: 5446,
+    ham: 5447,
+    han: 5448,
+    hao: 5449,
+    hap: 5450,
+    haq: 5451,
+    har: 5452,
+    has: 5453,
+    hat: 5454,
+    hau: 5455,
+    hav: 5456,
+    haw: 5457,
+    hax: 5458,
+    hay: 5459,
+    hbz: 5460,
+    hba: 5461,
+    hbb: 5462,
+    hbc: 5463,
+    hbd: 5464,
+    hbe: 5465,
+    hbf: 5466,
+    hbg: 5467,
+    hbh: 5468,
+    hbi: 5469,
+    hbj: 5470,
+    hbk: 5471,
+    hbl: 5472,
+    hbm: 5473,
+    hbn: 5474,
+    hbo: 5475,
+    hbp: 5476,
+    hbq: 5477,
+    hbr: 5478,
+    hbs: 5479,
+    hbt: 5480,
+    hbu: 5481,
+    hbv: 5482,
+    hbw: 5483,
+    hbx: 5484,
+    hby: 5485,
+    hcz: 5486,
+    hca: 5487,
+    hcb: 5488,
+    hcc: 5489,
+    hcd: 5490,
+    hce: 5491,
+    hcf: 5492,
+    hcg: 5493,
+    hch: 5494,
+    hci: 5495,
+    hcj: 5496,
+    hck: 5497,
+    hcl: 5498,
+    hcm: 5499,
+    hcn: 5500,
+    hco: 5501,
+    hcp: 5502,
+    hcq: 5503,
+    hcr: 5504,
+    hcs: 5505,
+    hct: 5506,
+    hcu: 5507,
+    hcv: 5508,
+    hcw: 5509,
+    hcx: 5510,
+    hcy: 5511,
+    hdz: 5512,
+    hda: 5513,
+    hdb: 5514,
+    hdc: 5515,
+    hdd: 5516,
+    hde: 5517,
+    hdf: 5518,
+    hdg: 5519,
+    hdh: 5520,
+    hdi: 5521,
+    hdj: 5522,
+    hdk: 5523,
+    hdl: 5524,
+    hdm: 5525,
+    hdn: 5526,
+    hdo: 5527,
+    hdp: 5528,
+    hdq: 5529,
+    hdr: 5530,
+    hds: 5531,
+    hdt: 5532,
+    hdu: 5533,
+    hdv: 5534,
+    hdw: 5535,
+    hdx: 5536,
+    hdy: 5537,
+    hez: 5538,
+    hea: 5539,
+    heb: 5540,
+    hec: 5541,
+    hed: 5542,
+    hee: 5543,
+    hef: 5544,
+    heg: 5545,
+    heh: 5546,
+    hei: 5547,
+    hej: 5548,
+    hek: 5549,
+    hel: 5550,
+    hem: 5551,
+    hen: 5552,
+    heo: 5553,
+    hep: 5554,
+    heq: 5555,
+    her: 5556,
+    hes: 5557,
+    het: 5558,
+    heu: 5559,
+    hev: 5560,
+    hew: 5561,
+    hex: 5562,
+    hey: 5563,
+    hfz: 5564,
+    hfa: 5565,
+    hfb: 5566,
+    hfc: 5567,
+    hfd: 5568,
+    hfe: 5569,
+    hff: 5570,
+    hfg: 5571,
+    hfh: 5572,
+    hfi: 5573,
+    hfj: 5574,
+    hfk: 5575,
+    hfl: 5576,
+    hfm: 5577,
+    hfn: 5578,
+    hfo: 5579,
+    hfp: 5580,
+    hfq: 5581,
+    hfr: 5582,
+    hfs: 5583,
+    hft: 5584,
+    hfu: 5585,
+    hfv: 5586,
+    hfw: 5587,
+    hfx: 5588,
+    hfy: 5589,
+    hgz: 5590,
+    hga: 5591,
+    hgb: 5592,
+    hgc: 5593,
+    hgd: 5594,
+    hge: 5595,
+    hgf: 5596,
+    hgg: 5597,
+    hgh: 5598,
+    hgi: 5599,
+    hgj: 5600,
+    hgk: 5601,
+    hgl: 5602,
+    hgm: 5603,
+    hgn: 5604,
+    hgo: 5605,
+    hgp: 5606,
+    hgq: 5607,
+    hgr: 5608,
+    hgs: 5609,
+    hgt: 5610,
+    hgu: 5611,
+    hgv: 5612,
+    hgw: 5613,
+    hgx: 5614,
+    hgy: 5615,
+    hhz: 5616,
+    hha: 5617,
+    hhb: 5618,
+    hhc: 5619,
+    hhd: 5620,
+    hhe: 5621,
+    hhf: 5622,
+    hhg: 5623,
+    hhh: 5624,
+    hhi: 5625,
+    hhj: 5626,
+    hhk: 5627,
+    hhl: 5628,
+    hhm: 5629,
+    hhn: 5630,
+    hho: 5631,
+    hhp: 5632,
+    hhq: 5633,
+    hhr: 5634,
+    hhs: 5635,
+    hht: 5636,
+    hhu: 5637,
+    hhv: 5638,
+    hhw: 5639,
+    hhx: 5640,
+    hhy: 5641,
+    hiz: 5642,
+    hia: 5643,
+    hib: 5644,
+    hic: 5645,
+    hid: 5646,
+    hie: 5647,
+    hif: 5648,
+    hig: 5649,
+    hih: 5650,
+    hii: 5651,
+    hij: 5652,
+    hik: 5653,
+    hil: 5654,
+    him: 5655,
+    hin: 5656,
+    hio: 5657,
+    hip: 5658,
+    hiq: 5659,
+    hir: 5660,
+    his: 5661,
+    hit: 5662,
+    hiu: 5663,
+    hiv: 5664,
+    hiw: 5665,
+    hix: 5666,
+    hiy: 5667,
+    hjz: 5668,
+    hja: 5669,
+    hjb: 5670,
+    hjc: 5671,
+    hjd: 5672,
+    hje: 5673,
+    hjf: 5674,
+    hjg: 5675,
+    hjh: 5676,
+    hji: 5677,
+    hjj: 5678,
+    hjk: 5679,
+    hjl: 5680,
+    hjm: 5681,
+    hjn: 5682,
+    hjo: 5683,
+    hjp: 5684,
+    hjq: 5685,
+    hjr: 5686,
+    hjs: 5687,
+    hjt: 5688,
+    hju: 5689,
+    hjv: 5690,
+    hjw: 5691,
+    hjx: 5692,
+    hjy: 5693,
+    hkz: 5694,
+    hka: 5695,
+    hkb: 5696,
+    hkc: 5697,
+    hkd: 5698,
+    hke: 5699,
+    hkf: 5700,
+    hkg: 5701,
+    hkh: 5702,
+    hki: 5703,
+    hkj: 5704,
+    hkk: 5705,
+    hkl: 5706,
+    hkm: 5707,
+    hkn: 5708,
+    hko: 5709,
+    hkp: 5710,
+    hkq: 5711,
+    hkr: 5712,
+    hks: 5713,
+    hkt: 5714,
+    hku: 5715,
+    hkv: 5716,
+    hkw: 5717,
+    hkx: 5718,
+    hky: 5719,
+    hlz: 5720,
+    hla: 5721,
+    hlb: 5722,
+    hlc: 5723,
+    hld: 5724,
+    hle: 5725,
+    hlf: 5726,
+    hlg: 5727,
+    hlh: 5728,
+    hli: 5729,
+    hlj: 5730,
+    hlk: 5731,
+    hll: 5732,
+    hlm: 5733,
+    hln: 5734,
+    hlo: 5735,
+    hlp: 5736,
+    hlq: 5737,
+    hlr: 5738,
+    hls: 5739,
+    hlt: 5740,
+    hlu: 5741,
+    hlv: 5742,
+    hlw: 5743,
+    hlx: 5744,
+    hly: 5745,
+    hmz: 5746,
+    hma: 5747,
+    hmb: 5748,
+    hmc: 5749,
+    hmd: 5750,
+    hme: 5751,
+    hmf: 5752,
+    hmg: 5753,
+    hmh: 5754,
+    hmi: 5755,
+    hmj: 5756,
+    hmk: 5757,
+    hml: 5758,
+    hmm: 5759,
+    hmn: 5760,
+    hmo: 5761,
+    hmp: 5762,
+    hmq: 5763,
+    hmr: 5764,
+    hms: 5765,
+    hmt: 5766,
+    hmu: 5767,
+    hmv: 5768,
+    hmw: 5769,
+    hmx: 5770,
+    hmy: 5771,
+    hnz: 5772,
+    hna: 5773,
+    hnb: 5774,
+    hnc: 5775,
+    hnd: 5776,
+    hne: 5777,
+    hnf: 5778,
+    hng: 5779,
+    hnh: 5780,
+    hni: 5781,
+    hnj: 5782,
+    hnk: 5783,
+    hnl: 5784,
+    hnm: 5785,
+    hnn: 5786,
+    hno: 5787,
+    hnp: 5788,
+    hnq: 5789,
+    hnr: 5790,
+    hns: 5791,
+    hnt: 5792,
+    hnu: 5793,
+    hnv: 5794,
+    hnw: 5795,
+    hnx: 5796,
+    hny: 5797,
+    hoz: 5798,
+    hoa: 5799,
+    hob: 5800,
+    hoc: 5801,
+    hod: 5802,
+    hoe: 5803,
+    hof: 5804,
+    hog: 5805,
+    hoh: 5806,
+    hoi: 5807,
+    hoj: 5808,
+    hok: 5809,
+    hol: 5810,
+    hom: 5811,
+    hon: 5812,
+    hoo: 5813,
+    hop: 5814,
+    hoq: 5815,
+    hor: 5816,
+    hos: 5817,
+    hot: 5818,
+    hou: 5819,
+    hov: 5820,
+    how: 5821,
+    hox: 5822,
+    hoy: 5823,
+    hpz: 5824,
+    hpa: 5825,
+    hpb: 5826,
+    hpc: 5827,
+    hpd: 5828,
+    hpe: 5829,
+    hpf: 5830,
+    hpg: 5831,
+    hph: 5832,
+    hpi: 5833,
+    hpj: 5834,
+    hpk: 5835,
+    hpl: 5836,
+    hpm: 5837,
+    hpn: 5838,
+    hpo: 5839,
+    hpp: 5840,
+    hpq: 5841,
+    hpr: 5842,
+    hps: 5843,
+    hpt: 5844,
+    hpu: 5845,
+    hpv: 5846,
+    hpw: 5847,
+    hpx: 5848,
+    hpy: 5849,
+    hqz: 5850,
+    hqa: 5851,
+    hqb: 5852,
+    hqc: 5853,
+    hqd: 5854,
+    hqe: 5855,
+    hqf: 5856,
+    hqg: 5857,
+    hqh: 5858,
+    hqi: 5859,
+    hqj: 5860,
+    hqk: 5861,
+    hql: 5862,
+    hqm: 5863,
+    hqn: 5864,
+    hqo: 5865,
+    hqp: 5866,
+    hqq: 5867,
+    hqr: 5868,
+    hqs: 5869,
+    hqt: 5870,
+    hqu: 5871,
+    hqv: 5872,
+    hqw: 5873,
+    hqx: 5874,
+    hqy: 5875,
+    hrz: 5876,
+    hra: 5877,
+    hrb: 5878,
+    hrc: 5879,
+    hrd: 5880,
+    hre: 5881,
+    hrf: 5882,
+    hrg: 5883,
+    hrh: 5884,
+    hri: 5885,
+    hrj: 5886,
+    hrk: 5887,
+    hrl: 5888,
+    hrm: 5889,
+    hrn: 5890,
+    hro: 5891,
+    hrp: 5892,
+    hrq: 5893,
+    hrr: 5894,
+    hrs: 5895,
+    hrt: 5896,
+    hru: 5897,
+    hrv: 5898,
+    hrw: 5899,
+    hrx: 5900,
+    hry: 5901,
+    hsz: 5902,
+    hsa: 5903,
+    hsb: 5904,
+    hsc: 5905,
+    hsd: 5906,
+    hse: 5907,
+    hsf: 5908,
+    hsg: 5909,
+    hsh: 5910,
+    hsi: 5911,
+    hsj: 5912,
+    hsk: 5913,
+    hsl: 5914,
+    hsm: 5915,
+    hsn: 5916,
+    hso: 5917,
+    hsp: 5918,
+    hsq: 5919,
+    hsr: 5920,
+    hss: 5921,
+    hst: 5922,
+    hsu: 5923,
+    hsv: 5924,
+    hsw: 5925,
+    hsx: 5926,
+    hsy: 5927,
+    htz: 5928,
+    hta: 5929,
+    htb: 5930,
+    htc: 5931,
+    htd: 5932,
+    hte: 5933,
+    htf: 5934,
+    htg: 5935,
+    hth: 5936,
+    hti: 5937,
+    htj: 5938,
+    htk: 5939,
+    htl: 5940,
+    htm: 5941,
+    htn: 5942,
+    hto: 5943,
+    htp: 5944,
+    htq: 5945,
+    htr: 5946,
+    hts: 5947,
+    htt: 5948,
+    htu: 5949,
+    htv: 5950,
+    htw: 5951,
+    htx: 5952,
+    hty: 5953,
+    huz: 5954,
+    hua: 5955,
+    hub: 5956,
+    huc: 5957,
+    hud: 5958,
+    hue: 5959,
+    huf: 5960,
+    hug: 5961,
+    huh: 5962,
+    hui: 5963,
+    huj: 5964,
+    huk: 5965,
+    hul: 5966,
+    hum: 5967,
+    hun: 5968,
+    huo: 5969,
+    hup: 5970,
+    huq: 5971,
+    hur: 5972,
+    hus: 5973,
+    hut: 5974,
+    huu: 5975,
+    huv: 5976,
+    huw: 5977,
+    hux: 5978,
+    huy: 5979,
+    hvz: 5980,
+    hva: 5981,
+    hvb: 5982,
+    hvc: 5983,
+    hvd: 5984,
+    hve: 5985,
+    hvf: 5986,
+    hvg: 5987,
+    hvh: 5988,
+    hvi: 5989,
+    hvj: 5990,
+    hvk: 5991,
+    hvl: 5992,
+    hvm: 5993,
+    hvn: 5994,
+    hvo: 5995,
+    hvp: 5996,
+    hvq: 5997,
+    hvr: 5998,
+    hvs: 5999,
+    hvt: 6000,
+    hvu: 6001,
+    hvv: 6002,
+    hvw: 6003,
+    hvx: 6004,
+    hvy: 6005,
+    hwz: 6006,
+    hwa: 6007,
+    hwb: 6008,
+    hwc: 6009,
+    hwd: 6010,
+    hwe: 6011,
+    hwf: 6012,
+    hwg: 6013,
+    hwh: 6014,
+    hwi: 6015,
+    hwj: 6016,
+    hwk: 6017,
+    hwl: 6018,
+    hwm: 6019,
+    hwn: 6020,
+    hwo: 6021,
+    hwp: 6022,
+    hwq: 6023,
+    hwr: 6024,
+    hws: 6025,
+    hwt: 6026,
+    hwu: 6027,
+    hwv: 6028,
+    hww: 6029,
+    hwx: 6030,
+    hwy: 6031,
+    hxz: 6032,
+    hxa: 6033,
+    hxb: 6034,
+    hxc: 6035,
+    hxd: 6036,
+    hxe: 6037,
+    hxf: 6038,
+    hxg: 6039,
+    hxh: 6040,
+    hxi: 6041,
+    hxj: 6042,
+    hxk: 6043,
+    hxl: 6044,
+    hxm: 6045,
+    hxn: 6046,
+    hxo: 6047,
+    hxp: 6048,
+    hxq: 6049,
+    hxr: 6050,
+    hxs: 6051,
+    hxt: 6052,
+    hxu: 6053,
+    hxv: 6054,
+    hxw: 6055,
+    hxx: 6056,
+    hxy: 6057,
+    hyz: 6058,
+    hya: 6059,
+    hyb: 6060,
+    hyc: 6061,
+    hyd: 6062,
+    hye: 6063,
+    hyf: 6064,
+    hyg: 6065,
+    hyh: 6066,
+    hyi: 6067,
+    hyj: 6068,
+    hyk: 6069,
+    hyl: 6070,
+    hym: 6071,
+    hyn: 6072,
+    hyo: 6073,
+    hyp: 6074,
+    hyq: 6075,
+    hyr: 6076,
+    hys: 6077,
+    hyt: 6078,
+    hyu: 6079,
+    hyv: 6080,
+    hyw: 6081,
+    hyx: 6082,
+    hyy: 6083,
+    izz: 6084,
+    iza: 6085,
+    izb: 6086,
+    izc: 6087,
+    izd: 6088,
+    ize: 6089,
+    izf: 6090,
+    izg: 6091,
+    izh: 6092,
+    izi: 6093,
+    izj: 6094,
+    izk: 6095,
+    izl: 6096,
+    izm: 6097,
+    izn: 6098,
+    izo: 6099,
+    izp: 6100,
+    izq: 6101,
+    izr: 6102,
+    izs: 6103,
+    izt: 6104,
+    izu: 6105,
+    izv: 6106,
+    izw: 6107,
+    izx: 6108,
+    izy: 6109,
+    iaz: 6110,
+    iaa: 6111,
+    iab: 6112,
+    iac: 6113,
+    iad: 6114,
+    iae: 6115,
+    iaf: 6116,
+    iag: 6117,
+    iah: 6118,
+    iai: 6119,
+    iaj: 6120,
+    iak: 6121,
+    ial: 6122,
+    iam: 6123,
+    ian: 6124,
+    iao: 6125,
+    iap: 6126,
+    iaq: 6127,
+    iar: 6128,
+    ias: 6129,
+    iat: 6130,
+    iau: 6131,
+    iav: 6132,
+    iaw: 6133,
+    iax: 6134,
+    iay: 6135,
+    ibz: 6136,
+    iba: 6137,
+    ibb: 6138,
+    ibc: 6139,
+    ibd: 6140,
+    ibe: 6141,
+    ibf: 6142,
+    ibg: 6143,
+    ibh: 6144,
+    ibi: 6145,
+    ibj: 6146,
+    ibk: 6147,
+    ibl: 6148,
+    ibm: 6149,
+    ibn: 6150,
+    ibo: 6151,
+    ibp: 6152,
+    ibq: 6153,
+    ibr: 6154,
+    ibs: 6155,
+    ibt: 6156,
+    ibu: 6157,
+    ibv: 6158,
+    ibw: 6159,
+    ibx: 6160,
+    iby: 6161,
+    icz: 6162,
+    ica: 6163,
+    icb: 6164,
+    icc: 6165,
+    icd: 6166,
+    ice: 6167,
+    icf: 6168,
+    icg: 6169,
+    ich: 6170,
+    ici: 6171,
+    icj: 6172,
+    ick: 6173,
+    icl: 6174,
+    icm: 6175,
+    icn: 6176,
+    ico: 6177,
+    icp: 6178,
+    icq: 6179,
+    icr: 6180,
+    ics: 6181,
+    ict: 6182,
+    icu: 6183,
+    icv: 6184,
+    icw: 6185,
+    icx: 6186,
+    icy: 6187,
+    idz: 6188,
+    ida: 6189,
+    idb: 6190,
+    idc: 6191,
+    idd: 6192,
+    ide: 6193,
+    idf: 6194,
+    idg: 6195,
+    idh: 6196,
+    idi: 6197,
+    idj: 6198,
+    idk: 6199,
+    idl: 6200,
+    idm: 6201,
+    idn: 6202,
+    ido: 6203,
+    idp: 6204,
+    idq: 6205,
+    idr: 6206,
+    ids: 6207,
+    idt: 6208,
+    idu: 6209,
+    idv: 6210,
+    idw: 6211,
+    idx: 6212,
+    idy: 6213,
+    iez: 6214,
+    iea: 6215,
+    ieb: 6216,
+    iec: 6217,
+    ied: 6218,
+    iee: 6219,
+    ief: 6220,
+    ieg: 6221,
+    ieh: 6222,
+    iei: 6223,
+    iej: 6224,
+    iek: 6225,
+    iel: 6226,
+    iem: 6227,
+    ien: 6228,
+    ieo: 6229,
+    iep: 6230,
+    ieq: 6231,
+    ier: 6232,
+    ies: 6233,
+    iet: 6234,
+    ieu: 6235,
+    iev: 6236,
+    iew: 6237,
+    iex: 6238,
+    iey: 6239,
+    ifz: 6240,
+    ifa: 6241,
+    ifb: 6242,
+    ifc: 6243,
+    ifd: 6244,
+    ife: 6245,
+    iff: 6246,
+    ifg: 6247,
+    ifh: 6248,
+    ifi: 6249,
+    ifj: 6250,
+    ifk: 6251,
+    ifl: 6252,
+    ifm: 6253,
+    ifn: 6254,
+    ifo: 6255,
+    ifp: 6256,
+    ifq: 6257,
+    ifr: 6258,
+    ifs: 6259,
+    ift: 6260,
+    ifu: 6261,
+    ifv: 6262,
+    ifw: 6263,
+    ifx: 6264,
+    ify: 6265,
+    igz: 6266,
+    iga: 6267,
+    igb: 6268,
+    igc: 6269,
+    igd: 6270,
+    ige: 6271,
+    igf: 6272,
+    igg: 6273,
+    igh: 6274,
+    igi: 6275,
+    igj: 6276,
+    igk: 6277,
+    igl: 6278,
+    igm: 6279,
+    ign: 6280,
+    igo: 6281,
+    igp: 6282,
+    igq: 6283,
+    igr: 6284,
+    igs: 6285,
+    igt: 6286,
+    igu: 6287,
+    igv: 6288,
+    igw: 6289,
+    igx: 6290,
+    igy: 6291,
+    ihz: 6292,
+    iha: 6293,
+    ihb: 6294,
+    ihc: 6295,
+    ihd: 6296,
+    ihe: 6297,
+    ihf: 6298,
+    ihg: 6299,
+    ihh: 6300,
+    ihi: 6301,
+    ihj: 6302,
+    ihk: 6303,
+    ihl: 6304,
+    ihm: 6305,
+    ihn: 6306,
+    iho: 6307,
+    ihp: 6308,
+    ihq: 6309,
+    ihr: 6310,
+    ihs: 6311,
+    iht: 6312,
+    ihu: 6313,
+    ihv: 6314,
+    ihw: 6315,
+    ihx: 6316,
+    ihy: 6317,
+    iiz: 6318,
+    iia: 6319,
+    iib: 6320,
+    iic: 6321,
+    iid: 6322,
+    iie: 6323,
+    iif: 6324,
+    iig: 6325,
+    iih: 6326,
+    iii: 6327,
+    iij: 6328,
+    iik: 6329,
+    iil: 6330,
+    iim: 6331,
+    iin: 6332,
+    iio: 6333,
+    iip: 6334,
+    iiq: 6335,
+    iir: 6336,
+    iis: 6337,
+    iit: 6338,
+    iiu: 6339,
+    iiv: 6340,
+    iiw: 6341,
+    iix: 6342,
+    iiy: 6343,
+    ijz: 6344,
+    ija: 6345,
+    ijb: 6346,
+    ijc: 6347,
+    ijd: 6348,
+    ije: 6349,
+    ijf: 6350,
+    ijg: 6351,
+    ijh: 6352,
+    iji: 6353,
+    ijj: 6354,
+    ijk: 6355,
+    ijl: 6356,
+    ijm: 6357,
+    ijn: 6358,
+    ijo: 6359,
+    ijp: 6360,
+    ijq: 6361,
+    ijr: 6362,
+    ijs: 6363,
+    ijt: 6364,
+    iju: 6365,
+    ijv: 6366,
+    ijw: 6367,
+    ijx: 6368,
+    ijy: 6369,
+    ikz: 6370,
+    ika: 6371,
+    ikb: 6372,
+    ikc: 6373,
+    ikd: 6374,
+    ike: 6375,
+    ikf: 6376,
+    ikg: 6377,
+    ikh: 6378,
+    iki: 6379,
+    ikj: 6380,
+    ikk: 6381,
+    ikl: 6382,
+    ikm: 6383,
+    ikn: 6384,
+    iko: 6385,
+    ikp: 6386,
+    ikq: 6387,
+    ikr: 6388,
+    iks: 6389,
+    ikt: 6390,
+    iku: 6391,
+    ikv: 6392,
+    ikw: 6393,
+    ikx: 6394,
+    iky: 6395,
+    ilz: 6396,
+    ila: 6397,
+    ilb: 6398,
+    ilc: 6399,
+    ild: 6400,
+    ile: 6401,
+    ilf: 6402,
+    ilg: 6403,
+    ilh: 6404,
+    ili: 6405,
+    ilj: 6406,
+    ilk: 6407,
+    ill: 6408,
+    ilm: 6409,
+    iln: 6410,
+    ilo: 6411,
+    ilp: 6412,
+    ilq: 6413,
+    ilr: 6414,
+    ils: 6415,
+    ilt: 6416,
+    ilu: 6417,
+    ilv: 6418,
+    ilw: 6419,
+    ilx: 6420,
+    ily: 6421,
+    imz: 6422,
+    ima: 6423,
+    imb: 6424,
+    imc: 6425,
+    imd: 6426,
+    ime: 6427,
+    imf: 6428,
+    img: 6429,
+    imh: 6430,
+    imi: 6431,
+    imj: 6432,
+    imk: 6433,
+    iml: 6434,
+    imm: 6435,
+    imn: 6436,
+    imo: 6437,
+    imp: 6438,
+    imq: 6439,
+    imr: 6440,
+    ims: 6441,
+    imt: 6442,
+    imu: 6443,
+    imv: 6444,
+    imw: 6445,
+    imx: 6446,
+    imy: 6447,
+    inz: 6448,
+    ina: 6449,
+    inb: 6450,
+    inc: 6451,
+    ind: 6452,
+    ine: 6453,
+    inf: 6454,
+    ing: 6455,
+    inh: 6456,
+    ini: 6457,
+    inj: 6458,
+    ink: 6459,
+    inl: 6460,
+    inm: 6461,
+    inn: 6462,
+    ino: 6463,
+    inp: 6464,
+    inq: 6465,
+    inr: 6466,
+    ins: 6467,
+    int: 6468,
+    inu: 6469,
+    inv: 6470,
+    inw: 6471,
+    inx: 6472,
+    iny: 6473,
+    ioz: 6474,
+    ioa: 6475,
+    iob: 6476,
+    ioc: 6477,
+    iod: 6478,
+    ioe: 6479,
+    iof: 6480,
+    iog: 6481,
+    ioh: 6482,
+    ioi: 6483,
+    ioj: 6484,
+    iok: 6485,
+    iol: 6486,
+    iom: 6487,
+    ion: 6488,
+    ioo: 6489,
+    iop: 6490,
+    ioq: 6491,
+    ior: 6492,
+    ios: 6493,
+    iot: 6494,
+    iou: 6495,
+    iov: 6496,
+    iow: 6497,
+    iox: 6498,
+    ioy: 6499,
+    ipz: 6500,
+    ipa: 6501,
+    ipb: 6502,
+    ipc: 6503,
+    ipd: 6504,
+    ipe: 6505,
+    ipf: 6506,
+    ipg: 6507,
+    iph: 6508,
+    ipi: 6509,
+    ipj: 6510,
+    ipk: 6511,
+    ipl: 6512,
+    ipm: 6513,
+    ipn: 6514,
+    ipo: 6515,
+    ipp: 6516,
+    ipq: 6517,
+    ipr: 6518,
+    ips: 6519,
+    ipt: 6520,
+    ipu: 6521,
+    ipv: 6522,
+    ipw: 6523,
+    ipx: 6524,
+    ipy: 6525,
+    iqz: 6526,
+    iqa: 6527,
+    iqb: 6528,
+    iqc: 6529,
+    iqd: 6530,
+    iqe: 6531,
+    iqf: 6532,
+    iqg: 6533,
+    iqh: 6534,
+    iqi: 6535,
+    iqj: 6536,
+    iqk: 6537,
+    iql: 6538,
+    iqm: 6539,
+    iqn: 6540,
+    iqo: 6541,
+    iqp: 6542,
+    iqq: 6543,
+    iqr: 6544,
+    iqs: 6545,
+    iqt: 6546,
+    iqu: 6547,
+    iqv: 6548,
+    iqw: 6549,
+    iqx: 6550,
+    iqy: 6551,
+    irz: 6552,
+    ira: 6553,
+    irb: 6554,
+    irc: 6555,
+    ird: 6556,
+    ire: 6557,
+    irf: 6558,
+    irg: 6559,
+    irh: 6560,
+    iri: 6561,
+    irj: 6562,
+    irk: 6563,
+    irl: 6564,
+    irm: 6565,
+    irn: 6566,
+    iro: 6567,
+    irp: 6568,
+    irq: 6569,
+    irr: 6570,
+    irs: 6571,
+    irt: 6572,
+    iru: 6573,
+    irv: 6574,
+    irw: 6575,
+    irx: 6576,
+    iry: 6577,
+    isz: 6578,
+    isa: 6579,
+    isb: 6580,
+    isc: 6581,
+    isd: 6582,
+    ise: 6583,
+    isf: 6584,
+    isg: 6585,
+    ish: 6586,
+    isi: 6587,
+    isj: 6588,
+    isk: 6589,
+    isl: 6590,
+    ism: 6591,
+    isn: 6592,
+    iso: 6593,
+    isp: 6594,
+    isq: 6595,
+    isr: 6596,
+    iss: 6597,
+    ist: 6598,
+    isu: 6599,
+    isv: 6600,
+    isw: 6601,
+    isx: 6602,
+    isy: 6603,
+    itz: 6604,
+    ita: 6605,
+    itb: 6606,
+    itc: 6607,
+    itd: 6608,
+    ite: 6609,
+    itf: 6610,
+    itg: 6611,
+    ith: 6612,
+    iti: 6613,
+    itj: 6614,
+    itk: 6615,
+    itl: 6616,
+    itm: 6617,
+    itn: 6618,
+    ito: 6619,
+    itp: 6620,
+    itq: 6621,
+    itr: 6622,
+    its: 6623,
+    itt: 6624,
+    itu: 6625,
+    itv: 6626,
+    itw: 6627,
+    itx: 6628,
+    ity: 6629,
+    iuz: 6630,
+    iua: 6631,
+    iub: 6632,
+    iuc: 6633,
+    iud: 6634,
+    iue: 6635,
+    iuf: 6636,
+    iug: 6637,
+    iuh: 6638,
+    iui: 6639,
+    iuj: 6640,
+    iuk: 6641,
+    iul: 6642,
+    ium: 6643,
+    iun: 6644,
+    iuo: 6645,
+    iup: 6646,
+    iuq: 6647,
+    iur: 6648,
+    ius: 6649,
+    iut: 6650,
+    iuu: 6651,
+    iuv: 6652,
+    iuw: 6653,
+    iux: 6654,
+    iuy: 6655,
+    ivz: 6656,
+    iva: 6657,
+    ivb: 6658,
+    ivc: 6659,
+    ivd: 6660,
+    ive: 6661,
+    ivf: 6662,
+    ivg: 6663,
+    ivh: 6664,
+    ivi: 6665,
+    ivj: 6666,
+    ivk: 6667,
+    ivl: 6668,
+    ivm: 6669,
+    ivn: 6670,
+    ivo: 6671,
+    ivp: 6672,
+    ivq: 6673,
+    ivr: 6674,
+    ivs: 6675,
+    ivt: 6676,
+    ivu: 6677,
+    ivv: 6678,
+    ivw: 6679,
+    ivx: 6680,
+    ivy: 6681,
+    iwz: 6682,
+    iwa: 6683,
+    iwb: 6684,
+    iwc: 6685,
+    iwd: 6686,
+    iwe: 6687,
+    iwf: 6688,
+    iwg: 6689,
+    iwh: 6690,
+    iwi: 6691,
+    iwj: 6692,
+    iwk: 6693,
+    iwl: 6694,
+    iwm: 6695,
+    iwn: 6696,
+    iwo: 6697,
+    iwp: 6698,
+    iwq: 6699,
+    iwr: 6700,
+    iws: 6701,
+    iwt: 6702,
+    iwu: 6703,
+    iwv: 6704,
+    iww: 6705,
+    iwx: 6706,
+    iwy: 6707,
+    ixz: 6708,
+    ixa: 6709,
+    ixb: 6710,
+    ixc: 6711,
+    ixd: 6712,
+    ixe: 6713,
+    ixf: 6714,
+    ixg: 6715,
+    ixh: 6716,
+    ixi: 6717,
+    ixj: 6718,
+    ixk: 6719,
+    ixl: 6720,
+    ixm: 6721,
+    ixn: 6722,
+    ixo: 6723,
+    ixp: 6724,
+    ixq: 6725,
+    ixr: 6726,
+    ixs: 6727,
+    ixt: 6728,
+    ixu: 6729,
+    ixv: 6730,
+    ixw: 6731,
+    ixx: 6732,
+    ixy: 6733,
+    iyz: 6734,
+    iya: 6735,
+    iyb: 6736,
+    iyc: 6737,
+    iyd: 6738,
+    iye: 6739,
+    iyf: 6740,
+    iyg: 6741,
+    iyh: 6742,
+    iyi: 6743,
+    iyj: 6744,
+    iyk: 6745,
+    iyl: 6746,
+    iym: 6747,
+    iyn: 6748,
+    iyo: 6749,
+    iyp: 6750,
+    iyq: 6751,
+    iyr: 6752,
+    iys: 6753,
+    iyt: 6754,
+    iyu: 6755,
+    iyv: 6756,
+    iyw: 6757,
+    iyx: 6758,
+    iyy: 6759,
+    jzz: 6760,
+    jza: 6761,
+    jzb: 6762,
+    jzc: 6763,
+    jzd: 6764,
+    jze: 6765,
+    jzf: 6766,
+    jzg: 6767,
+    jzh: 6768,
+    jzi: 6769,
+    jzj: 6770,
+    jzk: 6771,
+    jzl: 6772,
+    jzm: 6773,
+    jzn: 6774,
+    jzo: 6775,
+    jzp: 6776,
+    jzq: 6777,
+    jzr: 6778,
+    jzs: 6779,
+    jzt: 6780,
+    jzu: 6781,
+    jzv: 6782,
+    jzw: 6783,
+    jzx: 6784,
+    jzy: 6785,
+    jaz: 6786,
+    jaa: 6787,
+    jab: 6788,
+    jac: 6789,
+    jad: 6790,
+    jae: 6791,
+    jaf: 6792,
+    jag: 6793,
+    jah: 6794,
+    jai: 6795,
+    jaj: 6796,
+    jak: 6797,
+    jal: 6798,
+    jam: 6799,
+    jan: 6800,
+    jao: 6801,
+    jap: 6802,
+    jaq: 6803,
+    jar: 6804,
+    jas: 6805,
+    jat: 6806,
+    jau: 6807,
+    jav: 6808,
+    jaw: 6809,
+    jax: 6810,
+    jay: 6811,
+    jbz: 6812,
+    jba: 6813,
+    jbb: 6814,
+    jbc: 6815,
+    jbd: 6816,
+    jbe: 6817,
+    jbf: 6818,
+    jbg: 6819,
+    jbh: 6820,
+    jbi: 6821,
+    jbj: 6822,
+    jbk: 6823,
+    jbl: 6824,
+    jbm: 6825,
+    jbn: 6826,
+    jbo: 6827,
+    jbp: 6828,
+    jbq: 6829,
+    jbr: 6830,
+    jbs: 6831,
+    jbt: 6832,
+    jbu: 6833,
+    jbv: 6834,
+    jbw: 6835,
+    jbx: 6836,
+    jby: 6837,
+    jcz: 6838,
+    jca: 6839,
+    jcb: 6840,
+    jcc: 6841,
+    jcd: 6842,
+    jce: 6843,
+    jcf: 6844,
+    jcg: 6845,
+    jch: 6846,
+    jci: 6847,
+    jcj: 6848,
+    jck: 6849,
+    jcl: 6850,
+    jcm: 6851,
+    jcn: 6852,
+    jco: 6853,
+    jcp: 6854,
+    jcq: 6855,
+    jcr: 6856,
+    jcs: 6857,
+    jct: 6858,
+    jcu: 6859,
+    jcv: 6860,
+    jcw: 6861,
+    jcx: 6862,
+    jcy: 6863,
+    jdz: 6864,
+    jda: 6865,
+    jdb: 6866,
+    jdc: 6867,
+    jdd: 6868,
+    jde: 6869,
+    jdf: 6870,
+    jdg: 6871,
+    jdh: 6872,
+    jdi: 6873,
+    jdj: 6874,
+    jdk: 6875,
+    jdl: 6876,
+    jdm: 6877,
+    jdn: 6878,
+    jdo: 6879,
+    jdp: 6880,
+    jdq: 6881,
+    jdr: 6882,
+    jds: 6883,
+    jdt: 6884,
+    jdu: 6885,
+    jdv: 6886,
+    jdw: 6887,
+    jdx: 6888,
+    jdy: 6889,
+    jez: 6890,
+    jea: 6891,
+    jeb: 6892,
+    jec: 6893,
+    jed: 6894,
+    jee: 6895,
+    jef: 6896,
+    jeg: 6897,
+    jeh: 6898,
+    jei: 6899,
+    jej: 6900,
+    jek: 6901,
+    jel: 6902,
+    jem: 6903,
+    jen: 6904,
+    jeo: 6905,
+    jep: 6906,
+    jeq: 6907,
+    jer: 6908,
+    jes: 6909,
+    jet: 6910,
+    jeu: 6911,
+    jev: 6912,
+    jew: 6913,
+    jex: 6914,
+    jey: 6915,
+    jfz: 6916,
+    jfa: 6917,
+    jfb: 6918,
+    jfc: 6919,
+    jfd: 6920,
+    jfe: 6921,
+    jff: 6922,
+    jfg: 6923,
+    jfh: 6924,
+    jfi: 6925,
+    jfj: 6926,
+    jfk: 6927,
+    jfl: 6928,
+    jfm: 6929,
+    jfn: 6930,
+    jfo: 6931,
+    jfp: 6932,
+    jfq: 6933,
+    jfr: 6934,
+    jfs: 6935,
+    jft: 6936,
+    jfu: 6937,
+    jfv: 6938,
+    jfw: 6939,
+    jfx: 6940,
+    jfy: 6941,
+    jgz: 6942,
+    jga: 6943,
+    jgb: 6944,
+    jgc: 6945,
+    jgd: 6946,
+    jge: 6947,
+    jgf: 6948,
+    jgg: 6949,
+    jgh: 6950,
+    jgi: 6951,
+    jgj: 6952,
+    jgk: 6953,
+    jgl: 6954,
+    jgm: 6955,
+    jgn: 6956,
+    jgo: 6957,
+    jgp: 6958,
+    jgq: 6959,
+    jgr: 6960,
+    jgs: 6961,
+    jgt: 6962,
+    jgu: 6963,
+    jgv: 6964,
+    jgw: 6965,
+    jgx: 6966,
+    jgy: 6967,
+    jhz: 6968,
+    jha: 6969,
+    jhb: 6970,
+    jhc: 6971,
+    jhd: 6972,
+    jhe: 6973,
+    jhf: 6974,
+    jhg: 6975,
+    jhh: 6976,
+    jhi: 6977,
+    jhj: 6978,
+    jhk: 6979,
+    jhl: 6980,
+    jhm: 6981,
+    jhn: 6982,
+    jho: 6983,
+    jhp: 6984,
+    jhq: 6985,
+    jhr: 6986,
+    jhs: 6987,
+    jht: 6988,
+    jhu: 6989,
+    jhv: 6990,
+    jhw: 6991,
+    jhx: 6992,
+    jhy: 6993,
+    jiz: 6994,
+    jia: 6995,
+    jib: 6996,
+    jic: 6997,
+    jid: 6998,
+    jie: 6999,
+    jif: 7000,
+    jig: 7001,
+    jih: 7002,
+    jii: 7003,
+    jij: 7004,
+    jik: 7005,
+    jil: 7006,
+    jim: 7007,
+    jin: 7008,
+    jio: 7009,
+    jip: 7010,
+    jiq: 7011,
+    jir: 7012,
+    jis: 7013,
+    jit: 7014,
+    jiu: 7015,
+    jiv: 7016,
+    jiw: 7017,
+    jix: 7018,
+    jiy: 7019,
+    jjz: 7020,
+    jja: 7021,
+    jjb: 7022,
+    jjc: 7023,
+    jjd: 7024,
+    jje: 7025,
+    jjf: 7026,
+    jjg: 7027,
+    jjh: 7028,
+    jji: 7029,
+    jjj: 7030,
+    jjk: 7031,
+    jjl: 7032,
+    jjm: 7033,
+    jjn: 7034,
+    jjo: 7035,
+    jjp: 7036,
+    jjq: 7037,
+    jjr: 7038,
+    jjs: 7039,
+    jjt: 7040,
+    jju: 7041,
+    jjv: 7042,
+    jjw: 7043,
+    jjx: 7044,
+    jjy: 7045,
+    jkz: 7046,
+    jka: 7047,
+    jkb: 7048,
+    jkc: 7049,
+    jkd: 7050,
+    jke: 7051,
+    jkf: 7052,
+    jkg: 7053,
+    jkh: 7054,
+    jki: 7055,
+    jkj: 7056,
+    jkk: 7057,
+    jkl: 7058,
+    jkm: 7059,
+    jkn: 7060,
+    jko: 7061,
+    jkp: 7062,
+    jkq: 7063,
+    jkr: 7064,
+    jks: 7065,
+    jkt: 7066,
+    jku: 7067,
+    jkv: 7068,
+    jkw: 7069,
+    jkx: 7070,
+    jky: 7071,
+    jlz: 7072,
+    jla: 7073,
+    jlb: 7074,
+    jlc: 7075,
+    jld: 7076,
+    jle: 7077,
+    jlf: 7078,
+    jlg: 7079,
+    jlh: 7080,
+    jli: 7081,
+    jlj: 7082,
+    jlk: 7083,
+    jll: 7084,
+    jlm: 7085,
+    jln: 7086,
+    jlo: 7087,
+    jlp: 7088,
+    jlq: 7089,
+    jlr: 7090,
+    jls: 7091,
+    jlt: 7092,
+    jlu: 7093,
+    jlv: 7094,
+    jlw: 7095,
+    jlx: 7096,
+    jly: 7097,
+    jmz: 7098,
+    jma: 7099,
+    jmb: 7100,
+    jmc: 7101,
+    jmd: 7102,
+    jme: 7103,
+    jmf: 7104,
+    jmg: 7105,
+    jmh: 7106,
+    jmi: 7107,
+    jmj: 7108,
+    jmk: 7109,
+    jml: 7110,
+    jmm: 7111,
+    jmn: 7112,
+    jmo: 7113,
+    jmp: 7114,
+    jmq: 7115,
+    jmr: 7116,
+    jms: 7117,
+    jmt: 7118,
+    jmu: 7119,
+    jmv: 7120,
+    jmw: 7121,
+    jmx: 7122,
+    jmy: 7123,
+    jnz: 7124,
+    jna: 7125,
+    jnb: 7126,
+    jnc: 7127,
+    jnd: 7128,
+    jne: 7129,
+    jnf: 7130,
+    jng: 7131,
+    jnh: 7132,
+    jni: 7133,
+    jnj: 7134,
+    jnk: 7135,
+    jnl: 7136,
+    jnm: 7137,
+    jnn: 7138,
+    jno: 7139,
+    jnp: 7140,
+    jnq: 7141,
+    jnr: 7142,
+    jns: 7143,
+    jnt: 7144,
+    jnu: 7145,
+    jnv: 7146,
+    jnw: 7147,
+    jnx: 7148,
+    jny: 7149,
+    joz: 7150,
+    joa: 7151,
+    job: 7152,
+    joc: 7153,
+    jod: 7154,
+    joe: 7155,
+    jof: 7156,
+    jog: 7157,
+    joh: 7158,
+    joi: 7159,
+    joj: 7160,
+    jok: 7161,
+    jol: 7162,
+    jom: 7163,
+    jon: 7164,
+    joo: 7165,
+    jop: 7166,
+    joq: 7167,
+    jor: 7168,
+    jos: 7169,
+    jot: 7170,
+    jou: 7171,
+    jov: 7172,
+    jow: 7173,
+    jox: 7174,
+    joy: 7175,
+    jpz: 7176,
+    jpa: 7177,
+    jpb: 7178,
+    jpc: 7179,
+    jpd: 7180,
+    jpe: 7181,
+    jpf: 7182,
+    jpg: 7183,
+    jph: 7184,
+    jpi: 7185,
+    jpj: 7186,
+    jpk: 7187,
+    jpl: 7188,
+    jpm: 7189,
+    jpn: 7190,
+    jpo: 7191,
+    jpp: 7192,
+    jpq: 7193,
+    jpr: 7194,
+    jps: 7195,
+    jpt: 7196,
+    jpu: 7197,
+    jpv: 7198,
+    jpw: 7199,
+    jpx: 7200,
+    jpy: 7201,
+    jqz: 7202,
+    jqa: 7203,
+    jqb: 7204,
+    jqc: 7205,
+    jqd: 7206,
+    jqe: 7207,
+    jqf: 7208,
+    jqg: 7209,
+    jqh: 7210,
+    jqi: 7211,
+    jqj: 7212,
+    jqk: 7213,
+    jql: 7214,
+    jqm: 7215,
+    jqn: 7216,
+    jqo: 7217,
+    jqp: 7218,
+    jqq: 7219,
+    jqr: 7220,
+    jqs: 7221,
+    jqt: 7222,
+    jqu: 7223,
+    jqv: 7224,
+    jqw: 7225,
+    jqx: 7226,
+    jqy: 7227,
+    jrz: 7228,
+    jra: 7229,
+    jrb: 7230,
+    jrc: 7231,
+    jrd: 7232,
+    jre: 7233,
+    jrf: 7234,
+    jrg: 7235,
+    jrh: 7236,
+    jri: 7237,
+    jrj: 7238,
+    jrk: 7239,
+    jrl: 7240,
+    jrm: 7241,
+    jrn: 7242,
+    jro: 7243,
+    jrp: 7244,
+    jrq: 7245,
+    jrr: 7246,
+    jrs: 7247,
+    jrt: 7248,
+    jru: 7249,
+    jrv: 7250,
+    jrw: 7251,
+    jrx: 7252,
+    jry: 7253,
+    jsz: 7254,
+    jsa: 7255,
+    jsb: 7256,
+    jsc: 7257,
+    jsd: 7258,
+    jse: 7259,
+    jsf: 7260,
+    jsg: 7261,
+    jsh: 7262,
+    jsi: 7263,
+    jsj: 7264,
+    jsk: 7265,
+    jsl: 7266,
+    jsm: 7267,
+    jsn: 7268,
+    jso: 7269,
+    jsp: 7270,
+    jsq: 7271,
+    jsr: 7272,
+    jss: 7273,
+    jst: 7274,
+    jsu: 7275,
+    jsv: 7276,
+    jsw: 7277,
+    jsx: 7278,
+    jsy: 7279,
+    jtz: 7280,
+    jta: 7281,
+    jtb: 7282,
+    jtc: 7283,
+    jtd: 7284,
+    jte: 7285,
+    jtf: 7286,
+    jtg: 7287,
+    jth: 7288,
+    jti: 7289,
+    jtj: 7290,
+    jtk: 7291,
+    jtl: 7292,
+    jtm: 7293,
+    jtn: 7294,
+    jto: 7295,
+    jtp: 7296,
+    jtq: 7297,
+    jtr: 7298,
+    jts: 7299,
+    jtt: 7300,
+    jtu: 7301,
+    jtv: 7302,
+    jtw: 7303,
+    jtx: 7304,
+    jty: 7305,
+    juz: 7306,
+    jua: 7307,
+    jub: 7308,
+    juc: 7309,
+    jud: 7310,
+    jue: 7311,
+    juf: 7312,
+    jug: 7313,
+    juh: 7314,
+    jui: 7315,
+    juj: 7316,
+    juk: 7317,
+    jul: 7318,
+    jum: 7319,
+    jun: 7320,
+    juo: 7321,
+    jup: 7322,
+    juq: 7323,
+    jur: 7324,
+    jus: 7325,
+    jut: 7326,
+    juu: 7327,
+    juv: 7328,
+    juw: 7329,
+    jux: 7330,
+    juy: 7331,
+    jvz: 7332,
+    jva: 7333,
+    jvb: 7334,
+    jvc: 7335,
+    jvd: 7336,
+    jve: 7337,
+    jvf: 7338,
+    jvg: 7339,
+    jvh: 7340,
+    jvi: 7341,
+    jvj: 7342,
+    jvk: 7343,
+    jvl: 7344,
+    jvm: 7345,
+    jvn: 7346,
+    jvo: 7347,
+    jvp: 7348,
+    jvq: 7349,
+    jvr: 7350,
+    jvs: 7351,
+    jvt: 7352,
+    jvu: 7353,
+    jvv: 7354,
+    jvw: 7355,
+    jvx: 7356,
+    jvy: 7357,
+    jwz: 7358,
+    jwa: 7359,
+    jwb: 7360,
+    jwc: 7361,
+    jwd: 7362,
+    jwe: 7363,
+    jwf: 7364,
+    jwg: 7365,
+    jwh: 7366,
+    jwi: 7367,
+    jwj: 7368,
+    jwk: 7369,
+    jwl: 7370,
+    jwm: 7371,
+    jwn: 7372,
+    jwo: 7373,
+    jwp: 7374,
+    jwq: 7375,
+    jwr: 7376,
+    jws: 7377,
+    jwt: 7378,
+    jwu: 7379,
+    jwv: 7380,
+    jww: 7381,
+    jwx: 7382,
+    jwy: 7383,
+    jxz: 7384,
+    jxa: 7385,
+    jxb: 7386,
+    jxc: 7387,
+    jxd: 7388,
+    jxe: 7389,
+    jxf: 7390,
+    jxg: 7391,
+    jxh: 7392,
+    jxi: 7393,
+    jxj: 7394,
+    jxk: 7395,
+    jxl: 7396,
+    jxm: 7397,
+    jxn: 7398,
+    jxo: 7399,
+    jxp: 7400,
+    jxq: 7401,
+    jxr: 7402,
+    jxs: 7403,
+    jxt: 7404,
+    jxu: 7405,
+    jxv: 7406,
+    jxw: 7407,
+    jxx: 7408,
+    jxy: 7409,
+    jyz: 7410,
+    jya: 7411,
+    jyb: 7412,
+    jyc: 7413,
+    jyd: 7414,
+    jye: 7415,
+    jyf: 7416,
+    jyg: 7417,
+    jyh: 7418,
+    jyi: 7419,
+    jyj: 7420,
+    jyk: 7421,
+    jyl: 7422,
+    jym: 7423,
+    jyn: 7424,
+    jyo: 7425,
+    jyp: 7426,
+    jyq: 7427,
+    jyr: 7428,
+    jys: 7429,
+    jyt: 7430,
+    jyu: 7431,
+    jyv: 7432,
+    jyw: 7433,
+    jyx: 7434,
+    jyy: 7435,
+    kzz: 7436,
+    kza: 7437,
+    kzb: 7438,
+    kzc: 7439,
+    kzd: 7440,
+    kze: 7441,
+    kzf: 7442,
+    kzg: 7443,
+    kzh: 7444,
+    kzi: 7445,
+    kzj: 7446,
+    kzk: 7447,
+    kzl: 7448,
+    kzm: 7449,
+    kzn: 7450,
+    kzo: 7451,
+    kzp: 7452,
+    kzq: 7453,
+    kzr: 7454,
+    kzs: 7455,
+    kzt: 7456,
+    kzu: 7457,
+    kzv: 7458,
+    kzw: 7459,
+    kzx: 7460,
+    kzy: 7461,
+    kaz: 7462,
+    kaa: 7463,
+    kab: 7464,
+    kac: 7465,
+    kad: 7466,
+    kae: 7467,
+    kaf: 7468,
+    kag: 7469,
+    kah: 7470,
+    kai: 7471,
+    kaj: 7472,
+    kak: 7473,
+    kal: 7474,
+    kam: 7475,
+    kan: 7476,
+    kao: 7477,
+    kap: 7478,
+    kaq: 7479,
+    kar: 7480,
+    kas: 7481,
+    kat: 7482,
+    kau: 7483,
+    kav: 7484,
+    kaw: 7485,
+    kax: 7486,
+    kay: 7487,
+    kbz: 7488,
+    kba: 7489,
+    kbb: 7490,
+    kbc: 7491,
+    kbd: 7492,
+    kbe: 7493,
+    kbf: 7494,
+    kbg: 7495,
+    kbh: 7496,
+    kbi: 7497,
+    kbj: 7498,
+    kbk: 7499,
+    kbl: 7500,
+    kbm: 7501,
+    kbn: 7502,
+    kbo: 7503,
+    kbp: 7504,
+    kbq: 7505,
+    kbr: 7506,
+    kbs: 7507,
+    kbt: 7508,
+    kbu: 7509,
+    kbv: 7510,
+    kbw: 7511,
+    kbx: 7512,
+    kby: 7513,
+    kcz: 7514,
+    kca: 7515,
+    kcb: 7516,
+    kcc: 7517,
+    kcd: 7518,
+    kce: 7519,
+    kcf: 7520,
+    kcg: 7521,
+    kch: 7522,
+    kci: 7523,
+    kcj: 7524,
+    kck: 7525,
+    kcl: 7526,
+    kcm: 7527,
+    kcn: 7528,
+    kco: 7529,
+    kcp: 7530,
+    kcq: 7531,
+    kcr: 7532,
+    kcs: 7533,
+    kct: 7534,
+    kcu: 7535,
+    kcv: 7536,
+    kcw: 7537,
+    kcx: 7538,
+    kcy: 7539,
+    kdz: 7540,
+    kda: 7541,
+    kdb: 7542,
+    kdc: 7543,
+    kdd: 7544,
+    kde: 7545,
+    kdf: 7546,
+    kdg: 7547,
+    kdh: 7548,
+    kdi: 7549,
+    kdj: 7550,
+    kdk: 7551,
+    kdl: 7552,
+    kdm: 7553,
+    kdn: 7554,
+    kdo: 7555,
+    kdp: 7556,
+    kdq: 7557,
+    kdr: 7558,
+    kds: 7559,
+    kdt: 7560,
+    kdu: 7561,
+    kdv: 7562,
+    kdw: 7563,
+    kdx: 7564,
+    kdy: 7565,
+    kez: 7566,
+    kea: 7567,
+    keb: 7568,
+    kec: 7569,
+    ked: 7570,
+    kee: 7571,
+    kef: 7572,
+    keg: 7573,
+    keh: 7574,
+    kei: 7575,
+    kej: 7576,
+    kek: 7577,
+    kel: 7578,
+    kem: 7579,
+    ken: 7580,
+    keo: 7581,
+    kep: 7582,
+    keq: 7583,
+    ker: 7584,
+    kes: 7585,
+    ket: 7586,
+    keu: 7587,
+    kev: 7588,
+    kew: 7589,
+    kex: 7590,
+    key: 7591,
+    kfz: 7592,
+    kfa: 7593,
+    kfb: 7594,
+    kfc: 7595,
+    kfd: 7596,
+    kfe: 7597,
+    kff: 7598,
+    kfg: 7599,
+    kfh: 7600,
+    kfi: 7601,
+    kfj: 7602,
+    kfk: 7603,
+    kfl: 7604,
+    kfm: 7605,
+    kfn: 7606,
+    kfo: 7607,
+    kfp: 7608,
+    kfq: 7609,
+    kfr: 7610,
+    kfs: 7611,
+    kft: 7612,
+    kfu: 7613,
+    kfv: 7614,
+    kfw: 7615,
+    kfx: 7616,
+    kfy: 7617,
+    kgz: 7618,
+    kga: 7619,
+    kgb: 7620,
+    kgc: 7621,
+    kgd: 7622,
+    kge: 7623,
+    kgf: 7624,
+    kgg: 7625,
+    kgh: 7626,
+    kgi: 7627,
+    kgj: 7628,
+    kgk: 7629,
+    kgl: 7630,
+    kgm: 7631,
+    kgn: 7632,
+    kgo: 7633,
+    kgp: 7634,
+    kgq: 7635,
+    kgr: 7636,
+    kgs: 7637,
+    kgt: 7638,
+    kgu: 7639,
+    kgv: 7640,
+    kgw: 7641,
+    kgx: 7642,
+    kgy: 7643,
+    khz: 7644,
+    kha: 7645,
+    khb: 7646,
+    khc: 7647,
+    khd: 7648,
+    khe: 7649,
+    khf: 7650,
+    khg: 7651,
+    khh: 7652,
+    khi: 7653,
+    khj: 7654,
+    khk: 7655,
+    khl: 7656,
+    khm: 7657,
+    khn: 7658,
+    kho: 7659,
+    khp: 7660,
+    khq: 7661,
+    khr: 7662,
+    khs: 7663,
+    kht: 7664,
+    khu: 7665,
+    khv: 7666,
+    khw: 7667,
+    khx: 7668,
+    khy: 7669,
+    kiz: 7670,
+    kia: 7671,
+    kib: 7672,
+    kic: 7673,
+    kid: 7674,
+    kie: 7675,
+    kif: 7676,
+    kig: 7677,
+    kih: 7678,
+    kii: 7679,
+    kij: 7680,
+    kik: 7681,
+    kil: 7682,
+    kim: 7683,
+    kin: 7684,
+    kio: 7685,
+    kip: 7686,
+    kiq: 7687,
+    kir: 7688,
+    kis: 7689,
+    kit: 7690,
+    kiu: 7691,
+    kiv: 7692,
+    kiw: 7693,
+    kix: 7694,
+    kiy: 7695,
+    kjz: 7696,
+    kja: 7697,
+    kjb: 7698,
+    kjc: 7699,
+    kjd: 7700,
+    kje: 7701,
+    kjf: 7702,
+    kjg: 7703,
+    kjh: 7704,
+    kji: 7705,
+    kjj: 7706,
+    kjk: 7707,
+    kjl: 7708,
+    kjm: 7709,
+    kjn: 7710,
+    kjo: 7711,
+    kjp: 7712,
+    kjq: 7713,
+    kjr: 7714,
+    kjs: 7715,
+    kjt: 7716,
+    kju: 7717,
+    kjv: 7718,
+    kjw: 7719,
+    kjx: 7720,
+    kjy: 7721,
+    kkz: 7722,
+    kka: 7723,
+    kkb: 7724,
+    kkc: 7725,
+    kkd: 7726,
+    kke: 7727,
+    kkf: 7728,
+    kkg: 7729,
+    kkh: 7730,
+    kki: 7731,
+    kkj: 7732,
+    kkk: 7733,
+    kkl: 7734,
+    kkm: 7735,
+    kkn: 7736,
+    kko: 7737,
+    kkp: 7738,
+    kkq: 7739,
+    kkr: 7740,
+    kks: 7741,
+    kkt: 7742,
+    kku: 7743,
+    kkv: 7744,
+    kkw: 7745,
+    kkx: 7746,
+    kky: 7747,
+    klz: 7748,
+    kla: 7749,
+    klb: 7750,
+    klc: 7751,
+    kld: 7752,
+    kle: 7753,
+    klf: 7754,
+    klg: 7755,
+    klh: 7756,
+    kli: 7757,
+    klj: 7758,
+    klk: 7759,
+    kll: 7760,
+    klm: 7761,
+    kln: 7762,
+    klo: 7763,
+    klp: 7764,
+    klq: 7765,
+    klr: 7766,
+    kls: 7767,
+    klt: 7768,
+    klu: 7769,
+    klv: 7770,
+    klw: 7771,
+    klx: 7772,
+    kly: 7773,
+    kmz: 7774,
+    kma: 7775,
+    kmb: 7776,
+    kmc: 7777,
+    kmd: 7778,
+    kme: 7779,
+    kmf: 7780,
+    kmg: 7781,
+    kmh: 7782,
+    kmi: 7783,
+    kmj: 7784,
+    kmk: 7785,
+    kml: 7786,
+    kmm: 7787,
+    kmn: 7788,
+    kmo: 7789,
+    kmp: 7790,
+    kmq: 7791,
+    kmr: 7792,
+    kms: 7793,
+    kmt: 7794,
+    kmu: 7795,
+    kmv: 7796,
+    kmw: 7797,
+    kmx: 7798,
+    kmy: 7799,
+    knz: 7800,
+    kna: 7801,
+    knb: 7802,
+    knc: 7803,
+    knd: 7804,
+    kne: 7805,
+    knf: 7806,
+    kng: 7807,
+    knh: 7808,
+    kni: 7809,
+    knj: 7810,
+    knk: 7811,
+    knl: 7812,
+    knm: 7813,
+    knn: 7814,
+    kno: 7815,
+    knp: 7816,
+    knq: 7817,
+    knr: 7818,
+    kns: 7819,
+    knt: 7820,
+    knu: 7821,
+    knv: 7822,
+    knw: 7823,
+    knx: 7824,
+    kny: 7825,
+    koz: 7826,
+    koa: 7827,
+    kob: 7828,
+    koc: 7829,
+    kod: 7830,
+    koe: 7831,
+    kof: 7832,
+    kog: 7833,
+    koh: 7834,
+    koi: 7835,
+    koj: 7836,
+    kok: 7837,
+    kol: 7838,
+    kom: 7839,
+    kon: 7840,
+    koo: 7841,
+    kop: 7842,
+    koq: 7843,
+    kor: 7844,
+    kos: 7845,
+    kot: 7846,
+    kou: 7847,
+    kov: 7848,
+    kow: 7849,
+    kox: 7850,
+    koy: 7851,
+    kpz: 7852,
+    kpa: 7853,
+    kpb: 7854,
+    kpc: 7855,
+    kpd: 7856,
+    kpe: 7857,
+    kpf: 7858,
+    kpg: 7859,
+    kph: 7860,
+    kpi: 7861,
+    kpj: 7862,
+    kpk: 7863,
+    kpl: 7864,
+    kpm: 7865,
+    kpn: 7866,
+    kpo: 7867,
+    kpp: 7868,
+    kpq: 7869,
+    kpr: 7870,
+    kps: 7871,
+    kpt: 7872,
+    kpu: 7873,
+    kpv: 7874,
+    kpw: 7875,
+    kpx: 7876,
+    kpy: 7877,
+    kqz: 7878,
+    kqa: 7879,
+    kqb: 7880,
+    kqc: 7881,
+    kqd: 7882,
+    kqe: 7883,
+    kqf: 7884,
+    kqg: 7885,
+    kqh: 7886,
+    kqi: 7887,
+    kqj: 7888,
+    kqk: 7889,
+    kql: 7890,
+    kqm: 7891,
+    kqn: 7892,
+    kqo: 7893,
+    kqp: 7894,
+    kqq: 7895,
+    kqr: 7896,
+    kqs: 7897,
+    kqt: 7898,
+    kqu: 7899,
+    kqv: 7900,
+    kqw: 7901,
+    kqx: 7902,
+    kqy: 7903,
+    krz: 7904,
+    kra: 7905,
+    krb: 7906,
+    krc: 7907,
+    krd: 7908,
+    kre: 7909,
+    krf: 7910,
+    krg: 7911,
+    krh: 7912,
+    kri: 7913,
+    krj: 7914,
+    krk: 7915,
+    krl: 7916,
+    krm: 7917,
+    krn: 7918,
+    kro: 7919,
+    krp: 7920,
+    krq: 7921,
+    krr: 7922,
+    krs: 7923,
+    krt: 7924,
+    kru: 7925,
+    krv: 7926,
+    krw: 7927,
+    krx: 7928,
+    kry: 7929,
+    ksz: 7930,
+    ksa: 7931,
+    ksb: 7932,
+    ksc: 7933,
+    ksd: 7934,
+    kse: 7935,
+    ksf: 7936,
+    ksg: 7937,
+    ksh: 7938,
+    ksi: 7939,
+    ksj: 7940,
+    ksk: 7941,
+    ksl: 7942,
+    ksm: 7943,
+    ksn: 7944,
+    kso: 7945,
+    ksp: 7946,
+    ksq: 7947,
+    ksr: 7948,
+    kss: 7949,
+    kst: 7950,
+    ksu: 7951,
+    ksv: 7952,
+    ksw: 7953,
+    ksx: 7954,
+    ksy: 7955,
+    ktz: 7956,
+    kta: 7957,
+    ktb: 7958,
+    ktc: 7959,
+    ktd: 7960,
+    kte: 7961,
+    ktf: 7962,
+    ktg: 7963,
+    kth: 7964,
+    kti: 7965,
+    ktj: 7966,
+    ktk: 7967,
+    ktl: 7968,
+    ktm: 7969,
+    ktn: 7970,
+    kto: 7971,
+    ktp: 7972,
+    ktq: 7973,
+    ktr: 7974,
+    kts: 7975,
+    ktt: 7976,
+    ktu: 7977,
+    ktv: 7978,
+    ktw: 7979,
+    ktx: 7980,
+    kty: 7981,
+    kuz: 7982,
+    kua: 7983,
+    kub: 7984,
+    kuc: 7985,
+    kud: 7986,
+    kue: 7987,
+    kuf: 7988,
+    kug: 7989,
+    kuh: 7990,
+    kui: 7991,
+    kuj: 7992,
+    kuk: 7993,
+    kul: 7994,
+    kum: 7995,
+    kun: 7996,
+    kuo: 7997,
+    kup: 7998,
+    kuq: 7999,
+    kur: 8000,
+    kus: 8001,
+    kut: 8002,
+    kuu: 8003,
+    kuv: 8004,
+    kuw: 8005,
+    kux: 8006,
+    kuy: 8007,
+    kvz: 8008,
+    kva: 8009,
+    kvb: 8010,
+    kvc: 8011,
+    kvd: 8012,
+    kve: 8013,
+    kvf: 8014,
+    kvg: 8015,
+    kvh: 8016,
+    kvi: 8017,
+    kvj: 8018,
+    kvk: 8019,
+    kvl: 8020,
+    kvm: 8021,
+    kvn: 8022,
+    kvo: 8023,
+    kvp: 8024,
+    kvq: 8025,
+    kvr: 8026,
+    kvs: 8027,
+    kvt: 8028,
+    kvu: 8029,
+    kvv: 8030,
+    kvw: 8031,
+    kvx: 8032,
+    kvy: 8033,
+    kwz: 8034,
+    kwa: 8035,
+    kwb: 8036,
+    kwc: 8037,
+    kwd: 8038,
+    kwe: 8039,
+    kwf: 8040,
+    kwg: 8041,
+    kwh: 8042,
+    kwi: 8043,
+    kwj: 8044,
+    kwk: 8045,
+    kwl: 8046,
+    kwm: 8047,
+    kwn: 8048,
+    kwo: 8049,
+    kwp: 8050,
+    kwq: 8051,
+    kwr: 8052,
+    kws: 8053,
+    kwt: 8054,
+    kwu: 8055,
+    kwv: 8056,
+    kww: 8057,
+    kwx: 8058,
+    kwy: 8059,
+    kxz: 8060,
+    kxa: 8061,
+    kxb: 8062,
+    kxc: 8063,
+    kxd: 8064,
+    kxe: 8065,
+    kxf: 8066,
+    kxg: 8067,
+    kxh: 8068,
+    kxi: 8069,
+    kxj: 8070,
+    kxk: 8071,
+    kxl: 8072,
+    kxm: 8073,
+    kxn: 8074,
+    kxo: 8075,
+    kxp: 8076,
+    kxq: 8077,
+    kxr: 8078,
+    kxs: 8079,
+    kxt: 8080,
+    kxu: 8081,
+    kxv: 8082,
+    kxw: 8083,
+    kxx: 8084,
+    kxy: 8085,
+    kyz: 8086,
+    kya: 8087,
+    kyb: 8088,
+    kyc: 8089,
+    kyd: 8090,
+    kye: 8091,
+    kyf: 8092,
+    kyg: 8093,
+    kyh: 8094,
+    kyi: 8095,
+    kyj: 8096,
+    kyk: 8097,
+    kyl: 8098,
+    kym: 8099,
+    kyn: 8100,
+    kyo: 8101,
+    kyp: 8102,
+    kyq: 8103,
+    kyr: 8104,
+    kys: 8105,
+    kyt: 8106,
+    kyu: 8107,
+    kyv: 8108,
+    kyw: 8109,
+    kyx: 8110,
+    kyy: 8111,
+    lzz: 8112,
+    lza: 8113,
+    lzb: 8114,
+    lzc: 8115,
+    lzd: 8116,
+    lze: 8117,
+    lzf: 8118,
+    lzg: 8119,
+    lzh: 8120,
+    lzi: 8121,
+    lzj: 8122,
+    lzk: 8123,
+    lzl: 8124,
+    lzm: 8125,
+    lzn: 8126,
+    lzo: 8127,
+    lzp: 8128,
+    lzq: 8129,
+    lzr: 8130,
+    lzs: 8131,
+    lzt: 8132,
+    lzu: 8133,
+    lzv: 8134,
+    lzw: 8135,
+    lzx: 8136,
+    lzy: 8137,
+    laz: 8138,
+    laa: 8139,
+    lab: 8140,
+    lac: 8141,
+    lad: 8142,
+    lae: 8143,
+    laf: 8144,
+    lag: 8145,
+    lah: 8146,
+    lai: 8147,
+    laj: 8148,
+    lak: 8149,
+    lal: 8150,
+    lam: 8151,
+    lan: 8152,
+    lao: 8153,
+    lap: 8154,
+    laq: 8155,
+    lar: 8156,
+    las: 8157,
+    lat: 8158,
+    lau: 8159,
+    lav: 8160,
+    law: 8161,
+    lax: 8162,
+    lay: 8163,
+    lbz: 8164,
+    lba: 8165,
+    lbb: 8166,
+    lbc: 8167,
+    lbd: 8168,
+    lbe: 8169,
+    lbf: 8170,
+    lbg: 8171,
+    lbh: 8172,
+    lbi: 8173,
+    lbj: 8174,
+    lbk: 8175,
+    lbl: 8176,
+    lbm: 8177,
+    lbn: 8178,
+    lbo: 8179,
+    lbp: 8180,
+    lbq: 8181,
+    lbr: 8182,
+    lbs: 8183,
+    lbt: 8184,
+    lbu: 8185,
+    lbv: 8186,
+    lbw: 8187,
+    lbx: 8188,
+    lby: 8189,
+    lcz: 8190,
+    lca: 8191,
+    lcb: 8192,
+    lcc: 8193,
+    lcd: 8194,
+    lce: 8195,
+    lcf: 8196,
+    lcg: 8197,
+    lch: 8198,
+    lci: 8199,
+    lcj: 8200,
+    lck: 8201,
+    lcl: 8202,
+    lcm: 8203,
+    lcn: 8204,
+    lco: 8205,
+    lcp: 8206,
+    lcq: 8207,
+    lcr: 8208,
+    lcs: 8209,
+    lct: 8210,
+    lcu: 8211,
+    lcv: 8212,
+    lcw: 8213,
+    lcx: 8214,
+    lcy: 8215,
+    ldz: 8216,
+    lda: 8217,
+    ldb: 8218,
+    ldc: 8219,
+    ldd: 8220,
+    lde: 8221,
+    ldf: 8222,
+    ldg: 8223,
+    ldh: 8224,
+    ldi: 8225,
+    ldj: 8226,
+    ldk: 8227,
+    ldl: 8228,
+    ldm: 8229,
+    ldn: 8230,
+    ldo: 8231,
+    ldp: 8232,
+    ldq: 8233,
+    ldr: 8234,
+    lds: 8235,
+    ldt: 8236,
+    ldu: 8237,
+    ldv: 8238,
+    ldw: 8239,
+    ldx: 8240,
+    ldy: 8241,
+    lez: 8242,
+    lea: 8243,
+    leb: 8244,
+    lec: 8245,
+    led: 8246,
+    lee: 8247,
+    lef: 8248,
+    leg: 8249,
+    leh: 8250,
+    lei: 8251,
+    lej: 8252,
+    lek: 8253,
+    lel: 8254,
+    lem: 8255,
+    len: 8256,
+    leo: 8257,
+    lep: 8258,
+    leq: 8259,
+    ler: 8260,
+    les: 8261,
+    let: 8262,
+    leu: 8263,
+    lev: 8264,
+    lew: 8265,
+    lex: 8266,
+    ley: 8267,
+    lfz: 8268,
+    lfa: 8269,
+    lfb: 8270,
+    lfc: 8271,
+    lfd: 8272,
+    lfe: 8273,
+    lff: 8274,
+    lfg: 8275,
+    lfh: 8276,
+    lfi: 8277,
+    lfj: 8278,
+    lfk: 8279,
+    lfl: 8280,
+    lfm: 8281,
+    lfn: 8282,
+    lfo: 8283,
+    lfp: 8284,
+    lfq: 8285,
+    lfr: 8286,
+    lfs: 8287,
+    lft: 8288,
+    lfu: 8289,
+    lfv: 8290,
+    lfw: 8291,
+    lfx: 8292,
+    lfy: 8293,
+    lgz: 8294,
+    lga: 8295,
+    lgb: 8296,
+    lgc: 8297,
+    lgd: 8298,
+    lge: 8299,
+    lgf: 8300,
+    lgg: 8301,
+    lgh: 8302,
+    lgi: 8303,
+    lgj: 8304,
+    lgk: 8305,
+    lgl: 8306,
+    lgm: 8307,
+    lgn: 8308,
+    lgo: 8309,
+    lgp: 8310,
+    lgq: 8311,
+    lgr: 8312,
+    lgs: 8313,
+    lgt: 8314,
+    lgu: 8315,
+    lgv: 8316,
+    lgw: 8317,
+    lgx: 8318,
+    lgy: 8319,
+    lhz: 8320,
+    lha: 8321,
+    lhb: 8322,
+    lhc: 8323,
+    lhd: 8324,
+    lhe: 8325,
+    lhf: 8326,
+    lhg: 8327,
+    lhh: 8328,
+    lhi: 8329,
+    lhj: 8330,
+    lhk: 8331,
+    lhl: 8332,
+    lhm: 8333,
+    lhn: 8334,
+    lho: 8335,
+    lhp: 8336,
+    lhq: 8337,
+    lhr: 8338,
+    lhs: 8339,
+    lht: 8340,
+    lhu: 8341,
+    lhv: 8342,
+    lhw: 8343,
+    lhx: 8344,
+    lhy: 8345,
+    liz: 8346,
+    lia: 8347,
+    lib: 8348,
+    lic: 8349,
+    lid: 8350,
+    lie: 8351,
+    lif: 8352,
+    lig: 8353,
+    lih: 8354,
+    lii: 8355,
+    lij: 8356,
+    lik: 8357,
+    lil: 8358,
+    lim: 8359,
+    lin: 8360,
+    lio: 8361,
+    lip: 8362,
+    liq: 8363,
+    lir: 8364,
+    lis: 8365,
+    lit: 8366,
+    liu: 8367,
+    liv: 8368,
+    liw: 8369,
+    lix: 8370,
+    liy: 8371,
+    ljz: 8372,
+    lja: 8373,
+    ljb: 8374,
+    ljc: 8375,
+    ljd: 8376,
+    lje: 8377,
+    ljf: 8378,
+    ljg: 8379,
+    ljh: 8380,
+    lji: 8381,
+    ljj: 8382,
+    ljk: 8383,
+    ljl: 8384,
+    ljm: 8385,
+    ljn: 8386,
+    ljo: 8387,
+    ljp: 8388,
+    ljq: 8389,
+    ljr: 8390,
+    ljs: 8391,
+    ljt: 8392,
+    lju: 8393,
+    ljv: 8394,
+    ljw: 8395,
+    ljx: 8396,
+    ljy: 8397,
+    lkz: 8398,
+    lka: 8399,
+    lkb: 8400,
+    lkc: 8401,
+    lkd: 8402,
+    lke: 8403,
+    lkf: 8404,
+    lkg: 8405,
+    lkh: 8406,
+    lki: 8407,
+    lkj: 8408,
+    lkk: 8409,
+    lkl: 8410,
+    lkm: 8411,
+    lkn: 8412,
+    lko: 8413,
+    lkp: 8414,
+    lkq: 8415,
+    lkr: 8416,
+    lks: 8417,
+    lkt: 8418,
+    lku: 8419,
+    lkv: 8420,
+    lkw: 8421,
+    lkx: 8422,
+    lky: 8423,
+    llz: 8424,
+    lla: 8425,
+    llb: 8426,
+    llc: 8427,
+    lld: 8428,
+    lle: 8429,
+    llf: 8430,
+    llg: 8431,
+    llh: 8432,
+    lli: 8433,
+    llj: 8434,
+    llk: 8435,
+    lll: 8436,
+    llm: 8437,
+    lln: 8438,
+    llo: 8439,
+    llp: 8440,
+    llq: 8441,
+    llr: 8442,
+    lls: 8443,
+    llt: 8444,
+    llu: 8445,
+    llv: 8446,
+    llw: 8447,
+    llx: 8448,
+    lly: 8449,
+    lmz: 8450,
+    lma: 8451,
+    lmb: 8452,
+    lmc: 8453,
+    lmd: 8454,
+    lme: 8455,
+    lmf: 8456,
+    lmg: 8457,
+    lmh: 8458,
+    lmi: 8459,
+    lmj: 8460,
+    lmk: 8461,
+    lml: 8462,
+    lmm: 8463,
+    lmn: 8464,
+    lmo: 8465,
+    lmp: 8466,
+    lmq: 8467,
+    lmr: 8468,
+    lms: 8469,
+    lmt: 8470,
+    lmu: 8471,
+    lmv: 8472,
+    lmw: 8473,
+    lmx: 8474,
+    lmy: 8475,
+    lnz: 8476,
+    lna: 8477,
+    lnb: 8478,
+    lnc: 8479,
+    lnd: 8480,
+    lne: 8481,
+    lnf: 8482,
+    lng: 8483,
+    lnh: 8484,
+    lni: 8485,
+    lnj: 8486,
+    lnk: 8487,
+    lnl: 8488,
+    lnm: 8489,
+    lnn: 8490,
+    lno: 8491,
+    lnp: 8492,
+    lnq: 8493,
+    lnr: 8494,
+    lns: 8495,
+    lnt: 8496,
+    lnu: 8497,
+    lnv: 8498,
+    lnw: 8499,
+    lnx: 8500,
+    lny: 8501,
+    loz: 8502,
+    loa: 8503,
+    lob: 8504,
+    loc: 8505,
+    lod: 8506,
+    loe: 8507,
+    lof: 8508,
+    log: 8509,
+    loh: 8510,
+    loi: 8511,
+    loj: 8512,
+    lok: 8513,
+    lol: 8514,
+    lom: 8515,
+    lon: 8516,
+    loo: 8517,
+    lop: 8518,
+    loq: 8519,
+    lor: 8520,
+    los: 8521,
+    lot: 8522,
+    lou: 8523,
+    lov: 8524,
+    low: 8525,
+    lox: 8526,
+    loy: 8527,
+    lpz: 8528,
+    lpa: 8529,
+    lpb: 8530,
+    lpc: 8531,
+    lpd: 8532,
+    lpe: 8533,
+    lpf: 8534,
+    lpg: 8535,
+    lph: 8536,
+    lpi: 8537,
+    lpj: 8538,
+    lpk: 8539,
+    lpl: 8540,
+    lpm: 8541,
+    lpn: 8542,
+    lpo: 8543,
+    lpp: 8544,
+    lpq: 8545,
+    lpr: 8546,
+    lps: 8547,
+    lpt: 8548,
+    lpu: 8549,
+    lpv: 8550,
+    lpw: 8551,
+    lpx: 8552,
+    lpy: 8553,
+    lqz: 8554,
+    lqa: 8555,
+    lqb: 8556,
+    lqc: 8557,
+    lqd: 8558,
+    lqe: 8559,
+    lqf: 8560,
+    lqg: 8561,
+    lqh: 8562,
+    lqi: 8563,
+    lqj: 8564,
+    lqk: 8565,
+    lql: 8566,
+    lqm: 8567,
+    lqn: 8568,
+    lqo: 8569,
+    lqp: 8570,
+    lqq: 8571,
+    lqr: 8572,
+    lqs: 8573,
+    lqt: 8574,
+    lqu: 8575,
+    lqv: 8576,
+    lqw: 8577,
+    lqx: 8578,
+    lqy: 8579,
+    lrz: 8580,
+    lra: 8581,
+    lrb: 8582,
+    lrc: 8583,
+    lrd: 8584,
+    lre: 8585,
+    lrf: 8586,
+    lrg: 8587,
+    lrh: 8588,
+    lri: 8589,
+    lrj: 8590,
+    lrk: 8591,
+    lrl: 8592,
+    lrm: 8593,
+    lrn: 8594,
+    lro: 8595,
+    lrp: 8596,
+    lrq: 8597,
+    lrr: 8598,
+    lrs: 8599,
+    lrt: 8600,
+    lru: 8601,
+    lrv: 8602,
+    lrw: 8603,
+    lrx: 8604,
+    lry: 8605,
+    lsz: 8606,
+    lsa: 8607,
+    lsb: 8608,
+    lsc: 8609,
+    lsd: 8610,
+    lse: 8611,
+    lsf: 8612,
+    lsg: 8613,
+    lsh: 8614,
+    lsi: 8615,
+    lsj: 8616,
+    lsk: 8617,
+    lsl: 8618,
+    lsm: 8619,
+    lsn: 8620,
+    lso: 8621,
+    lsp: 8622,
+    lsq: 8623,
+    lsr: 8624,
+    lss: 8625,
+    lst: 8626,
+    lsu: 8627,
+    lsv: 8628,
+    lsw: 8629,
+    lsx: 8630,
+    lsy: 8631,
+    ltz: 8632,
+    lta: 8633,
+    ltb: 8634,
+    ltc: 8635,
+    ltd: 8636,
+    lte: 8637,
+    ltf: 8638,
+    ltg: 8639,
+    lth: 8640,
+    lti: 8641,
+    ltj: 8642,
+    ltk: 8643,
+    ltl: 8644,
+    ltm: 8645,
+    ltn: 8646,
+    lto: 8647,
+    ltp: 8648,
+    ltq: 8649,
+    ltr: 8650,
+    lts: 8651,
+    ltt: 8652,
+    ltu: 8653,
+    ltv: 8654,
+    ltw: 8655,
+    ltx: 8656,
+    lty: 8657,
+    luz: 8658,
+    lua: 8659,
+    lub: 8660,
+    luc: 8661,
+    lud: 8662,
+    lue: 8663,
+    luf: 8664,
+    lug: 8665,
+    luh: 8666,
+    lui: 8667,
+    luj: 8668,
+    luk: 8669,
+    lul: 8670,
+    lum: 8671,
+    lun: 8672,
+    luo: 8673,
+    lup: 8674,
+    luq: 8675,
+    lur: 8676,
+    lus: 8677,
+    lut: 8678,
+    luu: 8679,
+    luv: 8680,
+    luw: 8681,
+    lux: 8682,
+    luy: 8683,
+    lvz: 8684,
+    lva: 8685,
+    lvb: 8686,
+    lvc: 8687,
+    lvd: 8688,
+    lve: 8689,
+    lvf: 8690,
+    lvg: 8691,
+    lvh: 8692,
+    lvi: 8693,
+    lvj: 8694,
+    lvk: 8695,
+    lvl: 8696,
+    lvm: 8697,
+    lvn: 8698,
+    lvo: 8699,
+    lvp: 8700,
+    lvq: 8701,
+    lvr: 8702,
+    lvs: 8703,
+    lvt: 8704,
+    lvu: 8705,
+    lvv: 8706,
+    lvw: 8707,
+    lvx: 8708,
+    lvy: 8709,
+    lwz: 8710,
+    lwa: 8711,
+    lwb: 8712,
+    lwc: 8713,
+    lwd: 8714,
+    lwe: 8715,
+    lwf: 8716,
+    lwg: 8717,
+    lwh: 8718,
+    lwi: 8719,
+    lwj: 8720,
+    lwk: 8721,
+    lwl: 8722,
+    lwm: 8723,
+    lwn: 8724,
+    lwo: 8725,
+    lwp: 8726,
+    lwq: 8727,
+    lwr: 8728,
+    lws: 8729,
+    lwt: 8730,
+    lwu: 8731,
+    lwv: 8732,
+    lww: 8733,
+    lwx: 8734,
+    lwy: 8735,
+    lxz: 8736,
+    lxa: 8737,
+    lxb: 8738,
+    lxc: 8739,
+    lxd: 8740,
+    lxe: 8741,
+    lxf: 8742,
+    lxg: 8743,
+    lxh: 8744,
+    lxi: 8745,
+    lxj: 8746,
+    lxk: 8747,
+    lxl: 8748,
+    lxm: 8749,
+    lxn: 8750,
+    lxo: 8751,
+    lxp: 8752,
+    lxq: 8753,
+    lxr: 8754,
+    lxs: 8755,
+    lxt: 8756,
+    lxu: 8757,
+    lxv: 8758,
+    lxw: 8759,
+    lxx: 8760,
+    lxy: 8761,
+    lyz: 8762,
+    lya: 8763,
+    lyb: 8764,
+    lyc: 8765,
+    lyd: 8766,
+    lye: 8767,
+    lyf: 8768,
+    lyg: 8769,
+    lyh: 8770,
+    lyi: 8771,
+    lyj: 8772,
+    lyk: 8773,
+    lyl: 8774,
+    lym: 8775,
+    lyn: 8776,
+    lyo: 8777,
+    lyp: 8778,
+    lyq: 8779,
+    lyr: 8780,
+    lys: 8781,
+    lyt: 8782,
+    lyu: 8783,
+    lyv: 8784,
+    lyw: 8785,
+    lyx: 8786,
+    lyy: 8787,
+    mzz: 8788,
+    mza: 8789,
+    mzb: 8790,
+    mzc: 8791,
+    mzd: 8792,
+    mze: 8793,
+    mzf: 8794,
+    mzg: 8795,
+    mzh: 8796,
+    mzi: 8797,
+    mzj: 8798,
+    mzk: 8799,
+    mzl: 8800,
+    mzm: 8801,
+    mzn: 8802,
+    mzo: 8803,
+    mzp: 8804,
+    mzq: 8805,
+    mzr: 8806,
+    mzs: 8807,
+    mzt: 8808,
+    mzu: 8809,
+    mzv: 8810,
+    mzw: 8811,
+    mzx: 8812,
+    mzy: 8813,
+    maz: 8814,
+    maa: 8815,
+    mab: 8816,
+    mac: 8817,
+    mad: 8818,
+    mae: 8819,
+    maf: 8820,
+    mag: 8821,
+    mah: 8822,
+    mai: 8823,
+    maj: 8824,
+    mak: 8825,
+    mal: 8826,
+    mam: 8827,
+    man: 8828,
+    mao: 8829,
+    map: 8830,
+    maq: 8831,
+    mar: 8832,
+    mas: 8833,
+    mat: 8834,
+    mau: 8835,
+    mav: 8836,
+    maw: 8837,
+    max: 8838,
+    may: 8839,
+    mbz: 8840,
+    mba: 8841,
+    mbb: 8842,
+    mbc: 8843,
+    mbd: 8844,
+    mbe: 8845,
+    mbf: 8846,
+    mbg: 8847,
+    mbh: 8848,
+    mbi: 8849,
+    mbj: 8850,
+    mbk: 8851,
+    mbl: 8852,
+    mbm: 8853,
+    mbn: 8854,
+    mbo: 8855,
+    mbp: 8856,
+    mbq: 8857,
+    mbr: 8858,
+    mbs: 8859,
+    mbt: 8860,
+    mbu: 8861,
+    mbv: 8862,
+    mbw: 8863,
+    mbx: 8864,
+    mby: 8865,
+    mcz: 8866,
+    mca: 8867,
+    mcb: 8868,
+    mcc: 8869,
+    mcd: 8870,
+    mce: 8871,
+    mcf: 8872,
+    mcg: 8873,
+    mch: 8874,
+    mci: 8875,
+    mcj: 8876,
+    mck: 8877,
+    mcl: 8878,
+    mcm: 8879,
+    mcn: 8880,
+    mco: 8881,
+    mcp: 8882,
+    mcq: 8883,
+    mcr: 8884,
+    mcs: 8885,
+    mct: 8886,
+    mcu: 8887,
+    mcv: 8888,
+    mcw: 8889,
+    mcx: 8890,
+    mcy: 8891,
+    mdz: 8892,
+    mda: 8893,
+    mdb: 8894,
+    mdc: 8895,
+    mdd: 8896,
+    mde: 8897,
+    mdf: 8898,
+    mdg: 8899,
+    mdh: 8900,
+    mdi: 8901,
+    mdj: 8902,
+    mdk: 8903,
+    mdl: 8904,
+    mdm: 8905,
+    mdn: 8906,
+    mdo: 8907,
+    mdp: 8908,
+    mdq: 8909,
+    mdr: 8910,
+    mds: 8911,
+    mdt: 8912,
+    mdu: 8913,
+    mdv: 8914,
+    mdw: 8915,
+    mdx: 8916,
+    mdy: 8917,
+    mez: 8918,
+    mea: 8919,
+    meb: 8920,
+    mec: 8921,
+    med: 8922,
+    mee: 8923,
+    mef: 8924,
+    meg: 8925,
+    meh: 8926,
+    mei: 8927,
+    mej: 8928,
+    mek: 8929,
+    mel: 8930,
+    mem: 8931,
+    men: 8932,
+    meo: 8933,
+    mep: 8934,
+    meq: 8935,
+    mer: 8936,
+    mes: 8937,
+    met: 8938,
+    meu: 8939,
+    mev: 8940,
+    mew: 8941,
+    mex: 8942,
+    mey: 8943,
+    mfz: 8944,
+    mfa: 8945,
+    mfb: 8946,
+    mfc: 8947,
+    mfd: 8948,
+    mfe: 8949,
+    mff: 8950,
+    mfg: 8951,
+    mfh: 8952,
+    mfi: 8953,
+    mfj: 8954,
+    mfk: 8955,
+    mfl: 8956,
+    mfm: 8957,
+    mfn: 8958,
+    mfo: 8959,
+    mfp: 8960,
+    mfq: 8961,
+    mfr: 8962,
+    mfs: 8963,
+    mft: 8964,
+    mfu: 8965,
+    mfv: 8966,
+    mfw: 8967,
+    mfx: 8968,
+    mfy: 8969,
+    mgz: 8970,
+    mga: 8971,
+    mgb: 8972,
+    mgc: 8973,
+    mgd: 8974,
+    mge: 8975,
+    mgf: 8976,
+    mgg: 8977,
+    mgh: 8978,
+    mgi: 8979,
+    mgj: 8980,
+    mgk: 8981,
+    mgl: 8982,
+    mgm: 8983,
+    mgn: 8984,
+    mgo: 8985,
+    mgp: 8986,
+    mgq: 8987,
+    mgr: 8988,
+    mgs: 8989,
+    mgt: 8990,
+    mgu: 8991,
+    mgv: 8992,
+    mgw: 8993,
+    mgx: 8994,
+    mgy: 8995,
+    mhz: 8996,
+    mha: 8997,
+    mhb: 8998,
+    mhc: 8999,
+    mhd: 9000,
+    mhe: 9001,
+    mhf: 9002,
+    mhg: 9003,
+    mhh: 9004,
+    mhi: 9005,
+    mhj: 9006,
+    mhk: 9007,
+    mhl: 9008,
+    mhm: 9009,
+    mhn: 9010,
+    mho: 9011,
+    mhp: 9012,
+    mhq: 9013,
+    mhr: 9014,
+    mhs: 9015,
+    mht: 9016,
+    mhu: 9017,
+    mhv: 9018,
+    mhw: 9019,
+    mhx: 9020,
+    mhy: 9021,
+    miz: 9022,
+    mia: 9023,
+    mib: 9024,
+    mic: 9025,
+    mid: 9026,
+    mie: 9027,
+    mif: 9028,
+    mig: 9029,
+    mih: 9030,
+    mii: 9031,
+    mij: 9032,
+    mik: 9033,
+    mil: 9034,
+    mim: 9035,
+    min: 9036,
+    mio: 9037,
+    mip: 9038,
+    miq: 9039,
+    mir: 9040,
+    mis: 9041,
+    mit: 9042,
+    miu: 9043,
+    miv: 9044,
+    miw: 9045,
+    mix: 9046,
+    miy: 9047,
+    mjz: 9048,
+    mja: 9049,
+    mjb: 9050,
+    mjc: 9051,
+    mjd: 9052,
+    mje: 9053,
+    mjf: 9054,
+    mjg: 9055,
+    mjh: 9056,
+    mji: 9057,
+    mjj: 9058,
+    mjk: 9059,
+    mjl: 9060,
+    mjm: 9061,
+    mjn: 9062,
+    mjo: 9063,
+    mjp: 9064,
+    mjq: 9065,
+    mjr: 9066,
+    mjs: 9067,
+    mjt: 9068,
+    mju: 9069,
+    mjv: 9070,
+    mjw: 9071,
+    mjx: 9072,
+    mjy: 9073,
+    mkz: 9074,
+    mka: 9075,
+    mkb: 9076,
+    mkc: 9077,
+    mkd: 9078,
+    mke: 9079,
+    mkf: 9080,
+    mkg: 9081,
+    mkh: 9082,
+    mki: 9083,
+    mkj: 9084,
+    mkk: 9085,
+    mkl: 9086,
+    mkm: 9087,
+    mkn: 9088,
+    mko: 9089,
+    mkp: 9090,
+    mkq: 9091,
+    mkr: 9092,
+    mks: 9093,
+    mkt: 9094,
+    mku: 9095,
+    mkv: 9096,
+    mkw: 9097,
+    mkx: 9098,
+    mky: 9099,
+    mlz: 9100,
+    mla: 9101,
+    mlb: 9102,
+    mlc: 9103,
+    mld: 9104,
+    mle: 9105,
+    mlf: 9106,
+    mlg: 9107,
+    mlh: 9108,
+    mli: 9109,
+    mlj: 9110,
+    mlk: 9111,
+    mll: 9112,
+    mlm: 9113,
+    mln: 9114,
+    mlo: 9115,
+    mlp: 9116,
+    mlq: 9117,
+    mlr: 9118,
+    mls: 9119,
+    mlt: 9120,
+    mlu: 9121,
+    mlv: 9122,
+    mlw: 9123,
+    mlx: 9124,
+    mly: 9125,
+    mmz: 9126,
+    mma: 9127,
+    mmb: 9128,
+    mmc: 9129,
+    mmd: 9130,
+    mme: 9131,
+    mmf: 9132,
+    mmg: 9133,
+    mmh: 9134,
+    mmi: 9135,
+    mmj: 9136,
+    mmk: 9137,
+    mml: 9138,
+    mmm: 9139,
+    mmn: 9140,
+    mmo: 9141,
+    mmp: 9142,
+    mmq: 9143,
+    mmr: 9144,
+    mms: 9145,
+    mmt: 9146,
+    mmu: 9147,
+    mmv: 9148,
+    mmw: 9149,
+    mmx: 9150,
+    mmy: 9151,
+    mnz: 9152,
+    mna: 9153,
+    mnb: 9154,
+    mnc: 9155,
+    mnd: 9156,
+    mne: 9157,
+    mnf: 9158,
+    mng: 9159,
+    mnh: 9160,
+    mni: 9161,
+    mnj: 9162,
+    mnk: 9163,
+    mnl: 9164,
+    mnm: 9165,
+    mnn: 9166,
+    mno: 9167,
+    mnp: 9168,
+    mnq: 9169,
+    mnr: 9170,
+    mns: 9171,
+    mnt: 9172,
+    mnu: 9173,
+    mnv: 9174,
+    mnw: 9175,
+    mnx: 9176,
+    mny: 9177,
+    moz: 9178,
+    moa: 9179,
+    mob: 9180,
+    moc: 9181,
+    mod: 9182,
+    moe: 9183,
+    mof: 9184,
+    mog: 9185,
+    moh: 9186,
+    moi: 9187,
+    moj: 9188,
+    mok: 9189,
+    mol: 9190,
+    mom: 9191,
+    mon: 9192,
+    moo: 9193,
+    mop: 9194,
+    moq: 9195,
+    mor: 9196,
+    mos: 9197,
+    mot: 9198,
+    mou: 9199,
+    mov: 9200,
+    mow: 9201,
+    mox: 9202,
+    moy: 9203,
+    mpz: 9204,
+    mpa: 9205,
+    mpb: 9206,
+    mpc: 9207,
+    mpd: 9208,
+    mpe: 9209,
+    mpf: 9210,
+    mpg: 9211,
+    mph: 9212,
+    mpi: 9213,
+    mpj: 9214,
+    mpk: 9215,
+    mpl: 9216,
+    mpm: 9217,
+    mpn: 9218,
+    mpo: 9219,
+    mpp: 9220,
+    mpq: 9221,
+    mpr: 9222,
+    mps: 9223,
+    mpt: 9224,
+    mpu: 9225,
+    mpv: 9226,
+    mpw: 9227,
+    mpx: 9228,
+    mpy: 9229,
+    mqz: 9230,
+    mqa: 9231,
+    mqb: 9232,
+    mqc: 9233,
+    mqd: 9234,
+    mqe: 9235,
+    mqf: 9236,
+    mqg: 9237,
+    mqh: 9238,
+    mqi: 9239,
+    mqj: 9240,
+    mqk: 9241,
+    mql: 9242,
+    mqm: 9243,
+    mqn: 9244,
+    mqo: 9245,
+    mqp: 9246,
+    mqq: 9247,
+    mqr: 9248,
+    mqs: 9249,
+    mqt: 9250,
+    mqu: 9251,
+    mqv: 9252,
+    mqw: 9253,
+    mqx: 9254,
+    mqy: 9255,
+    mrz: 9256,
+    mra: 9257,
+    mrb: 9258,
+    mrc: 9259,
+    mrd: 9260,
+    mre: 9261,
+    mrf: 9262,
+    mrg: 9263,
+    mrh: 9264,
+    mri: 9265,
+    mrj: 9266,
+    mrk: 9267,
+    mrl: 9268,
+    mrm: 9269,
+    mrn: 9270,
+    mro: 9271,
+    mrp: 9272,
+    mrq: 9273,
+    mrr: 9274,
+    mrs: 9275,
+    mrt: 9276,
+    mru: 9277,
+    mrv: 9278,
+    mrw: 9279,
+    mrx: 9280,
+    mry: 9281,
+    msz: 9282,
+    msa: 9283,
+    msb: 9284,
+    msc: 9285,
+    msd: 9286,
+    mse: 9287,
+    msf: 9288,
+    msg: 9289,
+    msh: 9290,
+    msi: 9291,
+    msj: 9292,
+    msk: 9293,
+    msl: 9294,
+    msm: 9295,
+    msn: 9296,
+    mso: 9297,
+    msp: 9298,
+    msq: 9299,
+    msr: 9300,
+    mss: 9301,
+    mst: 9302,
+    msu: 9303,
+    msv: 9304,
+    msw: 9305,
+    msx: 9306,
+    msy: 9307,
+    mtz: 9308,
+    mta: 9309,
+    mtb: 9310,
+    mtc: 9311,
+    mtd: 9312,
+    mte: 9313,
+    mtf: 9314,
+    mtg: 9315,
+    mth: 9316,
+    mti: 9317,
+    mtj: 9318,
+    mtk: 9319,
+    mtl: 9320,
+    mtm: 9321,
+    mtn: 9322,
+    mto: 9323,
+    mtp: 9324,
+    mtq: 9325,
+    mtr: 9326,
+    mts: 9327,
+    mtt: 9328,
+    mtu: 9329,
+    mtv: 9330,
+    mtw: 9331,
+    mtx: 9332,
+    mty: 9333,
+    muz: 9334,
+    mua: 9335,
+    mub: 9336,
+    muc: 9337,
+    mud: 9338,
+    mue: 9339,
+    muf: 9340,
+    mug: 9341,
+    muh: 9342,
+    mui: 9343,
+    muj: 9344,
+    muk: 9345,
+    mul: 9346,
+    mum: 9347,
+    mun: 9348,
+    muo: 9349,
+    mup: 9350,
+    muq: 9351,
+    mur: 9352,
+    mus: 9353,
+    mut: 9354,
+    muu: 9355,
+    muv: 9356,
+    muw: 9357,
+    mux: 9358,
+    muy: 9359,
+    mvz: 9360,
+    mva: 9361,
+    mvb: 9362,
+    mvc: 9363,
+    mvd: 9364,
+    mve: 9365,
+    mvf: 9366,
+    mvg: 9367,
+    mvh: 9368,
+    mvi: 9369,
+    mvj: 9370,
+    mvk: 9371,
+    mvl: 9372,
+    mvm: 9373,
+    mvn: 9374,
+    mvo: 9375,
+    mvp: 9376,
+    mvq: 9377,
+    mvr: 9378,
+    mvs: 9379,
+    mvt: 9380,
+    mvu: 9381,
+    mvv: 9382,
+    mvw: 9383,
+    mvx: 9384,
+    mvy: 9385,
+    mwz: 9386,
+    mwa: 9387,
+    mwb: 9388,
+    mwc: 9389,
+    mwd: 9390,
+    mwe: 9391,
+    mwf: 9392,
+    mwg: 9393,
+    mwh: 9394,
+    mwi: 9395,
+    mwj: 9396,
+    mwk: 9397,
+    mwl: 9398,
+    mwm: 9399,
+    mwn: 9400,
+    mwo: 9401,
+    mwp: 9402,
+    mwq: 9403,
+    mwr: 9404,
+    mws: 9405,
+    mwt: 9406,
+    mwu: 9407,
+    mwv: 9408,
+    mww: 9409,
+    mwx: 9410,
+    mwy: 9411,
+    mxz: 9412,
+    mxa: 9413,
+    mxb: 9414,
+    mxc: 9415,
+    mxd: 9416,
+    mxe: 9417,
+    mxf: 9418,
+    mxg: 9419,
+    mxh: 9420,
+    mxi: 9421,
+    mxj: 9422,
+    mxk: 9423,
+    mxl: 9424,
+    mxm: 9425,
+    mxn: 9426,
+    mxo: 9427,
+    mxp: 9428,
+    mxq: 9429,
+    mxr: 9430,
+    mxs: 9431,
+    mxt: 9432,
+    mxu: 9433,
+    mxv: 9434,
+    mxw: 9435,
+    mxx: 9436,
+    mxy: 9437,
+    myz: 9438,
+    mya: 9439,
+    myb: 9440,
+    myc: 9441,
+    myd: 9442,
+    mye: 9443,
+    myf: 9444,
+    myg: 9445,
+    myh: 9446,
+    myi: 9447,
+    myj: 9448,
+    myk: 9449,
+    myl: 9450,
+    mym: 9451,
+    myn: 9452,
+    myo: 9453,
+    myp: 9454,
+    myq: 9455,
+    myr: 9456,
+    mys: 9457,
+    myt: 9458,
+    myu: 9459,
+    myv: 9460,
+    myw: 9461,
+    myx: 9462,
+    myy: 9463,
+    nzz: 9464,
+    nza: 9465,
+    nzb: 9466,
+    nzc: 9467,
+    nzd: 9468,
+    nze: 9469,
+    nzf: 9470,
+    nzg: 9471,
+    nzh: 9472,
+    nzi: 9473,
+    nzj: 9474,
+    nzk: 9475,
+    nzl: 9476,
+    nzm: 9477,
+    nzn: 9478,
+    nzo: 9479,
+    nzp: 9480,
+    nzq: 9481,
+    nzr: 9482,
+    nzs: 9483,
+    nzt: 9484,
+    nzu: 9485,
+    nzv: 9486,
+    nzw: 9487,
+    nzx: 9488,
+    nzy: 9489,
+    naz: 9490,
+    naa: 9491,
+    nab: 9492,
+    nac: 9493,
+    nad: 9494,
+    nae: 9495,
+    naf: 9496,
+    nag: 9497,
+    nah: 9498,
+    nai: 9499,
+    naj: 9500,
+    nak: 9501,
+    nal: 9502,
+    nam: 9503,
+    nan: 9504,
+    nao: 9505,
+    nap: 9506,
+    naq: 9507,
+    nar: 9508,
+    nas: 9509,
+    nat: 9510,
+    nau: 9511,
+    nav: 9512,
+    naw: 9513,
+    nax: 9514,
+    nay: 9515,
+    nbz: 9516,
+    nba: 9517,
+    nbb: 9518,
+    nbc: 9519,
+    nbd: 9520,
+    nbe: 9521,
+    nbf: 9522,
+    nbg: 9523,
+    nbh: 9524,
+    nbi: 9525,
+    nbj: 9526,
+    nbk: 9527,
+    nbl: 9528,
+    nbm: 9529,
+    nbn: 9530,
+    nbo: 9531,
+    nbp: 9532,
+    nbq: 9533,
+    nbr: 9534,
+    nbs: 9535,
+    nbt: 9536,
+    nbu: 9537,
+    nbv: 9538,
+    nbw: 9539,
+    nbx: 9540,
+    nby: 9541,
+    ncz: 9542,
+    nca: 9543,
+    ncb: 9544,
+    ncc: 9545,
+    ncd: 9546,
+    nce: 9547,
+    ncf: 9548,
+    ncg: 9549,
+    nch: 9550,
+    nci: 9551,
+    ncj: 9552,
+    nck: 9553,
+    ncl: 9554,
+    ncm: 9555,
+    ncn: 9556,
+    nco: 9557,
+    ncp: 9558,
+    ncq: 9559,
+    ncr: 9560,
+    ncs: 9561,
+    nct: 9562,
+    ncu: 9563,
+    ncv: 9564,
+    ncw: 9565,
+    ncx: 9566,
+    ncy: 9567,
+    ndz: 9568,
+    nda: 9569,
+    ndb: 9570,
+    ndc: 9571,
+    ndd: 9572,
+    nde: 9573,
+    ndf: 9574,
+    ndg: 9575,
+    ndh: 9576,
+    ndi: 9577,
+    ndj: 9578,
+    ndk: 9579,
+    ndl: 9580,
+    ndm: 9581,
+    ndn: 9582,
+    ndo: 9583,
+    ndp: 9584,
+    ndq: 9585,
+    ndr: 9586,
+    nds: 9587,
+    ndt: 9588,
+    ndu: 9589,
+    ndv: 9590,
+    ndw: 9591,
+    ndx: 9592,
+    ndy: 9593,
+    nez: 9594,
+    nea: 9595,
+    neb: 9596,
+    nec: 9597,
+    ned: 9598,
+    nee: 9599,
+    nef: 9600,
+    neg: 9601,
+    neh: 9602,
+    nei: 9603,
+    nej: 9604,
+    nek: 9605,
+    nel: 9606,
+    nem: 9607,
+    nen: 9608,
+    neo: 9609,
+    nep: 9610,
+    neq: 9611,
+    ner: 9612,
+    nes: 9613,
+    net: 9614,
+    neu: 9615,
+    nev: 9616,
+    new: 9617,
+    nex: 9618,
+    ney: 9619,
+    nfz: 9620,
+    nfa: 9621,
+    nfb: 9622,
+    nfc: 9623,
+    nfd: 9624,
+    nfe: 9625,
+    nff: 9626,
+    nfg: 9627,
+    nfh: 9628,
+    nfi: 9629,
+    nfj: 9630,
+    nfk: 9631,
+    nfl: 9632,
+    nfm: 9633,
+    nfn: 9634,
+    nfo: 9635,
+    nfp: 9636,
+    nfq: 9637,
+    nfr: 9638,
+    nfs: 9639,
+    nft: 9640,
+    nfu: 9641,
+    nfv: 9642,
+    nfw: 9643,
+    nfx: 9644,
+    nfy: 9645,
+    ngz: 9646,
+    nga: 9647,
+    ngb: 9648,
+    ngc: 9649,
+    ngd: 9650,
+    nge: 9651,
+    ngf: 9652,
+    ngg: 9653,
+    ngh: 9654,
+    ngi: 9655,
+    ngj: 9656,
+    ngk: 9657,
+    ngl: 9658,
+    ngm: 9659,
+    ngn: 9660,
+    ngo: 9661,
+    ngp: 9662,
+    ngq: 9663,
+    ngr: 9664,
+    ngs: 9665,
+    ngt: 9666,
+    ngu: 9667,
+    ngv: 9668,
+    ngw: 9669,
+    ngx: 9670,
+    ngy: 9671,
+    nhz: 9672,
+    nha: 9673,
+    nhb: 9674,
+    nhc: 9675,
+    nhd: 9676,
+    nhe: 9677,
+    nhf: 9678,
+    nhg: 9679,
+    nhh: 9680,
+    nhi: 9681,
+    nhj: 9682,
+    nhk: 9683,
+    nhl: 9684,
+    nhm: 9685,
+    nhn: 9686,
+    nho: 9687,
+    nhp: 9688,
+    nhq: 9689,
+    nhr: 9690,
+    nhs: 9691,
+    nht: 9692,
+    nhu: 9693,
+    nhv: 9694,
+    nhw: 9695,
+    nhx: 9696,
+    nhy: 9697,
+    niz: 9698,
+    nia: 9699,
+    nib: 9700,
+    nic: 9701,
+    nid: 9702,
+    nie: 9703,
+    nif: 9704,
+    nig: 9705,
+    nih: 9706,
+    nii: 9707,
+    nij: 9708,
+    nik: 9709,
+    nil: 9710,
+    nim: 9711,
+    nin: 9712,
+    nio: 9713,
+    nip: 9714,
+    niq: 9715,
+    nir: 9716,
+    nis: 9717,
+    nit: 9718,
+    niu: 9719,
+    niv: 9720,
+    niw: 9721,
+    nix: 9722,
+    niy: 9723,
+    njz: 9724,
+    nja: 9725,
+    njb: 9726,
+    njc: 9727,
+    njd: 9728,
+    nje: 9729,
+    njf: 9730,
+    njg: 9731,
+    njh: 9732,
+    nji: 9733,
+    njj: 9734,
+    njk: 9735,
+    njl: 9736,
+    njm: 9737,
+    njn: 9738,
+    njo: 9739,
+    njp: 9740,
+    njq: 9741,
+    njr: 9742,
+    njs: 9743,
+    njt: 9744,
+    nju: 9745,
+    njv: 9746,
+    njw: 9747,
+    njx: 9748,
+    njy: 9749,
+    nkz: 9750,
+    nka: 9751,
+    nkb: 9752,
+    nkc: 9753,
+    nkd: 9754,
+    nke: 9755,
+    nkf: 9756,
+    nkg: 9757,
+    nkh: 9758,
+    nki: 9759,
+    nkj: 9760,
+    nkk: 9761,
+    nkl: 9762,
+    nkm: 9763,
+    nkn: 9764,
+    nko: 9765,
+    nkp: 9766,
+    nkq: 9767,
+    nkr: 9768,
+    nks: 9769,
+    nkt: 9770,
+    nku: 9771,
+    nkv: 9772,
+    nkw: 9773,
+    nkx: 9774,
+    nky: 9775,
+    nlz: 9776,
+    nla: 9777,
+    nlb: 9778,
+    nlc: 9779,
+    nld: 9780,
+    nle: 9781,
+    nlf: 9782,
+    nlg: 9783,
+    nlh: 9784,
+    nli: 9785,
+    nlj: 9786,
+    nlk: 9787,
+    nll: 9788,
+    nlm: 9789,
+    nln: 9790,
+    nlo: 9791,
+    nlp: 9792,
+    nlq: 9793,
+    nlr: 9794,
+    nls: 9795,
+    nlt: 9796,
+    nlu: 9797,
+    nlv: 9798,
+    nlw: 9799,
+    nlx: 9800,
+    nly: 9801,
+    nmz: 9802,
+    nma: 9803,
+    nmb: 9804,
+    nmc: 9805,
+    nmd: 9806,
+    nme: 9807,
+    nmf: 9808,
+    nmg: 9809,
+    nmh: 9810,
+    nmi: 9811,
+    nmj: 9812,
+    nmk: 9813,
+    nml: 9814,
+    nmm: 9815,
+    nmn: 9816,
+    nmo: 9817,
+    nmp: 9818,
+    nmq: 9819,
+    nmr: 9820,
+    nms: 9821,
+    nmt: 9822,
+    nmu: 9823,
+    nmv: 9824,
+    nmw: 9825,
+    nmx: 9826,
+    nmy: 9827,
+    nnz: 9828,
+    nna: 9829,
+    nnb: 9830,
+    nnc: 9831,
+    nnd: 9832,
+    nne: 9833,
+    nnf: 9834,
+    nng: 9835,
+    nnh: 9836,
+    nni: 9837,
+    nnj: 9838,
+    nnk: 9839,
+    nnl: 9840,
+    nnm: 9841,
+    nnn: 9842,
+    nno: 9843,
+    nnp: 9844,
+    nnq: 9845,
+    nnr: 9846,
+    nns: 9847,
+    nnt: 9848,
+    nnu: 9849,
+    nnv: 9850,
+    nnw: 9851,
+    nnx: 9852,
+    nny: 9853,
+    noz: 9854,
+    noa: 9855,
+    nob: 9856,
+    noc: 9857,
+    nod: 9858,
+    noe: 9859,
+    nof: 9860,
+    nog: 9861,
+    noh: 9862,
+    noi: 9863,
+    noj: 9864,
+    nok: 9865,
+    nol: 9866,
+    nom: 9867,
+    non: 9868,
+    noo: 9869,
+    nop: 9870,
+    noq: 9871,
+    nor: 9872,
+    nos: 9873,
+    not: 9874,
+    nou: 9875,
+    nov: 9876,
+    now: 9877,
+    nox: 9878,
+    noy: 9879,
+    npz: 9880,
+    npa: 9881,
+    npb: 9882,
+    npc: 9883,
+    npd: 9884,
+    npe: 9885,
+    npf: 9886,
+    npg: 9887,
+    nph: 9888,
+    npi: 9889,
+    npj: 9890,
+    npk: 9891,
+    npl: 9892,
+    npm: 9893,
+    npn: 9894,
+    npo: 9895,
+    npp: 9896,
+    npq: 9897,
+    npr: 9898,
+    nps: 9899,
+    npt: 9900,
+    npu: 9901,
+    npv: 9902,
+    npw: 9903,
+    npx: 9904,
+    npy: 9905,
+    nqz: 9906,
+    nqa: 9907,
+    nqb: 9908,
+    nqc: 9909,
+    nqd: 9910,
+    nqe: 9911,
+    nqf: 9912,
+    nqg: 9913,
+    nqh: 9914,
+    nqi: 9915,
+    nqj: 9916,
+    nqk: 9917,
+    nql: 9918,
+    nqm: 9919,
+    nqn: 9920,
+    nqo: 9921,
+    nqp: 9922,
+    nqq: 9923,
+    nqr: 9924,
+    nqs: 9925,
+    nqt: 9926,
+    nqu: 9927,
+    nqv: 9928,
+    nqw: 9929,
+    nqx: 9930,
+    nqy: 9931,
+    nrz: 9932,
+    nra: 9933,
+    nrb: 9934,
+    nrc: 9935,
+    nrd: 9936,
+    nre: 9937,
+    nrf: 9938,
+    nrg: 9939,
+    nrh: 9940,
+    nri: 9941,
+    nrj: 9942,
+    nrk: 9943,
+    nrl: 9944,
+    nrm: 9945,
+    nrn: 9946,
+    nro: 9947,
+    nrp: 9948,
+    nrq: 9949,
+    nrr: 9950,
+    nrs: 9951,
+    nrt: 9952,
+    nru: 9953,
+    nrv: 9954,
+    nrw: 9955,
+    nrx: 9956,
+    nry: 9957,
+    nsz: 9958,
+    nsa: 9959,
+    nsb: 9960,
+    nsc: 9961,
+    nsd: 9962,
+    nse: 9963,
+    nsf: 9964,
+    nsg: 9965,
+    nsh: 9966,
+    nsi: 9967,
+    nsj: 9968,
+    nsk: 9969,
+    nsl: 9970,
+    nsm: 9971,
+    nsn: 9972,
+    nso: 9973,
+    nsp: 9974,
+    nsq: 9975,
+    nsr: 9976,
+    nss: 9977,
+    nst: 9978,
+    nsu: 9979,
+    nsv: 9980,
+    nsw: 9981,
+    nsx: 9982,
+    nsy: 9983,
+    ntz: 9984,
+    nta: 9985,
+    ntb: 9986,
+    ntc: 9987,
+    ntd: 9988,
+    nte: 9989,
+    ntf: 9990,
+    ntg: 9991,
+    nth: 9992,
+    nti: 9993,
+    ntj: 9994,
+    ntk: 9995,
+    ntl: 9996,
+    ntm: 9997,
+    ntn: 9998,
+    nto: 9999,
+    ntp: 10000,
+    ntq: 10001,
+    ntr: 10002,
+    nts: 10003,
+    ntt: 10004,
+    ntu: 10005,
+    ntv: 10006,
+    ntw: 10007,
+    ntx: 10008,
+    nty: 10009,
+    nuz: 10010,
+    nua: 10011,
+    nub: 10012,
+    nuc: 10013,
+    nud: 10014,
+    nue: 10015,
+    nuf: 10016,
+    nug: 10017,
+    nuh: 10018,
+    nui: 10019,
+    nuj: 10020,
+    nuk: 10021,
+    nul: 10022,
+    num: 10023,
+    nun: 10024,
+    nuo: 10025,
+    nup: 10026,
+    nuq: 10027,
+    nur: 10028,
+    nus: 10029,
+    nut: 10030,
+    nuu: 10031,
+    nuv: 10032,
+    nuw: 10033,
+    nux: 10034,
+    nuy: 10035,
+    nvz: 10036,
+    nva: 10037,
+    nvb: 10038,
+    nvc: 10039,
+    nvd: 10040,
+    nve: 10041,
+    nvf: 10042,
+    nvg: 10043,
+    nvh: 10044,
+    nvi: 10045,
+    nvj: 10046,
+    nvk: 10047,
+    nvl: 10048,
+    nvm: 10049,
+    nvn: 10050,
+    nvo: 10051,
+    nvp: 10052,
+    nvq: 10053,
+    nvr: 10054,
+    nvs: 10055,
+    nvt: 10056,
+    nvu: 10057,
+    nvv: 10058,
+    nvw: 10059,
+    nvx: 10060,
+    nvy: 10061,
+    nwz: 10062,
+    nwa: 10063,
+    nwb: 10064,
+    nwc: 10065,
+    nwd: 10066,
+    nwe: 10067,
+    nwf: 10068,
+    nwg: 10069,
+    nwh: 10070,
+    nwi: 10071,
+    nwj: 10072,
+    nwk: 10073,
+    nwl: 10074,
+    nwm: 10075,
+    nwn: 10076,
+    nwo: 10077,
+    nwp: 10078,
+    nwq: 10079,
+    nwr: 10080,
+    nws: 10081,
+    nwt: 10082,
+    nwu: 10083,
+    nwv: 10084,
+    nww: 10085,
+    nwx: 10086,
+    nwy: 10087,
+    nxz: 10088,
+    nxa: 10089,
+    nxb: 10090,
+    nxc: 10091,
+    nxd: 10092,
+    nxe: 10093,
+    nxf: 10094,
+    nxg: 10095,
+    nxh: 10096,
+    nxi: 10097,
+    nxj: 10098,
+    nxk: 10099,
+    nxl: 10100,
+    nxm: 10101,
+    nxn: 10102,
+    nxo: 10103,
+    nxp: 10104,
+    nxq: 10105,
+    nxr: 10106,
+    nxs: 10107,
+    nxt: 10108,
+    nxu: 10109,
+    nxv: 10110,
+    nxw: 10111,
+    nxx: 10112,
+    nxy: 10113,
+    nyz: 10114,
+    nya: 10115,
+    nyb: 10116,
+    nyc: 10117,
+    nyd: 10118,
+    nye: 10119,
+    nyf: 10120,
+    nyg: 10121,
+    nyh: 10122,
+    nyi: 10123,
+    nyj: 10124,
+    nyk: 10125,
+    nyl: 10126,
+    nym: 10127,
+    nyn: 10128,
+    nyo: 10129,
+    nyp: 10130,
+    nyq: 10131,
+    nyr: 10132,
+    nys: 10133,
+    nyt: 10134,
+    nyu: 10135,
+    nyv: 10136,
+    nyw: 10137,
+    nyx: 10138,
+    nyy: 10139,
+    ozz: 10140,
+    oza: 10141,
+    ozb: 10142,
+    ozc: 10143,
+    ozd: 10144,
+    oze: 10145,
+    ozf: 10146,
+    ozg: 10147,
+    ozh: 10148,
+    ozi: 10149,
+    ozj: 10150,
+    ozk: 10151,
+    ozl: 10152,
+    ozm: 10153,
+    ozn: 10154,
+    ozo: 10155,
+    ozp: 10156,
+    ozq: 10157,
+    ozr: 10158,
+    ozs: 10159,
+    ozt: 10160,
+    ozu: 10161,
+    ozv: 10162,
+    ozw: 10163,
+    ozx: 10164,
+    ozy: 10165,
+    oaz: 10166,
+    oaa: 10167,
+    oab: 10168,
+    oac: 10169,
+    oad: 10170,
+    oae: 10171,
+    oaf: 10172,
+    oag: 10173,
+    oah: 10174,
+    oai: 10175,
+    oaj: 10176,
+    oak: 10177,
+    oal: 10178,
+    oam: 10179,
+    oan: 10180,
+    oao: 10181,
+    oap: 10182,
+    oaq: 10183,
+    oar: 10184,
+    oas: 10185,
+    oat: 10186,
+    oau: 10187,
+    oav: 10188,
+    oaw: 10189,
+    oax: 10190,
+    oay: 10191,
+    obz: 10192,
+    oba: 10193,
+    obb: 10194,
+    obc: 10195,
+    obd: 10196,
+    obe: 10197,
+    obf: 10198,
+    obg: 10199,
+    obh: 10200,
+    obi: 10201,
+    obj: 10202,
+    obk: 10203,
+    obl: 10204,
+    obm: 10205,
+    obn: 10206,
+    obo: 10207,
+    obp: 10208,
+    obq: 10209,
+    obr: 10210,
+    obs: 10211,
+    obt: 10212,
+    obu: 10213,
+    obv: 10214,
+    obw: 10215,
+    obx: 10216,
+    oby: 10217,
+    ocz: 10218,
+    oca: 10219,
+    ocb: 10220,
+    occ: 10221,
+    ocd: 10222,
+    oce: 10223,
+    ocf: 10224,
+    ocg: 10225,
+    och: 10226,
+    oci: 10227,
+    ocj: 10228,
+    ock: 10229,
+    ocl: 10230,
+    ocm: 10231,
+    ocn: 10232,
+    oco: 10233,
+    ocp: 10234,
+    ocq: 10235,
+    ocr: 10236,
+    ocs: 10237,
+    oct: 10238,
+    ocu: 10239,
+    ocv: 10240,
+    ocw: 10241,
+    ocx: 10242,
+    ocy: 10243,
+    odz: 10244,
+    oda: 10245,
+    odb: 10246,
+    odc: 10247,
+    odd: 10248,
+    ode: 10249,
+    odf: 10250,
+    odg: 10251,
+    odh: 10252,
+    odi: 10253,
+    odj: 10254,
+    odk: 10255,
+    odl: 10256,
+    odm: 10257,
+    odn: 10258,
+    odo: 10259,
+    odp: 10260,
+    odq: 10261,
+    odr: 10262,
+    ods: 10263,
+    odt: 10264,
+    odu: 10265,
+    odv: 10266,
+    odw: 10267,
+    odx: 10268,
+    ody: 10269,
+    oez: 10270,
+    oea: 10271,
+    oeb: 10272,
+    oec: 10273,
+    oed: 10274,
+    oee: 10275,
+    oef: 10276,
+    oeg: 10277,
+    oeh: 10278,
+    oei: 10279,
+    oej: 10280,
+    oek: 10281,
+    oel: 10282,
+    oem: 10283,
+    oen: 10284,
+    oeo: 10285,
+    oep: 10286,
+    oeq: 10287,
+    oer: 10288,
+    oes: 10289,
+    oet: 10290,
+    oeu: 10291,
+    oev: 10292,
+    oew: 10293,
+    oex: 10294,
+    oey: 10295,
+    ofz: 10296,
+    ofa: 10297,
+    ofb: 10298,
+    ofc: 10299,
+    ofd: 10300,
+    ofe: 10301,
+    off: 10302,
+    ofg: 10303,
+    ofh: 10304,
+    ofi: 10305,
+    ofj: 10306,
+    ofk: 10307,
+    ofl: 10308,
+    ofm: 10309,
+    ofn: 10310,
+    ofo: 10311,
+    ofp: 10312,
+    ofq: 10313,
+    ofr: 10314,
+    ofs: 10315,
+    oft: 10316,
+    ofu: 10317,
+    ofv: 10318,
+    ofw: 10319,
+    ofx: 10320,
+    ofy: 10321,
+    ogz: 10322,
+    oga: 10323,
+    ogb: 10324,
+    ogc: 10325,
+    ogd: 10326,
+    oge: 10327,
+    ogf: 10328,
+    ogg: 10329,
+    ogh: 10330,
+    ogi: 10331,
+    ogj: 10332,
+    ogk: 10333,
+    ogl: 10334,
+    ogm: 10335,
+    ogn: 10336,
+    ogo: 10337,
+    ogp: 10338,
+    ogq: 10339,
+    ogr: 10340,
+    ogs: 10341,
+    ogt: 10342,
+    ogu: 10343,
+    ogv: 10344,
+    ogw: 10345,
+    ogx: 10346,
+    ogy: 10347,
+    ohz: 10348,
+    oha: 10349,
+    ohb: 10350,
+    ohc: 10351,
+    ohd: 10352,
+    ohe: 10353,
+    ohf: 10354,
+    ohg: 10355,
+    ohh: 10356,
+    ohi: 10357,
+    ohj: 10358,
+    ohk: 10359,
+    ohl: 10360,
+    ohm: 10361,
+    ohn: 10362,
+    oho: 10363,
+    ohp: 10364,
+    ohq: 10365,
+    ohr: 10366,
+    ohs: 10367,
+    oht: 10368,
+    ohu: 10369,
+    ohv: 10370,
+    ohw: 10371,
+    ohx: 10372,
+    ohy: 10373,
+    oiz: 10374,
+    oia: 10375,
+    oib: 10376,
+    oic: 10377,
+    oid: 10378,
+    oie: 10379,
+    oif: 10380,
+    oig: 10381,
+    oih: 10382,
+    oii: 10383,
+    oij: 10384,
+    oik: 10385,
+    oil: 10386,
+    oim: 10387,
+    oin: 10388,
+    oio: 10389,
+    oip: 10390,
+    oiq: 10391,
+    oir: 10392,
+    ois: 10393,
+    oit: 10394,
+    oiu: 10395,
+    oiv: 10396,
+    oiw: 10397,
+    oix: 10398,
+    oiy: 10399,
+    ojz: 10400,
+    oja: 10401,
+    ojb: 10402,
+    ojc: 10403,
+    ojd: 10404,
+    oje: 10405,
+    ojf: 10406,
+    ojg: 10407,
+    ojh: 10408,
+    oji: 10409,
+    ojj: 10410,
+    ojk: 10411,
+    ojl: 10412,
+    ojm: 10413,
+    ojn: 10414,
+    ojo: 10415,
+    ojp: 10416,
+    ojq: 10417,
+    ojr: 10418,
+    ojs: 10419,
+    ojt: 10420,
+    oju: 10421,
+    ojv: 10422,
+    ojw: 10423,
+    ojx: 10424,
+    ojy: 10425,
+    okz: 10426,
+    oka: 10427,
+    okb: 10428,
+    okc: 10429,
+    okd: 10430,
+    oke: 10431,
+    okf: 10432,
+    okg: 10433,
+    okh: 10434,
+    oki: 10435,
+    okj: 10436,
+    okk: 10437,
+    okl: 10438,
+    okm: 10439,
+    okn: 10440,
+    oko: 10441,
+    okp: 10442,
+    okq: 10443,
+    okr: 10444,
+    oks: 10445,
+    okt: 10446,
+    oku: 10447,
+    okv: 10448,
+    okw: 10449,
+    okx: 10450,
+    oky: 10451,
+    olz: 10452,
+    ola: 10453,
+    olb: 10454,
+    olc: 10455,
+    old: 10456,
+    ole: 10457,
+    olf: 10458,
+    olg: 10459,
+    olh: 10460,
+    oli: 10461,
+    olj: 10462,
+    olk: 10463,
+    oll: 10464,
+    olm: 10465,
+    oln: 10466,
+    olo: 10467,
+    olp: 10468,
+    olq: 10469,
+    olr: 10470,
+    ols: 10471,
+    olt: 10472,
+    olu: 10473,
+    olv: 10474,
+    olw: 10475,
+    olx: 10476,
+    oly: 10477,
+    omz: 10478,
+    oma: 10479,
+    omb: 10480,
+    omc: 10481,
+    omd: 10482,
+    ome: 10483,
+    omf: 10484,
+    omg: 10485,
+    omh: 10486,
+    omi: 10487,
+    omj: 10488,
+    omk: 10489,
+    oml: 10490,
+    omm: 10491,
+    omn: 10492,
+    omo: 10493,
+    omp: 10494,
+    omq: 10495,
+    omr: 10496,
+    oms: 10497,
+    omt: 10498,
+    omu: 10499,
+    omv: 10500,
+    omw: 10501,
+    omx: 10502,
+    omy: 10503,
+    onz: 10504,
+    ona: 10505,
+    onb: 10506,
+    onc: 10507,
+    ond: 10508,
+    one: 10509,
+    onf: 10510,
+    ong: 10511,
+    onh: 10512,
+    oni: 10513,
+    onj: 10514,
+    onk: 10515,
+    onl: 10516,
+    onm: 10517,
+    onn: 10518,
+    ono: 10519,
+    onp: 10520,
+    onq: 10521,
+    onr: 10522,
+    ons: 10523,
+    ont: 10524,
+    onu: 10525,
+    onv: 10526,
+    onw: 10527,
+    onx: 10528,
+    ony: 10529,
+    ooz: 10530,
+    ooa: 10531,
+    oob: 10532,
+    ooc: 10533,
+    ood: 10534,
+    ooe: 10535,
+    oof: 10536,
+    oog: 10537,
+    ooh: 10538,
+    ooi: 10539,
+    ooj: 10540,
+    ook: 10541,
+    ool: 10542,
+    oom: 10543,
+    oon: 10544,
+    ooo: 10545,
+    oop: 10546,
+    ooq: 10547,
+    oor: 10548,
+    oos: 10549,
+    oot: 10550,
+    oou: 10551,
+    oov: 10552,
+    oow: 10553,
+    oox: 10554,
+    ooy: 10555,
+    opz: 10556,
+    opa: 10557,
+    opb: 10558,
+    opc: 10559,
+    opd: 10560,
+    ope: 10561,
+    opf: 10562,
+    opg: 10563,
+    oph: 10564,
+    opi: 10565,
+    opj: 10566,
+    opk: 10567,
+    opl: 10568,
+    opm: 10569,
+    opn: 10570,
+    opo: 10571,
+    opp: 10572,
+    opq: 10573,
+    opr: 10574,
+    ops: 10575,
+    opt: 10576,
+    opu: 10577,
+    opv: 10578,
+    opw: 10579,
+    opx: 10580,
+    opy: 10581,
+    oqz: 10582,
+    oqa: 10583,
+    oqb: 10584,
+    oqc: 10585,
+    oqd: 10586,
+    oqe: 10587,
+    oqf: 10588,
+    oqg: 10589,
+    oqh: 10590,
+    oqi: 10591,
+    oqj: 10592,
+    oqk: 10593,
+    oql: 10594,
+    oqm: 10595,
+    oqn: 10596,
+    oqo: 10597,
+    oqp: 10598,
+    oqq: 10599,
+    oqr: 10600,
+    oqs: 10601,
+    oqt: 10602,
+    oqu: 10603,
+    oqv: 10604,
+    oqw: 10605,
+    oqx: 10606,
+    oqy: 10607,
+    orz: 10608,
+    ora: 10609,
+    orb: 10610,
+    orc: 10611,
+    ord: 10612,
+    ore: 10613,
+    orf: 10614,
+    org: 10615,
+    orh: 10616,
+    ori: 10617,
+    orj: 10618,
+    ork: 10619,
+    orl: 10620,
+    orm: 10621,
+    orn: 10622,
+    oro: 10623,
+    orp: 10624,
+    orq: 10625,
+    orr: 10626,
+    ors: 10627,
+    ort: 10628,
+    oru: 10629,
+    orv: 10630,
+    orw: 10631,
+    orx: 10632,
+    ory: 10633,
+    osz: 10634,
+    osa: 10635,
+    osb: 10636,
+    osc: 10637,
+    osd: 10638,
+    ose: 10639,
+    osf: 10640,
+    osg: 10641,
+    osh: 10642,
+    osi: 10643,
+    osj: 10644,
+    osk: 10645,
+    osl: 10646,
+    osm: 10647,
+    osn: 10648,
+    oso: 10649,
+    osp: 10650,
+    osq: 10651,
+    osr: 10652,
+    oss: 10653,
+    ost: 10654,
+    osu: 10655,
+    osv: 10656,
+    osw: 10657,
+    osx: 10658,
+    osy: 10659,
+    otz: 10660,
+    ota: 10661,
+    otb: 10662,
+    otc: 10663,
+    otd: 10664,
+    ote: 10665,
+    otf: 10666,
+    otg: 10667,
+    oth: 10668,
+    oti: 10669,
+    otj: 10670,
+    otk: 10671,
+    otl: 10672,
+    otm: 10673,
+    otn: 10674,
+    oto: 10675,
+    otp: 10676,
+    otq: 10677,
+    otr: 10678,
+    ots: 10679,
+    ott: 10680,
+    otu: 10681,
+    otv: 10682,
+    otw: 10683,
+    otx: 10684,
+    oty: 10685,
+    ouz: 10686,
+    oua: 10687,
+    oub: 10688,
+    ouc: 10689,
+    oud: 10690,
+    oue: 10691,
+    ouf: 10692,
+    oug: 10693,
+    ouh: 10694,
+    oui: 10695,
+    ouj: 10696,
+    ouk: 10697,
+    oul: 10698,
+    oum: 10699,
+    oun: 10700,
+    ouo: 10701,
+    oup: 10702,
+    ouq: 10703,
+    our: 10704,
+    ous: 10705,
+    out: 10706,
+    ouu: 10707,
+    ouv: 10708,
+    ouw: 10709,
+    oux: 10710,
+    ouy: 10711,
+    ovz: 10712,
+    ova: 10713,
+    ovb: 10714,
+    ovc: 10715,
+    ovd: 10716,
+    ove: 10717,
+    ovf: 10718,
+    ovg: 10719,
+    ovh: 10720,
+    ovi: 10721,
+    ovj: 10722,
+    ovk: 10723,
+    ovl: 10724,
+    ovm: 10725,
+    ovn: 10726,
+    ovo: 10727,
+    ovp: 10728,
+    ovq: 10729,
+    ovr: 10730,
+    ovs: 10731,
+    ovt: 10732,
+    ovu: 10733,
+    ovv: 10734,
+    ovw: 10735,
+    ovx: 10736,
+    ovy: 10737,
+    owz: 10738,
+    owa: 10739,
+    owb: 10740,
+    owc: 10741,
+    owd: 10742,
+    owe: 10743,
+    owf: 10744,
+    owg: 10745,
+    owh: 10746,
+    owi: 10747,
+    owj: 10748,
+    owk: 10749,
+    owl: 10750,
+    owm: 10751,
+    own: 10752,
+    owo: 10753,
+    owp: 10754,
+    owq: 10755,
+    owr: 10756,
+    ows: 10757,
+    owt: 10758,
+    owu: 10759,
+    owv: 10760,
+    oww: 10761,
+    owx: 10762,
+    owy: 10763,
+    oxz: 10764,
+    oxa: 10765,
+    oxb: 10766,
+    oxc: 10767,
+    oxd: 10768,
+    oxe: 10769,
+    oxf: 10770,
+    oxg: 10771,
+    oxh: 10772,
+    oxi: 10773,
+    oxj: 10774,
+    oxk: 10775,
+    oxl: 10776,
+    oxm: 10777,
+    oxn: 10778,
+    oxo: 10779,
+    oxp: 10780,
+    oxq: 10781,
+    oxr: 10782,
+    oxs: 10783,
+    oxt: 10784,
+    oxu: 10785,
+    oxv: 10786,
+    oxw: 10787,
+    oxx: 10788,
+    oxy: 10789,
+    oyz: 10790,
+    oya: 10791,
+    oyb: 10792,
+    oyc: 10793,
+    oyd: 10794,
+    oye: 10795,
+    oyf: 10796,
+    oyg: 10797,
+    oyh: 10798,
+    oyi: 10799,
+    oyj: 10800,
+    oyk: 10801,
+    oyl: 10802,
+    oym: 10803,
+    oyn: 10804,
+    oyo: 10805,
+    oyp: 10806,
+    oyq: 10807,
+    oyr: 10808,
+    oys: 10809,
+    oyt: 10810,
+    oyu: 10811,
+    oyv: 10812,
+    oyw: 10813,
+    oyx: 10814,
+    oyy: 10815,
+    pzz: 10816,
+    pza: 10817,
+    pzb: 10818,
+    pzc: 10819,
+    pzd: 10820,
+    pze: 10821,
+    pzf: 10822,
+    pzg: 10823,
+    pzh: 10824,
+    pzi: 10825,
+    pzj: 10826,
+    pzk: 10827,
+    pzl: 10828,
+    pzm: 10829,
+    pzn: 10830,
+    pzo: 10831,
+    pzp: 10832,
+    pzq: 10833,
+    pzr: 10834,
+    pzs: 10835,
+    pzt: 10836,
+    pzu: 10837,
+    pzv: 10838,
+    pzw: 10839,
+    pzx: 10840,
+    pzy: 10841,
+    paz: 10842,
+    paa: 10843,
+    pab: 10844,
+    pac: 10845,
+    pad: 10846,
+    pae: 10847,
+    paf: 10848,
+    pag: 10849,
+    pah: 10850,
+    pai: 10851,
+    paj: 10852,
+    pak: 10853,
+    pal: 10854,
+    pam: 10855,
+    pan: 10856,
+    pao: 10857,
+    pap: 10858,
+    paq: 10859,
+    par: 10860,
+    pas: 10861,
+    pat: 10862,
+    pau: 10863,
+    pav: 10864,
+    paw: 10865,
+    pax: 10866,
+    pay: 10867,
+    pbz: 10868,
+    pba: 10869,
+    pbb: 10870,
+    pbc: 10871,
+    pbd: 10872,
+    pbe: 10873,
+    pbf: 10874,
+    pbg: 10875,
+    pbh: 10876,
+    pbi: 10877,
+    pbj: 10878,
+    pbk: 10879,
+    pbl: 10880,
+    pbm: 10881,
+    pbn: 10882,
+    pbo: 10883,
+    pbp: 10884,
+    pbq: 10885,
+    pbr: 10886,
+    pbs: 10887,
+    pbt: 10888,
+    pbu: 10889,
+    pbv: 10890,
+    pbw: 10891,
+    pbx: 10892,
+    pby: 10893,
+    pcz: 10894,
+    pca: 10895,
+    pcb: 10896,
+    pcc: 10897,
+    pcd: 10898,
+    pce: 10899,
+    pcf: 10900,
+    pcg: 10901,
+    pch: 10902,
+    pci: 10903,
+    pcj: 10904,
+    pck: 10905,
+    pcl: 10906,
+    pcm: 10907,
+    pcn: 10908,
+    pco: 10909,
+    pcp: 10910,
+    pcq: 10911,
+    pcr: 10912,
+    pcs: 10913,
+    pct: 10914,
+    pcu: 10915,
+    pcv: 10916,
+    pcw: 10917,
+    pcx: 10918,
+    pcy: 10919,
+    pdz: 10920,
+    pda: 10921,
+    pdb: 10922,
+    pdc: 10923,
+    pdd: 10924,
+    pde: 10925,
+    pdf: 10926,
+    pdg: 10927,
+    pdh: 10928,
+    pdi: 10929,
+    pdj: 10930,
+    pdk: 10931,
+    pdl: 10932,
+    pdm: 10933,
+    pdn: 10934,
+    pdo: 10935,
+    pdp: 10936,
+    pdq: 10937,
+    pdr: 10938,
+    pds: 10939,
+    pdt: 10940,
+    pdu: 10941,
+    pdv: 10942,
+    pdw: 10943,
+    pdx: 10944,
+    pdy: 10945,
+    pez: 10946,
+    pea: 10947,
+    peb: 10948,
+    pec: 10949,
+    ped: 10950,
+    pee: 10951,
+    pef: 10952,
+    peg: 10953,
+    peh: 10954,
+    pei: 10955,
+    pej: 10956,
+    pek: 10957,
+    pel: 10958,
+    pem: 10959,
+    pen: 10960,
+    peo: 10961,
+    pep: 10962,
+    peq: 10963,
+    per: 10964,
+    pes: 10965,
+    pet: 10966,
+    peu: 10967,
+    pev: 10968,
+    pew: 10969,
+    pex: 10970,
+    pey: 10971,
+    pfz: 10972,
+    pfa: 10973,
+    pfb: 10974,
+    pfc: 10975,
+    pfd: 10976,
+    pfe: 10977,
+    pff: 10978,
+    pfg: 10979,
+    pfh: 10980,
+    pfi: 10981,
+    pfj: 10982,
+    pfk: 10983,
+    pfl: 10984,
+    pfm: 10985,
+    pfn: 10986,
+    pfo: 10987,
+    pfp: 10988,
+    pfq: 10989,
+    pfr: 10990,
+    pfs: 10991,
+    pft: 10992,
+    pfu: 10993,
+    pfv: 10994,
+    pfw: 10995,
+    pfx: 10996,
+    pfy: 10997,
+    pgz: 10998,
+    pga: 10999,
+    pgb: 11000,
+    pgc: 11001,
+    pgd: 11002,
+    pge: 11003,
+    pgf: 11004,
+    pgg: 11005,
+    pgh: 11006,
+    pgi: 11007,
+    pgj: 11008,
+    pgk: 11009,
+    pgl: 11010,
+    pgm: 11011,
+    pgn: 11012,
+    pgo: 11013,
+    pgp: 11014,
+    pgq: 11015,
+    pgr: 11016,
+    pgs: 11017,
+    pgt: 11018,
+    pgu: 11019,
+    pgv: 11020,
+    pgw: 11021,
+    pgx: 11022,
+    pgy: 11023,
+    phz: 11024,
+    pha: 11025,
+    phb: 11026,
+    phc: 11027,
+    phd: 11028,
+    phe: 11029,
+    phf: 11030,
+    phg: 11031,
+    phh: 11032,
+    phi: 11033,
+    phj: 11034,
+    phk: 11035,
+    phl: 11036,
+    phm: 11037,
+    phn: 11038,
+    pho: 11039,
+    php: 11040,
+    phq: 11041,
+    phr: 11042,
+    phs: 11043,
+    pht: 11044,
+    phu: 11045,
+    phv: 11046,
+    phw: 11047,
+    phx: 11048,
+    phy: 11049,
+    piz: 11050,
+    pia: 11051,
+    pib: 11052,
+    pic: 11053,
+    pid: 11054,
+    pie: 11055,
+    pif: 11056,
+    pig: 11057,
+    pih: 11058,
+    pii: 11059,
+    pij: 11060,
+    pik: 11061,
+    pil: 11062,
+    pim: 11063,
+    pin: 11064,
+    pio: 11065,
+    pip: 11066,
+    piq: 11067,
+    pir: 11068,
+    pis: 11069,
+    pit: 11070,
+    piu: 11071,
+    piv: 11072,
+    piw: 11073,
+    pix: 11074,
+    piy: 11075,
+    pjz: 11076,
+    pja: 11077,
+    pjb: 11078,
+    pjc: 11079,
+    pjd: 11080,
+    pje: 11081,
+    pjf: 11082,
+    pjg: 11083,
+    pjh: 11084,
+    pji: 11085,
+    pjj: 11086,
+    pjk: 11087,
+    pjl: 11088,
+    pjm: 11089,
+    pjn: 11090,
+    pjo: 11091,
+    pjp: 11092,
+    pjq: 11093,
+    pjr: 11094,
+    pjs: 11095,
+    pjt: 11096,
+    pju: 11097,
+    pjv: 11098,
+    pjw: 11099,
+    pjx: 11100,
+    pjy: 11101,
+    pkz: 11102,
+    pka: 11103,
+    pkb: 11104,
+    pkc: 11105,
+    pkd: 11106,
+    pke: 11107,
+    pkf: 11108,
+    pkg: 11109,
+    pkh: 11110,
+    pki: 11111,
+    pkj: 11112,
+    pkk: 11113,
+    pkl: 11114,
+    pkm: 11115,
+    pkn: 11116,
+    pko: 11117,
+    pkp: 11118,
+    pkq: 11119,
+    pkr: 11120,
+    pks: 11121,
+    pkt: 11122,
+    pku: 11123,
+    pkv: 11124,
+    pkw: 11125,
+    pkx: 11126,
+    pky: 11127,
+    plz: 11128,
+    pla: 11129,
+    plb: 11130,
+    plc: 11131,
+    pld: 11132,
+    ple: 11133,
+    plf: 11134,
+    plg: 11135,
+    plh: 11136,
+    pli: 11137,
+    plj: 11138,
+    plk: 11139,
+    pll: 11140,
+    plm: 11141,
+    pln: 11142,
+    plo: 11143,
+    plp: 11144,
+    plq: 11145,
+    plr: 11146,
+    pls: 11147,
+    plt: 11148,
+    plu: 11149,
+    plv: 11150,
+    plw: 11151,
+    plx: 11152,
+    ply: 11153,
+    pmz: 11154,
+    pma: 11155,
+    pmb: 11156,
+    pmc: 11157,
+    pmd: 11158,
+    pme: 11159,
+    pmf: 11160,
+    pmg: 11161,
+    pmh: 11162,
+    pmi: 11163,
+    pmj: 11164,
+    pmk: 11165,
+    pml: 11166,
+    pmm: 11167,
+    pmn: 11168,
+    pmo: 11169,
+    pmp: 11170,
+    pmq: 11171,
+    pmr: 11172,
+    pms: 11173,
+    pmt: 11174,
+    pmu: 11175,
+    pmv: 11176,
+    pmw: 11177,
+    pmx: 11178,
+    pmy: 11179,
+    pnz: 11180,
+    pna: 11181,
+    pnb: 11182,
+    pnc: 11183,
+    pnd: 11184,
+    pne: 11185,
+    pnf: 11186,
+    png: 11187,
+    pnh: 11188,
+    pni: 11189,
+    pnj: 11190,
+    pnk: 11191,
+    pnl: 11192,
+    pnm: 11193,
+    pnn: 11194,
+    pno: 11195,
+    pnp: 11196,
+    pnq: 11197,
+    pnr: 11198,
+    pns: 11199,
+    pnt: 11200,
+    pnu: 11201,
+    pnv: 11202,
+    pnw: 11203,
+    pnx: 11204,
+    pny: 11205,
+    poz: 11206,
+    poa: 11207,
+    pob: 11208,
+    poc: 11209,
+    pod: 11210,
+    poe: 11211,
+    pof: 11212,
+    pog: 11213,
+    poh: 11214,
+    poi: 11215,
+    poj: 11216,
+    pok: 11217,
+    pol: 11218,
+    pom: 11219,
+    pon: 11220,
+    poo: 11221,
+    pop: 11222,
+    poq: 11223,
+    por: 11224,
+    pos: 11225,
+    pot: 11226,
+    pou: 11227,
+    pov: 11228,
+    pow: 11229,
+    pox: 11230,
+    poy: 11231,
+    ppz: 11232,
+    ppa: 11233,
+    ppb: 11234,
+    ppc: 11235,
+    ppd: 11236,
+    ppe: 11237,
+    ppf: 11238,
+    ppg: 11239,
+    pph: 11240,
+    ppi: 11241,
+    ppj: 11242,
+    ppk: 11243,
+    ppl: 11244,
+    ppm: 11245,
+    ppn: 11246,
+    ppo: 11247,
+    ppp: 11248,
+    ppq: 11249,
+    ppr: 11250,
+    pps: 11251,
+    ppt: 11252,
+    ppu: 11253,
+    ppv: 11254,
+    ppw: 11255,
+    ppx: 11256,
+    ppy: 11257,
+    pqz: 11258,
+    pqa: 11259,
+    pqb: 11260,
+    pqc: 11261,
+    pqd: 11262,
+    pqe: 11263,
+    pqf: 11264,
+    pqg: 11265,
+    pqh: 11266,
+    pqi: 11267,
+    pqj: 11268,
+    pqk: 11269,
+    pql: 11270,
+    pqm: 11271,
+    pqn: 11272,
+    pqo: 11273,
+    pqp: 11274,
+    pqq: 11275,
+    pqr: 11276,
+    pqs: 11277,
+    pqt: 11278,
+    pqu: 11279,
+    pqv: 11280,
+    pqw: 11281,
+    pqx: 11282,
+    pqy: 11283,
+    prz: 11284,
+    pra: 11285,
+    prb: 11286,
+    prc: 11287,
+    prd: 11288,
+    pre: 11289,
+    prf: 11290,
+    prg: 11291,
+    prh: 11292,
+    pri: 11293,
+    prj: 11294,
+    prk: 11295,
+    prl: 11296,
+    prm: 11297,
+    prn: 11298,
+    pro: 11299,
+    prp: 11300,
+    prq: 11301,
+    prr: 11302,
+    prs: 11303,
+    prt: 11304,
+    pru: 11305,
+    prv: 11306,
+    prw: 11307,
+    prx: 11308,
+    pry: 11309,
+    psz: 11310,
+    psa: 11311,
+    psb: 11312,
+    psc: 11313,
+    psd: 11314,
+    pse: 11315,
+    psf: 11316,
+    psg: 11317,
+    psh: 11318,
+    psi: 11319,
+    psj: 11320,
+    psk: 11321,
+    psl: 11322,
+    psm: 11323,
+    psn: 11324,
+    pso: 11325,
+    psp: 11326,
+    psq: 11327,
+    psr: 11328,
+    pss: 11329,
+    pst: 11330,
+    psu: 11331,
+    psv: 11332,
+    psw: 11333,
+    psx: 11334,
+    psy: 11335,
+    ptz: 11336,
+    pta: 11337,
+    ptb: 11338,
+    ptc: 11339,
+    ptd: 11340,
+    pte: 11341,
+    ptf: 11342,
+    ptg: 11343,
+    pth: 11344,
+    pti: 11345,
+    ptj: 11346,
+    ptk: 11347,
+    ptl: 11348,
+    ptm: 11349,
+    ptn: 11350,
+    pto: 11351,
+    ptp: 11352,
+    ptq: 11353,
+    ptr: 11354,
+    pts: 11355,
+    ptt: 11356,
+    ptu: 11357,
+    ptv: 11358,
+    ptw: 11359,
+    ptx: 11360,
+    pty: 11361,
+    puz: 11362,
+    pua: 11363,
+    pub: 11364,
+    puc: 11365,
+    pud: 11366,
+    pue: 11367,
+    puf: 11368,
+    pug: 11369,
+    puh: 11370,
+    pui: 11371,
+    puj: 11372,
+    puk: 11373,
+    pul: 11374,
+    pum: 11375,
+    pun: 11376,
+    puo: 11377,
+    pup: 11378,
+    puq: 11379,
+    pur: 11380,
+    pus: 11381,
+    put: 11382,
+    puu: 11383,
+    puv: 11384,
+    puw: 11385,
+    pux: 11386,
+    puy: 11387,
+    pvz: 11388,
+    pva: 11389,
+    pvb: 11390,
+    pvc: 11391,
+    pvd: 11392,
+    pve: 11393,
+    pvf: 11394,
+    pvg: 11395,
+    pvh: 11396,
+    pvi: 11397,
+    pvj: 11398,
+    pvk: 11399,
+    pvl: 11400,
+    pvm: 11401,
+    pvn: 11402,
+    pvo: 11403,
+    pvp: 11404,
+    pvq: 11405,
+    pvr: 11406,
+    pvs: 11407,
+    pvt: 11408,
+    pvu: 11409,
+    pvv: 11410,
+    pvw: 11411,
+    pvx: 11412,
+    pvy: 11413,
+    pwz: 11414,
+    pwa: 11415,
+    pwb: 11416,
+    pwc: 11417,
+    pwd: 11418,
+    pwe: 11419,
+    pwf: 11420,
+    pwg: 11421,
+    pwh: 11422,
+    pwi: 11423,
+    pwj: 11424,
+    pwk: 11425,
+    pwl: 11426,
+    pwm: 11427,
+    pwn: 11428,
+    pwo: 11429,
+    pwp: 11430,
+    pwq: 11431,
+    pwr: 11432,
+    pws: 11433,
+    pwt: 11434,
+    pwu: 11435,
+    pwv: 11436,
+    pww: 11437,
+    pwx: 11438,
+    pwy: 11439,
+    pxz: 11440,
+    pxa: 11441,
+    pxb: 11442,
+    pxc: 11443,
+    pxd: 11444,
+    pxe: 11445,
+    pxf: 11446,
+    pxg: 11447,
+    pxh: 11448,
+    pxi: 11449,
+    pxj: 11450,
+    pxk: 11451,
+    pxl: 11452,
+    pxm: 11453,
+    pxn: 11454,
+    pxo: 11455,
+    pxp: 11456,
+    pxq: 11457,
+    pxr: 11458,
+    pxs: 11459,
+    pxt: 11460,
+    pxu: 11461,
+    pxv: 11462,
+    pxw: 11463,
+    pxx: 11464,
+    pxy: 11465,
+    pyz: 11466,
+    pya: 11467,
+    pyb: 11468,
+    pyc: 11469,
+    pyd: 11470,
+    pye: 11471,
+    pyf: 11472,
+    pyg: 11473,
+    pyh: 11474,
+    pyi: 11475,
+    pyj: 11476,
+    pyk: 11477,
+    pyl: 11478,
+    pym: 11479,
+    pyn: 11480,
+    pyo: 11481,
+    pyp: 11482,
+    pyq: 11483,
+    pyr: 11484,
+    pys: 11485,
+    pyt: 11486,
+    pyu: 11487,
+    pyv: 11488,
+    pyw: 11489,
+    pyx: 11490,
+    pyy: 11491,
+    qzz: 11492,
+    qza: 11493,
+    qzb: 11494,
+    qzc: 11495,
+    qzd: 11496,
+    qze: 11497,
+    qzf: 11498,
+    qzg: 11499,
+    qzh: 11500,
+    qzi: 11501,
+    qzj: 11502,
+    qzk: 11503,
+    qzl: 11504,
+    qzm: 11505,
+    qzn: 11506,
+    qzo: 11507,
+    qzp: 11508,
+    qzq: 11509,
+    qzr: 11510,
+    qzs: 11511,
+    qzt: 11512,
+    qzu: 11513,
+    qzv: 11514,
+    qzw: 11515,
+    qzx: 11516,
+    qzy: 11517,
+    qaz: 11518,
+    qaa: 11519,
+    qab: 11520,
+    qac: 11521,
+    qad: 11522,
+    qae: 11523,
+    qaf: 11524,
+    qag: 11525,
+    qah: 11526,
+    qai: 11527,
+    qaj: 11528,
+    qak: 11529,
+    qal: 11530,
+    qam: 11531,
+    qan: 11532,
+    qao: 11533,
+    qap: 11534,
+    qaq: 11535,
+    qar: 11536,
+    qas: 11537,
+    qat: 11538,
+    qau: 11539,
+    qav: 11540,
+    qaw: 11541,
+    qax: 11542,
+    qay: 11543,
+    qbz: 11544,
+    qba: 11545,
+    qbb: 11546,
+    qbc: 11547,
+    qbd: 11548,
+    qbe: 11549,
+    qbf: 11550,
+    qbg: 11551,
+    qbh: 11552,
+    qbi: 11553,
+    qbj: 11554,
+    qbk: 11555,
+    qbl: 11556,
+    qbm: 11557,
+    qbn: 11558,
+    qbo: 11559,
+    qbp: 11560,
+    qbq: 11561,
+    qbr: 11562,
+    qbs: 11563,
+    qbt: 11564,
+    qbu: 11565,
+    qbv: 11566,
+    qbw: 11567,
+    qbx: 11568,
+    qby: 11569,
+    qcz: 11570,
+    qca: 11571,
+    qcb: 11572,
+    qcc: 11573,
+    qcd: 11574,
+    qce: 11575,
+    qcf: 11576,
+    qcg: 11577,
+    qch: 11578,
+    qci: 11579,
+    qcj: 11580,
+    qck: 11581,
+    qcl: 11582,
+    qcm: 11583,
+    qcn: 11584,
+    qco: 11585,
+    qcp: 11586,
+    qcq: 11587,
+    qcr: 11588,
+    qcs: 11589,
+    qct: 11590,
+    qcu: 11591,
+    qcv: 11592,
+    qcw: 11593,
+    qcx: 11594,
+    qcy: 11595,
+    qdz: 11596,
+    qda: 11597,
+    qdb: 11598,
+    qdc: 11599,
+    qdd: 11600,
+    qde: 11601,
+    qdf: 11602,
+    qdg: 11603,
+    qdh: 11604,
+    qdi: 11605,
+    qdj: 11606,
+    qdk: 11607,
+    qdl: 11608,
+    qdm: 11609,
+    qdn: 11610,
+    qdo: 11611,
+    qdp: 11612,
+    qdq: 11613,
+    qdr: 11614,
+    qds: 11615,
+    qdt: 11616,
+    qdu: 11617,
+    qdv: 11618,
+    qdw: 11619,
+    qdx: 11620,
+    qdy: 11621,
+    qez: 11622,
+    qea: 11623,
+    qeb: 11624,
+    qec: 11625,
+    qed: 11626,
+    qee: 11627,
+    qef: 11628,
+    qeg: 11629,
+    qeh: 11630,
+    qei: 11631,
+    qej: 11632,
+    qek: 11633,
+    qel: 11634,
+    qem: 11635,
+    qen: 11636,
+    qeo: 11637,
+    qep: 11638,
+    qeq: 11639,
+    qer: 11640,
+    qes: 11641,
+    qet: 11642,
+    qeu: 11643,
+    qev: 11644,
+    qew: 11645,
+    qex: 11646,
+    qey: 11647,
+    qfz: 11648,
+    qfa: 11649,
+    qfb: 11650,
+    qfc: 11651,
+    qfd: 11652,
+    qfe: 11653,
+    qff: 11654,
+    qfg: 11655,
+    qfh: 11656,
+    qfi: 11657,
+    qfj: 11658,
+    qfk: 11659,
+    qfl: 11660,
+    qfm: 11661,
+    qfn: 11662,
+    qfo: 11663,
+    qfp: 11664,
+    qfq: 11665,
+    qfr: 11666,
+    qfs: 11667,
+    qft: 11668,
+    qfu: 11669,
+    qfv: 11670,
+    qfw: 11671,
+    qfx: 11672,
+    qfy: 11673,
+    qgz: 11674,
+    qga: 11675,
+    qgb: 11676,
+    qgc: 11677,
+    qgd: 11678,
+    qge: 11679,
+    qgf: 11680,
+    qgg: 11681,
+    qgh: 11682,
+    qgi: 11683,
+    qgj: 11684,
+    qgk: 11685,
+    qgl: 11686,
+    qgm: 11687,
+    qgn: 11688,
+    qgo: 11689,
+    qgp: 11690,
+    qgq: 11691,
+    qgr: 11692,
+    qgs: 11693,
+    qgt: 11694,
+    qgu: 11695,
+    qgv: 11696,
+    qgw: 11697,
+    qgx: 11698,
+    qgy: 11699,
+    qhz: 11700,
+    qha: 11701,
+    qhb: 11702,
+    qhc: 11703,
+    qhd: 11704,
+    qhe: 11705,
+    qhf: 11706,
+    qhg: 11707,
+    qhh: 11708,
+    qhi: 11709,
+    qhj: 11710,
+    qhk: 11711,
+    qhl: 11712,
+    qhm: 11713,
+    qhn: 11714,
+    qho: 11715,
+    qhp: 11716,
+    qhq: 11717,
+    qhr: 11718,
+    qhs: 11719,
+    qht: 11720,
+    qhu: 11721,
+    qhv: 11722,
+    qhw: 11723,
+    qhx: 11724,
+    qhy: 11725,
+    qiz: 11726,
+    qia: 11727,
+    qib: 11728,
+    qic: 11729,
+    qid: 11730,
+    qie: 11731,
+    qif: 11732,
+    qig: 11733,
+    qih: 11734,
+    qii: 11735,
+    qij: 11736,
+    qik: 11737,
+    qil: 11738,
+    qim: 11739,
+    qin: 11740,
+    qio: 11741,
+    qip: 11742,
+    qiq: 11743,
+    qir: 11744,
+    qis: 11745,
+    qit: 11746,
+    qiu: 11747,
+    qiv: 11748,
+    qiw: 11749,
+    qix: 11750,
+    qiy: 11751,
+    qjz: 11752,
+    qja: 11753,
+    qjb: 11754,
+    qjc: 11755,
+    qjd: 11756,
+    qje: 11757,
+    qjf: 11758,
+    qjg: 11759,
+    qjh: 11760,
+    qji: 11761,
+    qjj: 11762,
+    qjk: 11763,
+    qjl: 11764,
+    qjm: 11765,
+    qjn: 11766,
+    qjo: 11767,
+    qjp: 11768,
+    qjq: 11769,
+    qjr: 11770,
+    qjs: 11771,
+    qjt: 11772,
+    qju: 11773,
+    qjv: 11774,
+    qjw: 11775,
+    qjx: 11776,
+    qjy: 11777,
+    qkz: 11778,
+    qka: 11779,
+    qkb: 11780,
+    qkc: 11781,
+    qkd: 11782,
+    qke: 11783,
+    qkf: 11784,
+    qkg: 11785,
+    qkh: 11786,
+    qki: 11787,
+    qkj: 11788,
+    qkk: 11789,
+    qkl: 11790,
+    qkm: 11791,
+    qkn: 11792,
+    qko: 11793,
+    qkp: 11794,
+    qkq: 11795,
+    qkr: 11796,
+    qks: 11797,
+    qkt: 11798,
+    qku: 11799,
+    qkv: 11800,
+    qkw: 11801,
+    qkx: 11802,
+    qky: 11803,
+    qlz: 11804,
+    qla: 11805,
+    qlb: 11806,
+    qlc: 11807,
+    qld: 11808,
+    qle: 11809,
+    qlf: 11810,
+    qlg: 11811,
+    qlh: 11812,
+    qli: 11813,
+    qlj: 11814,
+    qlk: 11815,
+    qll: 11816,
+    qlm: 11817,
+    qln: 11818,
+    qlo: 11819,
+    qlp: 11820,
+    qlq: 11821,
+    qlr: 11822,
+    qls: 11823,
+    qlt: 11824,
+    qlu: 11825,
+    qlv: 11826,
+    qlw: 11827,
+    qlx: 11828,
+    qly: 11829,
+    qmz: 11830,
+    qma: 11831,
+    qmb: 11832,
+    qmc: 11833,
+    qmd: 11834,
+    qme: 11835,
+    qmf: 11836,
+    qmg: 11837,
+    qmh: 11838,
+    qmi: 11839,
+    qmj: 11840,
+    qmk: 11841,
+    qml: 11842,
+    qmm: 11843,
+    qmn: 11844,
+    qmo: 11845,
+    qmp: 11846,
+    qmq: 11847,
+    qmr: 11848,
+    qms: 11849,
+    qmt: 11850,
+    qmu: 11851,
+    qmv: 11852,
+    qmw: 11853,
+    qmx: 11854,
+    qmy: 11855,
+    qnz: 11856,
+    qna: 11857,
+    qnb: 11858,
+    qnc: 11859,
+    qnd: 11860,
+    qne: 11861,
+    qnf: 11862,
+    qng: 11863,
+    qnh: 11864,
+    qni: 11865,
+    qnj: 11866,
+    qnk: 11867,
+    qnl: 11868,
+    qnm: 11869,
+    qnn: 11870,
+    qno: 11871,
+    qnp: 11872,
+    qnq: 11873,
+    qnr: 11874,
+    qns: 11875,
+    qnt: 11876,
+    qnu: 11877,
+    qnv: 11878,
+    qnw: 11879,
+    qnx: 11880,
+    qny: 11881,
+    qoz: 11882,
+    qoa: 11883,
+    qob: 11884,
+    qoc: 11885,
+    qod: 11886,
+    qoe: 11887,
+    qof: 11888,
+    qog: 11889,
+    qoh: 11890,
+    qoi: 11891,
+    qoj: 11892,
+    qok: 11893,
+    qol: 11894,
+    qom: 11895,
+    qon: 11896,
+    qoo: 11897,
+    qop: 11898,
+    qoq: 11899,
+    qor: 11900,
+    qos: 11901,
+    qot: 11902,
+    qou: 11903,
+    qov: 11904,
+    qow: 11905,
+    qox: 11906,
+    qoy: 11907,
+    qpz: 11908,
+    qpa: 11909,
+    qpb: 11910,
+    qpc: 11911,
+    qpd: 11912,
+    qpe: 11913,
+    qpf: 11914,
+    qpg: 11915,
+    qph: 11916,
+    qpi: 11917,
+    qpj: 11918,
+    qpk: 11919,
+    qpl: 11920,
+    qpm: 11921,
+    qpn: 11922,
+    qpo: 11923,
+    qpp: 11924,
+    qpq: 11925,
+    qpr: 11926,
+    qps: 11927,
+    qpt: 11928,
+    qpu: 11929,
+    qpv: 11930,
+    qpw: 11931,
+    qpx: 11932,
+    qpy: 11933,
+    qqz: 11934,
+    qqa: 11935,
+    qqb: 11936,
+    qqc: 11937,
+    qqd: 11938,
+    qqe: 11939,
+    qqf: 11940,
+    qqg: 11941,
+    qqh: 11942,
+    qqi: 11943,
+    qqj: 11944,
+    qqk: 11945,
+    qql: 11946,
+    qqm: 11947,
+    qqn: 11948,
+    qqo: 11949,
+    qqp: 11950,
+    qqq: 11951,
+    qqr: 11952,
+    qqs: 11953,
+    qqt: 11954,
+    qqu: 11955,
+    qqv: 11956,
+    qqw: 11957,
+    qqx: 11958,
+    qqy: 11959,
+    qrz: 11960,
+    qra: 11961,
+    qrb: 11962,
+    qrc: 11963,
+    qrd: 11964,
+    qre: 11965,
+    qrf: 11966,
+    qrg: 11967,
+    qrh: 11968,
+    qri: 11969,
+    qrj: 11970,
+    qrk: 11971,
+    qrl: 11972,
+    qrm: 11973,
+    qrn: 11974,
+    qro: 11975,
+    qrp: 11976,
+    qrq: 11977,
+    qrr: 11978,
+    qrs: 11979,
+    qrt: 11980,
+    qru: 11981,
+    qrv: 11982,
+    qrw: 11983,
+    qrx: 11984,
+    qry: 11985,
+    qsz: 11986,
+    qsa: 11987,
+    qsb: 11988,
+    qsc: 11989,
+    qsd: 11990,
+    qse: 11991,
+    qsf: 11992,
+    qsg: 11993,
+    qsh: 11994,
+    qsi: 11995,
+    qsj: 11996,
+    qsk: 11997,
+    qsl: 11998,
+    qsm: 11999,
+    qsn: 12000,
+    qso: 12001,
+    qsp: 12002,
+    qsq: 12003,
+    qsr: 12004,
+    qss: 12005,
+    qst: 12006,
+    qsu: 12007,
+    qsv: 12008,
+    qsw: 12009,
+    qsx: 12010,
+    qsy: 12011,
+    qtz: 12012,
+    qta: 12013,
+    qtb: 12014,
+    qtc: 12015,
+    qtd: 12016,
+    qte: 12017,
+    qtf: 12018,
+    qtg: 12019,
+    qth: 12020,
+    qti: 12021,
+    qtj: 12022,
+    qtk: 12023,
+    qtl: 12024,
+    qtm: 12025,
+    qtn: 12026,
+    qto: 12027,
+    qtp: 12028,
+    qtq: 12029,
+    qtr: 12030,
+    qts: 12031,
+    qtt: 12032,
+    qtu: 12033,
+    qtv: 12034,
+    qtw: 12035,
+    qtx: 12036,
+    qty: 12037,
+    quz: 12038,
+    qua: 12039,
+    qub: 12040,
+    quc: 12041,
+    qud: 12042,
+    que: 12043,
+    quf: 12044,
+    qug: 12045,
+    quh: 12046,
+    qui: 12047,
+    quj: 12048,
+    quk: 12049,
+    qul: 12050,
+    qum: 12051,
+    qun: 12052,
+    quo: 12053,
+    qup: 12054,
+    quq: 12055,
+    qur: 12056,
+    qus: 12057,
+    qut: 12058,
+    quu: 12059,
+    quv: 12060,
+    quw: 12061,
+    qux: 12062,
+    quy: 12063,
+    qvz: 12064,
+    qva: 12065,
+    qvb: 12066,
+    qvc: 12067,
+    qvd: 12068,
+    qve: 12069,
+    qvf: 12070,
+    qvg: 12071,
+    qvh: 12072,
+    qvi: 12073,
+    qvj: 12074,
+    qvk: 12075,
+    qvl: 12076,
+    qvm: 12077,
+    qvn: 12078,
+    qvo: 12079,
+    qvp: 12080,
+    qvq: 12081,
+    qvr: 12082,
+    qvs: 12083,
+    qvt: 12084,
+    qvu: 12085,
+    qvv: 12086,
+    qvw: 12087,
+    qvx: 12088,
+    qvy: 12089,
+    qwz: 12090,
+    qwa: 12091,
+    qwb: 12092,
+    qwc: 12093,
+    qwd: 12094,
+    qwe: 12095,
+    qwf: 12096,
+    qwg: 12097,
+    qwh: 12098,
+    qwi: 12099,
+    qwj: 12100,
+    qwk: 12101,
+    qwl: 12102,
+    qwm: 12103,
+    qwn: 12104,
+    qwo: 12105,
+    qwp: 12106,
+    qwq: 12107,
+    qwr: 12108,
+    qws: 12109,
+    qwt: 12110,
+    qwu: 12111,
+    qwv: 12112,
+    qww: 12113,
+    qwx: 12114,
+    qwy: 12115,
+    qxz: 12116,
+    qxa: 12117,
+    qxb: 12118,
+    qxc: 12119,
+    qxd: 12120,
+    qxe: 12121,
+    qxf: 12122,
+    qxg: 12123,
+    qxh: 12124,
+    qxi: 12125,
+    qxj: 12126,
+    qxk: 12127,
+    qxl: 12128,
+    qxm: 12129,
+    qxn: 12130,
+    qxo: 12131,
+    qxp: 12132,
+    qxq: 12133,
+    qxr: 12134,
+    qxs: 12135,
+    qxt: 12136,
+    qxu: 12137,
+    qxv: 12138,
+    qxw: 12139,
+    qxx: 12140,
+    qxy: 12141,
+    qyz: 12142,
+    qya: 12143,
+    qyb: 12144,
+    qyc: 12145,
+    qyd: 12146,
+    qye: 12147,
+    qyf: 12148,
+    qyg: 12149,
+    qyh: 12150,
+    qyi: 12151,
+    qyj: 12152,
+    qyk: 12153,
+    qyl: 12154,
+    qym: 12155,
+    qyn: 12156,
+    qyo: 12157,
+    qyp: 12158,
+    qyq: 12159,
+    qyr: 12160,
+    qys: 12161,
+    qyt: 12162,
+    qyu: 12163,
+    qyv: 12164,
+    qyw: 12165,
+    qyx: 12166,
+    qyy: 12167,
+    rzz: 12168,
+    rza: 12169,
+    rzb: 12170,
+    rzc: 12171,
+    rzd: 12172,
+    rze: 12173,
+    rzf: 12174,
+    rzg: 12175,
+    rzh: 12176,
+    rzi: 12177,
+    rzj: 12178,
+    rzk: 12179,
+    rzl: 12180,
+    rzm: 12181,
+    rzn: 12182,
+    rzo: 12183,
+    rzp: 12184,
+    rzq: 12185,
+    rzr: 12186,
+    rzs: 12187,
+    rzt: 12188,
+    rzu: 12189,
+    rzv: 12190,
+    rzw: 12191,
+    rzx: 12192,
+    rzy: 12193,
+    raz: 12194,
+    raa: 12195,
+    rab: 12196,
+    rac: 12197,
+    rad: 12198,
+    rae: 12199,
+    raf: 12200,
+    rag: 12201,
+    rah: 12202,
+    rai: 12203,
+    raj: 12204,
+    rak: 12205,
+    ral: 12206,
+    ram: 12207,
+    ran: 12208,
+    rao: 12209,
+    rap: 12210,
+    raq: 12211,
+    rar: 12212,
+    ras: 12213,
+    rat: 12214,
+    rau: 12215,
+    rav: 12216,
+    raw: 12217,
+    rax: 12218,
+    ray: 12219,
+    rbz: 12220,
+    rba: 12221,
+    rbb: 12222,
+    rbc: 12223,
+    rbd: 12224,
+    rbe: 12225,
+    rbf: 12226,
+    rbg: 12227,
+    rbh: 12228,
+    rbi: 12229,
+    rbj: 12230,
+    rbk: 12231,
+    rbl: 12232,
+    rbm: 12233,
+    rbn: 12234,
+    rbo: 12235,
+    rbp: 12236,
+    rbq: 12237,
+    rbr: 12238,
+    rbs: 12239,
+    rbt: 12240,
+    rbu: 12241,
+    rbv: 12242,
+    rbw: 12243,
+    rbx: 12244,
+    rby: 12245,
+    rcz: 12246,
+    rca: 12247,
+    rcb: 12248,
+    rcc: 12249,
+    rcd: 12250,
+    rce: 12251,
+    rcf: 12252,
+    rcg: 12253,
+    rch: 12254,
+    rci: 12255,
+    rcj: 12256,
+    rck: 12257,
+    rcl: 12258,
+    rcm: 12259,
+    rcn: 12260,
+    rco: 12261,
+    rcp: 12262,
+    rcq: 12263,
+    rcr: 12264,
+    rcs: 12265,
+    rct: 12266,
+    rcu: 12267,
+    rcv: 12268,
+    rcw: 12269,
+    rcx: 12270,
+    rcy: 12271,
+    rdz: 12272,
+    rda: 12273,
+    rdb: 12274,
+    rdc: 12275,
+    rdd: 12276,
+    rde: 12277,
+    rdf: 12278,
+    rdg: 12279,
+    rdh: 12280,
+    rdi: 12281,
+    rdj: 12282,
+    rdk: 12283,
+    rdl: 12284,
+    rdm: 12285,
+    rdn: 12286,
+    rdo: 12287,
+    rdp: 12288,
+    rdq: 12289,
+    rdr: 12290,
+    rds: 12291,
+    rdt: 12292,
+    rdu: 12293,
+    rdv: 12294,
+    rdw: 12295,
+    rdx: 12296,
+    rdy: 12297,
+    rez: 12298,
+    rea: 12299,
+    reb: 12300,
+    rec: 12301,
+    red: 12302,
+    ree: 12303,
+    ref: 12304,
+    reg: 12305,
+    reh: 12306,
+    rei: 12307,
+    rej: 12308,
+    rek: 12309,
+    rel: 12310,
+    rem: 12311,
+    ren: 12312,
+    reo: 12313,
+    rep: 12314,
+    req: 12315,
+    rer: 12316,
+    res: 12317,
+    ret: 12318,
+    reu: 12319,
+    rev: 12320,
+    rew: 12321,
+    rex: 12322,
+    rey: 12323,
+    rfz: 12324,
+    rfa: 12325,
+    rfb: 12326,
+    rfc: 12327,
+    rfd: 12328,
+    rfe: 12329,
+    rff: 12330,
+    rfg: 12331,
+    rfh: 12332,
+    rfi: 12333,
+    rfj: 12334,
+    rfk: 12335,
+    rfl: 12336,
+    rfm: 12337,
+    rfn: 12338,
+    rfo: 12339,
+    rfp: 12340,
+    rfq: 12341,
+    rfr: 12342,
+    rfs: 12343,
+    rft: 12344,
+    rfu: 12345,
+    rfv: 12346,
+    rfw: 12347,
+    rfx: 12348,
+    rfy: 12349,
+    rgz: 12350,
+    rga: 12351,
+    rgb: 12352,
+    rgc: 12353,
+    rgd: 12354,
+    rge: 12355,
+    rgf: 12356,
+    rgg: 12357,
+    rgh: 12358,
+    rgi: 12359,
+    rgj: 12360,
+    rgk: 12361,
+    rgl: 12362,
+    rgm: 12363,
+    rgn: 12364,
+    rgo: 12365,
+    rgp: 12366,
+    rgq: 12367,
+    rgr: 12368,
+    rgs: 12369,
+    rgt: 12370,
+    rgu: 12371,
+    rgv: 12372,
+    rgw: 12373,
+    rgx: 12374,
+    rgy: 12375,
+    rhz: 12376,
+    rha: 12377,
+    rhb: 12378,
+    rhc: 12379,
+    rhd: 12380,
+    rhe: 12381,
+    rhf: 12382,
+    rhg: 12383,
+    rhh: 12384,
+    rhi: 12385,
+    rhj: 12386,
+    rhk: 12387,
+    rhl: 12388,
+    rhm: 12389,
+    rhn: 12390,
+    rho: 12391,
+    rhp: 12392,
+    rhq: 12393,
+    rhr: 12394,
+    rhs: 12395,
+    rht: 12396,
+    rhu: 12397,
+    rhv: 12398,
+    rhw: 12399,
+    rhx: 12400,
+    rhy: 12401,
+    riz: 12402,
+    ria: 12403,
+    rib: 12404,
+    ric: 12405,
+    rid: 12406,
+    rie: 12407,
+    rif: 12408,
+    rig: 12409,
+    rih: 12410,
+    rii: 12411,
+    rij: 12412,
+    rik: 12413,
+    ril: 12414,
+    rim: 12415,
+    rin: 12416,
+    rio: 12417,
+    rip: 12418,
+    riq: 12419,
+    rir: 12420,
+    ris: 12421,
+    rit: 12422,
+    riu: 12423,
+    riv: 12424,
+    riw: 12425,
+    rix: 12426,
+    riy: 12427,
+    rjz: 12428,
+    rja: 12429,
+    rjb: 12430,
+    rjc: 12431,
+    rjd: 12432,
+    rje: 12433,
+    rjf: 12434,
+    rjg: 12435,
+    rjh: 12436,
+    rji: 12437,
+    rjj: 12438,
+    rjk: 12439,
+    rjl: 12440,
+    rjm: 12441,
+    rjn: 12442,
+    rjo: 12443,
+    rjp: 12444,
+    rjq: 12445,
+    rjr: 12446,
+    rjs: 12447,
+    rjt: 12448,
+    rju: 12449,
+    rjv: 12450,
+    rjw: 12451,
+    rjx: 12452,
+    rjy: 12453,
+    rkz: 12454,
+    rka: 12455,
+    rkb: 12456,
+    rkc: 12457,
+    rkd: 12458,
+    rke: 12459,
+    rkf: 12460,
+    rkg: 12461,
+    rkh: 12462,
+    rki: 12463,
+    rkj: 12464,
+    rkk: 12465,
+    rkl: 12466,
+    rkm: 12467,
+    rkn: 12468,
+    rko: 12469,
+    rkp: 12470,
+    rkq: 12471,
+    rkr: 12472,
+    rks: 12473,
+    rkt: 12474,
+    rku: 12475,
+    rkv: 12476,
+    rkw: 12477,
+    rkx: 12478,
+    rky: 12479,
+    rlz: 12480,
+    rla: 12481,
+    rlb: 12482,
+    rlc: 12483,
+    rld: 12484,
+    rle: 12485,
+    rlf: 12486,
+    rlg: 12487,
+    rlh: 12488,
+    rli: 12489,
+    rlj: 12490,
+    rlk: 12491,
+    rll: 12492,
+    rlm: 12493,
+    rln: 12494,
+    rlo: 12495,
+    rlp: 12496,
+    rlq: 12497,
+    rlr: 12498,
+    rls: 12499,
+    rlt: 12500,
+    rlu: 12501,
+    rlv: 12502,
+    rlw: 12503,
+    rlx: 12504,
+    rly: 12505,
+    rmz: 12506,
+    rma: 12507,
+    rmb: 12508,
+    rmc: 12509,
+    rmd: 12510,
+    rme: 12511,
+    rmf: 12512,
+    rmg: 12513,
+    rmh: 12514,
+    rmi: 12515,
+    rmj: 12516,
+    rmk: 12517,
+    rml: 12518,
+    rmm: 12519,
+    rmn: 12520,
+    rmo: 12521,
+    rmp: 12522,
+    rmq: 12523,
+    rmr: 12524,
+    rms: 12525,
+    rmt: 12526,
+    rmu: 12527,
+    rmv: 12528,
+    rmw: 12529,
+    rmx: 12530,
+    rmy: 12531,
+    rnz: 12532,
+    rna: 12533,
+    rnb: 12534,
+    rnc: 12535,
+    rnd: 12536,
+    rne: 12537,
+    rnf: 12538,
+    rng: 12539,
+    rnh: 12540,
+    rni: 12541,
+    rnj: 12542,
+    rnk: 12543,
+    rnl: 12544,
+    rnm: 12545,
+    rnn: 12546,
+    rno: 12547,
+    rnp: 12548,
+    rnq: 12549,
+    rnr: 12550,
+    rns: 12551,
+    rnt: 12552,
+    rnu: 12553,
+    rnv: 12554,
+    rnw: 12555,
+    rnx: 12556,
+    rny: 12557,
+    roz: 12558,
+    roa: 12559,
+    rob: 12560,
+    roc: 12561,
+    rod: 12562,
+    roe: 12563,
+    rof: 12564,
+    rog: 12565,
+    roh: 12566,
+    roi: 12567,
+    roj: 12568,
+    rok: 12569,
+    rol: 12570,
+    rom: 12571,
+    ron: 12572,
+    roo: 12573,
+    rop: 12574,
+    roq: 12575,
+    ror: 12576,
+    ros: 12577,
+    rot: 12578,
+    rou: 12579,
+    rov: 12580,
+    row: 12581,
+    rox: 12582,
+    roy: 12583,
+    rpz: 12584,
+    rpa: 12585,
+    rpb: 12586,
+    rpc: 12587,
+    rpd: 12588,
+    rpe: 12589,
+    rpf: 12590,
+    rpg: 12591,
+    rph: 12592,
+    rpi: 12593,
+    rpj: 12594,
+    rpk: 12595,
+    rpl: 12596,
+    rpm: 12597,
+    rpn: 12598,
+    rpo: 12599,
+    rpp: 12600,
+    rpq: 12601,
+    rpr: 12602,
+    rps: 12603,
+    rpt: 12604,
+    rpu: 12605,
+    rpv: 12606,
+    rpw: 12607,
+    rpx: 12608,
+    rpy: 12609,
+    rqz: 12610,
+    rqa: 12611,
+    rqb: 12612,
+    rqc: 12613,
+    rqd: 12614,
+    rqe: 12615,
+    rqf: 12616,
+    rqg: 12617,
+    rqh: 12618,
+    rqi: 12619,
+    rqj: 12620,
+    rqk: 12621,
+    rql: 12622,
+    rqm: 12623,
+    rqn: 12624,
+    rqo: 12625,
+    rqp: 12626,
+    rqq: 12627,
+    rqr: 12628,
+    rqs: 12629,
+    rqt: 12630,
+    rqu: 12631,
+    rqv: 12632,
+    rqw: 12633,
+    rqx: 12634,
+    rqy: 12635,
+    rrz: 12636,
+    rra: 12637,
+    rrb: 12638,
+    rrc: 12639,
+    rrd: 12640,
+    rre: 12641,
+    rrf: 12642,
+    rrg: 12643,
+    rrh: 12644,
+    rri: 12645,
+    rrj: 12646,
+    rrk: 12647,
+    rrl: 12648,
+    rrm: 12649,
+    rrn: 12650,
+    rro: 12651,
+    rrp: 12652,
+    rrq: 12653,
+    rrr: 12654,
+    rrs: 12655,
+    rrt: 12656,
+    rru: 12657,
+    rrv: 12658,
+    rrw: 12659,
+    rrx: 12660,
+    rry: 12661,
+    rsz: 12662,
+    rsa: 12663,
+    rsb: 12664,
+    rsc: 12665,
+    rsd: 12666,
+    rse: 12667,
+    rsf: 12668,
+    rsg: 12669,
+    rsh: 12670,
+    rsi: 12671,
+    rsj: 12672,
+    rsk: 12673,
+    rsl: 12674,
+    rsm: 12675,
+    rsn: 12676,
+    rso: 12677,
+    rsp: 12678,
+    rsq: 12679,
+    rsr: 12680,
+    rss: 12681,
+    rst: 12682,
+    rsu: 12683,
+    rsv: 12684,
+    rsw: 12685,
+    rsx: 12686,
+    rsy: 12687,
+    rtz: 12688,
+    rta: 12689,
+    rtb: 12690,
+    rtc: 12691,
+    rtd: 12692,
+    rte: 12693,
+    rtf: 12694,
+    rtg: 12695,
+    rth: 12696,
+    rti: 12697,
+    rtj: 12698,
+    rtk: 12699,
+    rtl: 12700,
+    rtm: 12701,
+    rtn: 12702,
+    rto: 12703,
+    rtp: 12704,
+    rtq: 12705,
+    rtr: 12706,
+    rts: 12707,
+    rtt: 12708,
+    rtu: 12709,
+    rtv: 12710,
+    rtw: 12711,
+    rtx: 12712,
+    rty: 12713,
+    ruz: 12714,
+    rua: 12715,
+    rub: 12716,
+    ruc: 12717,
+    rud: 12718,
+    rue: 12719,
+    ruf: 12720,
+    rug: 12721,
+    ruh: 12722,
+    rui: 12723,
+    ruj: 12724,
+    ruk: 12725,
+    rul: 12726,
+    rum: 12727,
+    run: 12728,
+    ruo: 12729,
+    rup: 12730,
+    ruq: 12731,
+    rur: 12732,
+    rus: 12733,
+    rut: 12734,
+    ruu: 12735,
+    ruv: 12736,
+    ruw: 12737,
+    rux: 12738,
+    ruy: 12739,
+    rvz: 12740,
+    rva: 12741,
+    rvb: 12742,
+    rvc: 12743,
+    rvd: 12744,
+    rve: 12745,
+    rvf: 12746,
+    rvg: 12747,
+    rvh: 12748,
+    rvi: 12749,
+    rvj: 12750,
+    rvk: 12751,
+    rvl: 12752,
+    rvm: 12753,
+    rvn: 12754,
+    rvo: 12755,
+    rvp: 12756,
+    rvq: 12757,
+    rvr: 12758,
+    rvs: 12759,
+    rvt: 12760,
+    rvu: 12761,
+    rvv: 12762,
+    rvw: 12763,
+    rvx: 12764,
+    rvy: 12765,
+    rwz: 12766,
+    rwa: 12767,
+    rwb: 12768,
+    rwc: 12769,
+    rwd: 12770,
+    rwe: 12771,
+    rwf: 12772,
+    rwg: 12773,
+    rwh: 12774,
+    rwi: 12775,
+    rwj: 12776,
+    rwk: 12777,
+    rwl: 12778,
+    rwm: 12779,
+    rwn: 12780,
+    rwo: 12781,
+    rwp: 12782,
+    rwq: 12783,
+    rwr: 12784,
+    rws: 12785,
+    rwt: 12786,
+    rwu: 12787,
+    rwv: 12788,
+    rww: 12789,
+    rwx: 12790,
+    rwy: 12791,
+    rxz: 12792,
+    rxa: 12793,
+    rxb: 12794,
+    rxc: 12795,
+    rxd: 12796,
+    rxe: 12797,
+    rxf: 12798,
+    rxg: 12799,
+    rxh: 12800,
+    rxi: 12801,
+    rxj: 12802,
+    rxk: 12803,
+    rxl: 12804,
+    rxm: 12805,
+    rxn: 12806,
+    rxo: 12807,
+    rxp: 12808,
+    rxq: 12809,
+    rxr: 12810,
+    rxs: 12811,
+    rxt: 12812,
+    rxu: 12813,
+    rxv: 12814,
+    rxw: 12815,
+    rxx: 12816,
+    rxy: 12817,
+    ryz: 12818,
+    rya: 12819,
+    ryb: 12820,
+    ryc: 12821,
+    ryd: 12822,
+    rye: 12823,
+    ryf: 12824,
+    ryg: 12825,
+    ryh: 12826,
+    ryi: 12827,
+    ryj: 12828,
+    ryk: 12829,
+    ryl: 12830,
+    rym: 12831,
+    ryn: 12832,
+    ryo: 12833,
+    ryp: 12834,
+    ryq: 12835,
+    ryr: 12836,
+    rys: 12837,
+    ryt: 12838,
+    ryu: 12839,
+    ryv: 12840,
+    ryw: 12841,
+    ryx: 12842,
+    ryy: 12843,
+    szz: 12844,
+    sza: 12845,
+    szb: 12846,
+    szc: 12847,
+    szd: 12848,
+    sze: 12849,
+    szf: 12850,
+    szg: 12851,
+    szh: 12852,
+    szi: 12853,
+    szj: 12854,
+    szk: 12855,
+    szl: 12856,
+    szm: 12857,
+    szn: 12858,
+    szo: 12859,
+    szp: 12860,
+    szq: 12861,
+    szr: 12862,
+    szs: 12863,
+    szt: 12864,
+    szu: 12865,
+    szv: 12866,
+    szw: 12867,
+    szx: 12868,
+    szy: 12869,
+    saz: 12870,
+    saa: 12871,
+    sab: 12872,
+    sac: 12873,
+    sad: 12874,
+    sae: 12875,
+    saf: 12876,
+    sag: 12877,
+    sah: 12878,
+    sai: 12879,
+    saj: 12880,
+    sak: 12881,
+    sal: 12882,
+    sam: 12883,
+    san: 12884,
+    sao: 12885,
+    sap: 12886,
+    saq: 12887,
+    sar: 12888,
+    sas: 12889,
+    sat: 12890,
+    sau: 12891,
+    sav: 12892,
+    saw: 12893,
+    sax: 12894,
+    say: 12895,
+    sbz: 12896,
+    sba: 12897,
+    sbb: 12898,
+    sbc: 12899,
+    sbd: 12900,
+    sbe: 12901,
+    sbf: 12902,
+    sbg: 12903,
+    sbh: 12904,
+    sbi: 12905,
+    sbj: 12906,
+    sbk: 12907,
+    sbl: 12908,
+    sbm: 12909,
+    sbn: 12910,
+    sbo: 12911,
+    sbp: 12912,
+    sbq: 12913,
+    sbr: 12914,
+    sbs: 12915,
+    sbt: 12916,
+    sbu: 12917,
+    sbv: 12918,
+    sbw: 12919,
+    sbx: 12920,
+    sby: 12921,
+    scz: 12922,
+    sca: 12923,
+    scb: 12924,
+    scc: 12925,
+    scd: 12926,
+    sce: 12927,
+    scf: 12928,
+    scg: 12929,
+    sch: 12930,
+    sci: 12931,
+    scj: 12932,
+    sck: 12933,
+    scl: 12934,
+    scm: 12935,
+    scn: 12936,
+    sco: 12937,
+    scp: 12938,
+    scq: 12939,
+    scr: 12940,
+    scs: 12941,
+    sct: 12942,
+    scu: 12943,
+    scv: 12944,
+    scw: 12945,
+    scx: 12946,
+    scy: 12947,
+    sdz: 12948,
+    sda: 12949,
+    sdb: 12950,
+    sdc: 12951,
+    sdd: 12952,
+    sde: 12953,
+    sdf: 12954,
+    sdg: 12955,
+    sdh: 12956,
+    sdi: 12957,
+    sdj: 12958,
+    sdk: 12959,
+    sdl: 12960,
+    sdm: 12961,
+    sdn: 12962,
+    sdo: 12963,
+    sdp: 12964,
+    sdq: 12965,
+    sdr: 12966,
+    sds: 12967,
+    sdt: 12968,
+    sdu: 12969,
+    sdv: 12970,
+    sdw: 12971,
+    sdx: 12972,
+    sdy: 12973,
+    sez: 12974,
+    sea: 12975,
+    seb: 12976,
+    sec: 12977,
+    sed: 12978,
+    see: 12979,
+    sef: 12980,
+    seg: 12981,
+    seh: 12982,
+    sei: 12983,
+    sej: 12984,
+    sek: 12985,
+    sel: 12986,
+    sem: 12987,
+    sen: 12988,
+    seo: 12989,
+    sep: 12990,
+    seq: 12991,
+    ser: 12992,
+    ses: 12993,
+    set: 12994,
+    seu: 12995,
+    sev: 12996,
+    sew: 12997,
+    sex: 12998,
+    sey: 12999,
+    sfz: 13000,
+    sfa: 13001,
+    sfb: 13002,
+    sfc: 13003,
+    sfd: 13004,
+    sfe: 13005,
+    sff: 13006,
+    sfg: 13007,
+    sfh: 13008,
+    sfi: 13009,
+    sfj: 13010,
+    sfk: 13011,
+    sfl: 13012,
+    sfm: 13013,
+    sfn: 13014,
+    sfo: 13015,
+    sfp: 13016,
+    sfq: 13017,
+    sfr: 13018,
+    sfs: 13019,
+    sft: 13020,
+    sfu: 13021,
+    sfv: 13022,
+    sfw: 13023,
+    sfx: 13024,
+    sfy: 13025,
+    sgz: 13026,
+    sga: 13027,
+    sgb: 13028,
+    sgc: 13029,
+    sgd: 13030,
+    sge: 13031,
+    sgf: 13032,
+    sgg: 13033,
+    sgh: 13034,
+    sgi: 13035,
+    sgj: 13036,
+    sgk: 13037,
+    sgl: 13038,
+    sgm: 13039,
+    sgn: 13040,
+    sgo: 13041,
+    sgp: 13042,
+    sgq: 13043,
+    sgr: 13044,
+    sgs: 13045,
+    sgt: 13046,
+    sgu: 13047,
+    sgv: 13048,
+    sgw: 13049,
+    sgx: 13050,
+    sgy: 13051,
+    shz: 13052,
+    sha: 13053,
+    shb: 13054,
+    shc: 13055,
+    shd: 13056,
+    she: 13057,
+    shf: 13058,
+    shg: 13059,
+    shh: 13060,
+    shi: 13061,
+    shj: 13062,
+    shk: 13063,
+    shl: 13064,
+    shm: 13065,
+    shn: 13066,
+    sho: 13067,
+    shp: 13068,
+    shq: 13069,
+    shr: 13070,
+    shs: 13071,
+    sht: 13072,
+    shu: 13073,
+    shv: 13074,
+    shw: 13075,
+    shx: 13076,
+    shy: 13077,
+    siz: 13078,
+    sia: 13079,
+    sib: 13080,
+    sic: 13081,
+    sid: 13082,
+    sie: 13083,
+    sif: 13084,
+    sig: 13085,
+    sih: 13086,
+    sii: 13087,
+    sij: 13088,
+    sik: 13089,
+    sil: 13090,
+    sim: 13091,
+    sin: 13092,
+    sio: 13093,
+    sip: 13094,
+    siq: 13095,
+    sir: 13096,
+    sis: 13097,
+    sit: 13098,
+    siu: 13099,
+    siv: 13100,
+    siw: 13101,
+    six: 13102,
+    siy: 13103,
+    sjz: 13104,
+    sja: 13105,
+    sjb: 13106,
+    sjc: 13107,
+    sjd: 13108,
+    sje: 13109,
+    sjf: 13110,
+    sjg: 13111,
+    sjh: 13112,
+    sji: 13113,
+    sjj: 13114,
+    sjk: 13115,
+    sjl: 13116,
+    sjm: 13117,
+    sjn: 13118,
+    sjo: 13119,
+    sjp: 13120,
+    sjq: 13121,
+    sjr: 13122,
+    sjs: 13123,
+    sjt: 13124,
+    sju: 13125,
+    sjv: 13126,
+    sjw: 13127,
+    sjx: 13128,
+    sjy: 13129,
+    skz: 13130,
+    ska: 13131,
+    skb: 13132,
+    skc: 13133,
+    skd: 13134,
+    ske: 13135,
+    skf: 13136,
+    skg: 13137,
+    skh: 13138,
+    ski: 13139,
+    skj: 13140,
+    skk: 13141,
+    skl: 13142,
+    skm: 13143,
+    skn: 13144,
+    sko: 13145,
+    skp: 13146,
+    skq: 13147,
+    skr: 13148,
+    sks: 13149,
+    skt: 13150,
+    sku: 13151,
+    skv: 13152,
+    skw: 13153,
+    skx: 13154,
+    sky: 13155,
+    slz: 13156,
+    sla: 13157,
+    slb: 13158,
+    slc: 13159,
+    sld: 13160,
+    sle: 13161,
+    slf: 13162,
+    slg: 13163,
+    slh: 13164,
+    sli: 13165,
+    slj: 13166,
+    slk: 13167,
+    sll: 13168,
+    slm: 13169,
+    sln: 13170,
+    slo: 13171,
+    slp: 13172,
+    slq: 13173,
+    slr: 13174,
+    sls: 13175,
+    slt: 13176,
+    slu: 13177,
+    slv: 13178,
+    slw: 13179,
+    slx: 13180,
+    sly: 13181,
+    smz: 13182,
+    sma: 13183,
+    smb: 13184,
+    smc: 13185,
+    smd: 13186,
+    sme: 13187,
+    smf: 13188,
+    smg: 13189,
+    smh: 13190,
+    smi: 13191,
+    smj: 13192,
+    smk: 13193,
+    sml: 13194,
+    smm: 13195,
+    smn: 13196,
+    smo: 13197,
+    smp: 13198,
+    smq: 13199,
+    smr: 13200,
+    sms: 13201,
+    smt: 13202,
+    smu: 13203,
+    smv: 13204,
+    smw: 13205,
+    smx: 13206,
+    smy: 13207,
+    snz: 13208,
+    sna: 13209,
+    snb: 13210,
+    snc: 13211,
+    snd: 13212,
+    sne: 13213,
+    snf: 13214,
+    sng: 13215,
+    snh: 13216,
+    sni: 13217,
+    snj: 13218,
+    snk: 13219,
+    snl: 13220,
+    snm: 13221,
+    snn: 13222,
+    sno: 13223,
+    snp: 13224,
+    snq: 13225,
+    snr: 13226,
+    sns: 13227,
+    snt: 13228,
+    snu: 13229,
+    snv: 13230,
+    snw: 13231,
+    snx: 13232,
+    sny: 13233,
+    soz: 13234,
+    soa: 13235,
+    sob: 13236,
+    soc: 13237,
+    sod: 13238,
+    soe: 13239,
+    sof: 13240,
+    sog: 13241,
+    soh: 13242,
+    soi: 13243,
+    soj: 13244,
+    sok: 13245,
+    sol: 13246,
+    som: 13247,
+    son: 13248,
+    soo: 13249,
+    sop: 13250,
+    soq: 13251,
+    sor: 13252,
+    sos: 13253,
+    sot: 13254,
+    sou: 13255,
+    sov: 13256,
+    sow: 13257,
+    sox: 13258,
+    soy: 13259,
+    spz: 13260,
+    spa: 13261,
+    spb: 13262,
+    spc: 13263,
+    spd: 13264,
+    spe: 13265,
+    spf: 13266,
+    spg: 13267,
+    sph: 13268,
+    spi: 13269,
+    spj: 13270,
+    spk: 13271,
+    spl: 13272,
+    spm: 13273,
+    spn: 13274,
+    spo: 13275,
+    spp: 13276,
+    spq: 13277,
+    spr: 13278,
+    sps: 13279,
+    spt: 13280,
+    spu: 13281,
+    spv: 13282,
+    spw: 13283,
+    spx: 13284,
+    spy: 13285,
+    sqz: 13286,
+    sqa: 13287,
+    sqb: 13288,
+    sqc: 13289,
+    sqd: 13290,
+    sqe: 13291,
+    sqf: 13292,
+    sqg: 13293,
+    sqh: 13294,
+    sqi: 13295,
+    sqj: 13296,
+    sqk: 13297,
+    sql: 13298,
+    sqm: 13299,
+    sqn: 13300,
+    sqo: 13301,
+    sqp: 13302,
+    sqq: 13303,
+    sqr: 13304,
+    sqs: 13305,
+    sqt: 13306,
+    squ: 13307,
+    sqv: 13308,
+    sqw: 13309,
+    sqx: 13310,
+    sqy: 13311,
+    srz: 13312,
+    sra: 13313,
+    srb: 13314,
+    src: 13315,
+    srd: 13316,
+    sre: 13317,
+    srf: 13318,
+    srg: 13319,
+    srh: 13320,
+    sri: 13321,
+    srj: 13322,
+    srk: 13323,
+    srl: 13324,
+    srm: 13325,
+    srn: 13326,
+    sro: 13327,
+    srp: 13328,
+    srq: 13329,
+    srr: 13330,
+    srs: 13331,
+    srt: 13332,
+    sru: 13333,
+    srv: 13334,
+    srw: 13335,
+    srx: 13336,
+    sry: 13337,
+    ssz: 13338,
+    ssa: 13339,
+    ssb: 13340,
+    ssc: 13341,
+    ssd: 13342,
+    sse: 13343,
+    ssf: 13344,
+    ssg: 13345,
+    ssh: 13346,
+    ssi: 13347,
+    ssj: 13348,
+    ssk: 13349,
+    ssl: 13350,
+    ssm: 13351,
+    ssn: 13352,
+    sso: 13353,
+    ssp: 13354,
+    ssq: 13355,
+    ssr: 13356,
+    sss: 13357,
+    sst: 13358,
+    ssu: 13359,
+    ssv: 13360,
+    ssw: 13361,
+    ssx: 13362,
+    ssy: 13363,
+    stz: 13364,
+    sta: 13365,
+    stb: 13366,
+    stc: 13367,
+    std: 13368,
+    ste: 13369,
+    stf: 13370,
+    stg: 13371,
+    sth: 13372,
+    sti: 13373,
+    stj: 13374,
+    stk: 13375,
+    stl: 13376,
+    stm: 13377,
+    stn: 13378,
+    sto: 13379,
+    stp: 13380,
+    stq: 13381,
+    str: 13382,
+    sts: 13383,
+    stt: 13384,
+    stu: 13385,
+    stv: 13386,
+    stw: 13387,
+    stx: 13388,
+    sty: 13389,
+    suz: 13390,
+    sua: 13391,
+    sub: 13392,
+    suc: 13393,
+    sud: 13394,
+    sue: 13395,
+    suf: 13396,
+    sug: 13397,
+    suh: 13398,
+    sui: 13399,
+    suj: 13400,
+    suk: 13401,
+    sul: 13402,
+    sum: 13403,
+    sun: 13404,
+    suo: 13405,
+    sup: 13406,
+    suq: 13407,
+    sur: 13408,
+    sus: 13409,
+    sut: 13410,
+    suu: 13411,
+    suv: 13412,
+    suw: 13413,
+    sux: 13414,
+    suy: 13415,
+    svz: 13416,
+    sva: 13417,
+    svb: 13418,
+    svc: 13419,
+    svd: 13420,
+    sve: 13421,
+    svf: 13422,
+    svg: 13423,
+    svh: 13424,
+    svi: 13425,
+    svj: 13426,
+    svk: 13427,
+    svl: 13428,
+    svm: 13429,
+    svn: 13430,
+    svo: 13431,
+    svp: 13432,
+    svq: 13433,
+    svr: 13434,
+    svs: 13435,
+    svt: 13436,
+    svu: 13437,
+    svv: 13438,
+    svw: 13439,
+    svx: 13440,
+    svy: 13441,
+    swz: 13442,
+    swa: 13443,
+    swb: 13444,
+    swc: 13445,
+    swd: 13446,
+    swe: 13447,
+    swf: 13448,
+    swg: 13449,
+    swh: 13450,
+    swi: 13451,
+    swj: 13452,
+    swk: 13453,
+    swl: 13454,
+    swm: 13455,
+    swn: 13456,
+    swo: 13457,
+    swp: 13458,
+    swq: 13459,
+    swr: 13460,
+    sws: 13461,
+    swt: 13462,
+    swu: 13463,
+    swv: 13464,
+    sww: 13465,
+    swx: 13466,
+    swy: 13467,
+    sxz: 13468,
+    sxa: 13469,
+    sxb: 13470,
+    sxc: 13471,
+    sxd: 13472,
+    sxe: 13473,
+    sxf: 13474,
+    sxg: 13475,
+    sxh: 13476,
+    sxi: 13477,
+    sxj: 13478,
+    sxk: 13479,
+    sxl: 13480,
+    sxm: 13481,
+    sxn: 13482,
+    sxo: 13483,
+    sxp: 13484,
+    sxq: 13485,
+    sxr: 13486,
+    sxs: 13487,
+    sxt: 13488,
+    sxu: 13489,
+    sxv: 13490,
+    sxw: 13491,
+    sxx: 13492,
+    sxy: 13493,
+    syz: 13494,
+    sya: 13495,
+    syb: 13496,
+    syc: 13497,
+    syd: 13498,
+    sye: 13499,
+    syf: 13500,
+    syg: 13501,
+    syh: 13502,
+    syi: 13503,
+    syj: 13504,
+    syk: 13505,
+    syl: 13506,
+    sym: 13507,
+    syn: 13508,
+    syo: 13509,
+    syp: 13510,
+    syq: 13511,
+    syr: 13512,
+    sys: 13513,
+    syt: 13514,
+    syu: 13515,
+    syv: 13516,
+    syw: 13517,
+    syx: 13518,
+    syy: 13519,
+    tzz: 13520,
+    tza: 13521,
+    tzb: 13522,
+    tzc: 13523,
+    tzd: 13524,
+    tze: 13525,
+    tzf: 13526,
+    tzg: 13527,
+    tzh: 13528,
+    tzi: 13529,
+    tzj: 13530,
+    tzk: 13531,
+    tzl: 13532,
+    tzm: 13533,
+    tzn: 13534,
+    tzo: 13535,
+    tzp: 13536,
+    tzq: 13537,
+    tzr: 13538,
+    tzs: 13539,
+    tzt: 13540,
+    tzu: 13541,
+    tzv: 13542,
+    tzw: 13543,
+    tzx: 13544,
+    tzy: 13545,
+    taz: 13546,
+    taa: 13547,
+    tab: 13548,
+    tac: 13549,
+    tad: 13550,
+    tae: 13551,
+    taf: 13552,
+    tag: 13553,
+    tah: 13554,
+    tai: 13555,
+    taj: 13556,
+    tak: 13557,
+    tal: 13558,
+    tam: 13559,
+    tan: 13560,
+    tao: 13561,
+    tap: 13562,
+    taq: 13563,
+    tar: 13564,
+    tas: 13565,
+    tat: 13566,
+    tau: 13567,
+    tav: 13568,
+    taw: 13569,
+    tax: 13570,
+    tay: 13571,
+    tbz: 13572,
+    tba: 13573,
+    tbb: 13574,
+    tbc: 13575,
+    tbd: 13576,
+    tbe: 13577,
+    tbf: 13578,
+    tbg: 13579,
+    tbh: 13580,
+    tbi: 13581,
+    tbj: 13582,
+    tbk: 13583,
+    tbl: 13584,
+    tbm: 13585,
+    tbn: 13586,
+    tbo: 13587,
+    tbp: 13588,
+    tbq: 13589,
+    tbr: 13590,
+    tbs: 13591,
+    tbt: 13592,
+    tbu: 13593,
+    tbv: 13594,
+    tbw: 13595,
+    tbx: 13596,
+    tby: 13597,
+    tcz: 13598,
+    tca: 13599,
+    tcb: 13600,
+    tcc: 13601,
+    tcd: 13602,
+    tce: 13603,
+    tcf: 13604,
+    tcg: 13605,
+    tch: 13606,
+    tci: 13607,
+    tcj: 13608,
+    tck: 13609,
+    tcl: 13610,
+    tcm: 13611,
+    tcn: 13612,
+    tco: 13613,
+    tcp: 13614,
+    tcq: 13615,
+    tcr: 13616,
+    tcs: 13617,
+    tct: 13618,
+    tcu: 13619,
+    tcv: 13620,
+    tcw: 13621,
+    tcx: 13622,
+    tcy: 13623,
+    tdz: 13624,
+    tda: 13625,
+    tdb: 13626,
+    tdc: 13627,
+    tdd: 13628,
+    tde: 13629,
+    tdf: 13630,
+    tdg: 13631,
+    tdh: 13632,
+    tdi: 13633,
+    tdj: 13634,
+    tdk: 13635,
+    tdl: 13636,
+    tdm: 13637,
+    tdn: 13638,
+    tdo: 13639,
+    tdp: 13640,
+    tdq: 13641,
+    tdr: 13642,
+    tds: 13643,
+    tdt: 13644,
+    tdu: 13645,
+    tdv: 13646,
+    tdw: 13647,
+    tdx: 13648,
+    tdy: 13649,
+    tez: 13650,
+    tea: 13651,
+    teb: 13652,
+    tec: 13653,
+    ted: 13654,
+    tee: 13655,
+    tef: 13656,
+    teg: 13657,
+    teh: 13658,
+    tei: 13659,
+    tej: 13660,
+    tek: 13661,
+    tel: 13662,
+    tem: 13663,
+    ten: 13664,
+    teo: 13665,
+    tep: 13666,
+    teq: 13667,
+    ter: 13668,
+    tes: 13669,
+    tet: 13670,
+    teu: 13671,
+    tev: 13672,
+    tew: 13673,
+    tex: 13674,
+    tey: 13675,
+    tfz: 13676,
+    tfa: 13677,
+    tfb: 13678,
+    tfc: 13679,
+    tfd: 13680,
+    tfe: 13681,
+    tff: 13682,
+    tfg: 13683,
+    tfh: 13684,
+    tfi: 13685,
+    tfj: 13686,
+    tfk: 13687,
+    tfl: 13688,
+    tfm: 13689,
+    tfn: 13690,
+    tfo: 13691,
+    tfp: 13692,
+    tfq: 13693,
+    tfr: 13694,
+    tfs: 13695,
+    tft: 13696,
+    tfu: 13697,
+    tfv: 13698,
+    tfw: 13699,
+    tfx: 13700,
+    tfy: 13701,
+    tgz: 13702,
+    tga: 13703,
+    tgb: 13704,
+    tgc: 13705,
+    tgd: 13706,
+    tge: 13707,
+    tgf: 13708,
+    tgg: 13709,
+    tgh: 13710,
+    tgi: 13711,
+    tgj: 13712,
+    tgk: 13713,
+    tgl: 13714,
+    tgm: 13715,
+    tgn: 13716,
+    tgo: 13717,
+    tgp: 13718,
+    tgq: 13719,
+    tgr: 13720,
+    tgs: 13721,
+    tgt: 13722,
+    tgu: 13723,
+    tgv: 13724,
+    tgw: 13725,
+    tgx: 13726,
+    tgy: 13727,
+    thz: 13728,
+    tha: 13729,
+    thb: 13730,
+    thc: 13731,
+    thd: 13732,
+    the: 13733,
+    thf: 13734,
+    thg: 13735,
+    thh: 13736,
+    thi: 13737,
+    thj: 13738,
+    thk: 13739,
+    thl: 13740,
+    thm: 13741,
+    thn: 13742,
+    tho: 13743,
+    thp: 13744,
+    thq: 13745,
+    thr: 13746,
+    ths: 13747,
+    tht: 13748,
+    thu: 13749,
+    thv: 13750,
+    thw: 13751,
+    thx: 13752,
+    thy: 13753,
+    tiz: 13754,
+    tia: 13755,
+    tib: 13756,
+    tic: 13757,
+    tid: 13758,
+    tie: 13759,
+    tif: 13760,
+    tig: 13761,
+    tih: 13762,
+    tii: 13763,
+    tij: 13764,
+    tik: 13765,
+    til: 13766,
+    tim: 13767,
+    tin: 13768,
+    tio: 13769,
+    tip: 13770,
+    tiq: 13771,
+    tir: 13772,
+    tis: 13773,
+    tit: 13774,
+    tiu: 13775,
+    tiv: 13776,
+    tiw: 13777,
+    tix: 13778,
+    tiy: 13779,
+    tjz: 13780,
+    tja: 13781,
+    tjb: 13782,
+    tjc: 13783,
+    tjd: 13784,
+    tje: 13785,
+    tjf: 13786,
+    tjg: 13787,
+    tjh: 13788,
+    tji: 13789,
+    tjj: 13790,
+    tjk: 13791,
+    tjl: 13792,
+    tjm: 13793,
+    tjn: 13794,
+    tjo: 13795,
+    tjp: 13796,
+    tjq: 13797,
+    tjr: 13798,
+    tjs: 13799,
+    tjt: 13800,
+    tju: 13801,
+    tjv: 13802,
+    tjw: 13803,
+    tjx: 13804,
+    tjy: 13805,
+    tkz: 13806,
+    tka: 13807,
+    tkb: 13808,
+    tkc: 13809,
+    tkd: 13810,
+    tke: 13811,
+    tkf: 13812,
+    tkg: 13813,
+    tkh: 13814,
+    tki: 13815,
+    tkj: 13816,
+    tkk: 13817,
+    tkl: 13818,
+    tkm: 13819,
+    tkn: 13820,
+    tko: 13821,
+    tkp: 13822,
+    tkq: 13823,
+    tkr: 13824,
+    tks: 13825,
+    tkt: 13826,
+    tku: 13827,
+    tkv: 13828,
+    tkw: 13829,
+    tkx: 13830,
+    tky: 13831,
+    tlz: 13832,
+    tla: 13833,
+    tlb: 13834,
+    tlc: 13835,
+    tld: 13836,
+    tle: 13837,
+    tlf: 13838,
+    tlg: 13839,
+    tlh: 13840,
+    tli: 13841,
+    tlj: 13842,
+    tlk: 13843,
+    tll: 13844,
+    tlm: 13845,
+    tln: 13846,
+    tlo: 13847,
+    tlp: 13848,
+    tlq: 13849,
+    tlr: 13850,
+    tls: 13851,
+    tlt: 13852,
+    tlu: 13853,
+    tlv: 13854,
+    tlw: 13855,
+    tlx: 13856,
+    tly: 13857,
+    tmz: 13858,
+    tma: 13859,
+    tmb: 13860,
+    tmc: 13861,
+    tmd: 13862,
+    tme: 13863,
+    tmf: 13864,
+    tmg: 13865,
+    tmh: 13866,
+    tmi: 13867,
+    tmj: 13868,
+    tmk: 13869,
+    tml: 13870,
+    tmm: 13871,
+    tmn: 13872,
+    tmo: 13873,
+    tmp: 13874,
+    tmq: 13875,
+    tmr: 13876,
+    tms: 13877,
+    tmt: 13878,
+    tmu: 13879,
+    tmv: 13880,
+    tmw: 13881,
+    tmx: 13882,
+    tmy: 13883,
+    tnz: 13884,
+    tna: 13885,
+    tnb: 13886,
+    tnc: 13887,
+    tnd: 13888,
+    tne: 13889,
+    tnf: 13890,
+    tng: 13891,
+    tnh: 13892,
+    tni: 13893,
+    tnj: 13894,
+    tnk: 13895,
+    tnl: 13896,
+    tnm: 13897,
+    tnn: 13898,
+    tno: 13899,
+    tnp: 13900,
+    tnq: 13901,
+    tnr: 13902,
+    tns: 13903,
+    tnt: 13904,
+    tnu: 13905,
+    tnv: 13906,
+    tnw: 13907,
+    tnx: 13908,
+    tny: 13909,
+    toz: 13910,
+    toa: 13911,
+    tob: 13912,
+    toc: 13913,
+    tod: 13914,
+    toe: 13915,
+    tof: 13916,
+    tog: 13917,
+    toh: 13918,
+    toi: 13919,
+    toj: 13920,
+    tok: 13921,
+    tol: 13922,
+    tom: 13923,
+    ton: 13924,
+    too: 13925,
+    top: 13926,
+    toq: 13927,
+    tor: 13928,
+    tos: 13929,
+    tot: 13930,
+    tou: 13931,
+    tov: 13932,
+    tow: 13933,
+    tox: 13934,
+    toy: 13935,
+    tpz: 13936,
+    tpa: 13937,
+    tpb: 13938,
+    tpc: 13939,
+    tpd: 13940,
+    tpe: 13941,
+    tpf: 13942,
+    tpg: 13943,
+    tph: 13944,
+    tpi: 13945,
+    tpj: 13946,
+    tpk: 13947,
+    tpl: 13948,
+    tpm: 13949,
+    tpn: 13950,
+    tpo: 13951,
+    tpp: 13952,
+    tpq: 13953,
+    tpr: 13954,
+    tps: 13955,
+    tpt: 13956,
+    tpu: 13957,
+    tpv: 13958,
+    tpw: 13959,
+    tpx: 13960,
+    tpy: 13961,
+    tqz: 13962,
+    tqa: 13963,
+    tqb: 13964,
+    tqc: 13965,
+    tqd: 13966,
+    tqe: 13967,
+    tqf: 13968,
+    tqg: 13969,
+    tqh: 13970,
+    tqi: 13971,
+    tqj: 13972,
+    tqk: 13973,
+    tql: 13974,
+    tqm: 13975,
+    tqn: 13976,
+    tqo: 13977,
+    tqp: 13978,
+    tqq: 13979,
+    tqr: 13980,
+    tqs: 13981,
+    tqt: 13982,
+    tqu: 13983,
+    tqv: 13984,
+    tqw: 13985,
+    tqx: 13986,
+    tqy: 13987,
+    trz: 13988,
+    tra: 13989,
+    trb: 13990,
+    trc: 13991,
+    trd: 13992,
+    tre: 13993,
+    trf: 13994,
+    trg: 13995,
+    trh: 13996,
+    tri: 13997,
+    trj: 13998,
+    trk: 13999,
+    trl: 14000,
+    trm: 14001,
+    trn: 14002,
+    tro: 14003,
+    trp: 14004,
+    trq: 14005,
+    trr: 14006,
+    trs: 14007,
+    trt: 14008,
+    tru: 14009,
+    trv: 14010,
+    trw: 14011,
+    trx: 14012,
+    try: 14013,
+    tsz: 14014,
+    tsa: 14015,
+    tsb: 14016,
+    tsc: 14017,
+    tsd: 14018,
+    tse: 14019,
+    tsf: 14020,
+    tsg: 14021,
+    tsh: 14022,
+    tsi: 14023,
+    tsj: 14024,
+    tsk: 14025,
+    tsl: 14026,
+    tsm: 14027,
+    tsn: 14028,
+    tso: 14029,
+    tsp: 14030,
+    tsq: 14031,
+    tsr: 14032,
+    tss: 14033,
+    tst: 14034,
+    tsu: 14035,
+    tsv: 14036,
+    tsw: 14037,
+    tsx: 14038,
+    tsy: 14039,
+    ttz: 14040,
+    tta: 14041,
+    ttb: 14042,
+    ttc: 14043,
+    ttd: 14044,
+    tte: 14045,
+    ttf: 14046,
+    ttg: 14047,
+    tth: 14048,
+    tti: 14049,
+    ttj: 14050,
+    ttk: 14051,
+    ttl: 14052,
+    ttm: 14053,
+    ttn: 14054,
+    tto: 14055,
+    ttp: 14056,
+    ttq: 14057,
+    ttr: 14058,
+    tts: 14059,
+    ttt: 14060,
+    ttu: 14061,
+    ttv: 14062,
+    ttw: 14063,
+    ttx: 14064,
+    tty: 14065,
+    tuz: 14066,
+    tua: 14067,
+    tub: 14068,
+    tuc: 14069,
+    tud: 14070,
+    tue: 14071,
+    tuf: 14072,
+    tug: 14073,
+    tuh: 14074,
+    tui: 14075,
+    tuj: 14076,
+    tuk: 14077,
+    tul: 14078,
+    tum: 14079,
+    tun: 14080,
+    tuo: 14081,
+    tup: 14082,
+    tuq: 14083,
+    tur: 14084,
+    tus: 14085,
+    tut: 14086,
+    tuu: 14087,
+    tuv: 14088,
+    tuw: 14089,
+    tux: 14090,
+    tuy: 14091,
+    tvz: 14092,
+    tva: 14093,
+    tvb: 14094,
+    tvc: 14095,
+    tvd: 14096,
+    tve: 14097,
+    tvf: 14098,
+    tvg: 14099,
+    tvh: 14100,
+    tvi: 14101,
+    tvj: 14102,
+    tvk: 14103,
+    tvl: 14104,
+    tvm: 14105,
+    tvn: 14106,
+    tvo: 14107,
+    tvp: 14108,
+    tvq: 14109,
+    tvr: 14110,
+    tvs: 14111,
+    tvt: 14112,
+    tvu: 14113,
+    tvv: 14114,
+    tvw: 14115,
+    tvx: 14116,
+    tvy: 14117,
+    twz: 14118,
+    twa: 14119,
+    twb: 14120,
+    twc: 14121,
+    twd: 14122,
+    twe: 14123,
+    twf: 14124,
+    twg: 14125,
+    twh: 14126,
+    twi: 14127,
+    twj: 14128,
+    twk: 14129,
+    twl: 14130,
+    twm: 14131,
+    twn: 14132,
+    two: 14133,
+    twp: 14134,
+    twq: 14135,
+    twr: 14136,
+    tws: 14137,
+    twt: 14138,
+    twu: 14139,
+    twv: 14140,
+    tww: 14141,
+    twx: 14142,
+    twy: 14143,
+    txz: 14144,
+    txa: 14145,
+    txb: 14146,
+    txc: 14147,
+    txd: 14148,
+    txe: 14149,
+    txf: 14150,
+    txg: 14151,
+    txh: 14152,
+    txi: 14153,
+    txj: 14154,
+    txk: 14155,
+    txl: 14156,
+    txm: 14157,
+    txn: 14158,
+    txo: 14159,
+    txp: 14160,
+    txq: 14161,
+    txr: 14162,
+    txs: 14163,
+    txt: 14164,
+    txu: 14165,
+    txv: 14166,
+    txw: 14167,
+    txx: 14168,
+    txy: 14169,
+    tyz: 14170,
+    tya: 14171,
+    tyb: 14172,
+    tyc: 14173,
+    tyd: 14174,
+    tye: 14175,
+    tyf: 14176,
+    tyg: 14177,
+    tyh: 14178,
+    tyi: 14179,
+    tyj: 14180,
+    tyk: 14181,
+    tyl: 14182,
+    tym: 14183,
+    tyn: 14184,
+    tyo: 14185,
+    typ: 14186,
+    tyq: 14187,
+    tyr: 14188,
+    tys: 14189,
+    tyt: 14190,
+    tyu: 14191,
+    tyv: 14192,
+    tyw: 14193,
+    tyx: 14194,
+    tyy: 14195,
+    uzz: 14196,
+    uza: 14197,
+    uzb: 14198,
+    uzc: 14199,
+    uzd: 14200,
+    uze: 14201,
+    uzf: 14202,
+    uzg: 14203,
+    uzh: 14204,
+    uzi: 14205,
+    uzj: 14206,
+    uzk: 14207,
+    uzl: 14208,
+    uzm: 14209,
+    uzn: 14210,
+    uzo: 14211,
+    uzp: 14212,
+    uzq: 14213,
+    uzr: 14214,
+    uzs: 14215,
+    uzt: 14216,
+    uzu: 14217,
+    uzv: 14218,
+    uzw: 14219,
+    uzx: 14220,
+    uzy: 14221,
+    uaz: 14222,
+    uaa: 14223,
+    uab: 14224,
+    uac: 14225,
+    uad: 14226,
+    uae: 14227,
+    uaf: 14228,
+    uag: 14229,
+    uah: 14230,
+    uai: 14231,
+    uaj: 14232,
+    uak: 14233,
+    ual: 14234,
+    uam: 14235,
+    uan: 14236,
+    uao: 14237,
+    uap: 14238,
+    uaq: 14239,
+    uar: 14240,
+    uas: 14241,
+    uat: 14242,
+    uau: 14243,
+    uav: 14244,
+    uaw: 14245,
+    uax: 14246,
+    uay: 14247,
+    ubz: 14248,
+    uba: 14249,
+    ubb: 14250,
+    ubc: 14251,
+    ubd: 14252,
+    ube: 14253,
+    ubf: 14254,
+    ubg: 14255,
+    ubh: 14256,
+    ubi: 14257,
+    ubj: 14258,
+    ubk: 14259,
+    ubl: 14260,
+    ubm: 14261,
+    ubn: 14262,
+    ubo: 14263,
+    ubp: 14264,
+    ubq: 14265,
+    ubr: 14266,
+    ubs: 14267,
+    ubt: 14268,
+    ubu: 14269,
+    ubv: 14270,
+    ubw: 14271,
+    ubx: 14272,
+    uby: 14273,
+    ucz: 14274,
+    uca: 14275,
+    ucb: 14276,
+    ucc: 14277,
+    ucd: 14278,
+    uce: 14279,
+    ucf: 14280,
+    ucg: 14281,
+    uch: 14282,
+    uci: 14283,
+    ucj: 14284,
+    uck: 14285,
+    ucl: 14286,
+    ucm: 14287,
+    ucn: 14288,
+    uco: 14289,
+    ucp: 14290,
+    ucq: 14291,
+    ucr: 14292,
+    ucs: 14293,
+    uct: 14294,
+    ucu: 14295,
+    ucv: 14296,
+    ucw: 14297,
+    ucx: 14298,
+    ucy: 14299,
+    udz: 14300,
+    uda: 14301,
+    udb: 14302,
+    udc: 14303,
+    udd: 14304,
+    ude: 14305,
+    udf: 14306,
+    udg: 14307,
+    udh: 14308,
+    udi: 14309,
+    udj: 14310,
+    udk: 14311,
+    udl: 14312,
+    udm: 14313,
+    udn: 14314,
+    udo: 14315,
+    udp: 14316,
+    udq: 14317,
+    udr: 14318,
+    uds: 14319,
+    udt: 14320,
+    udu: 14321,
+    udv: 14322,
+    udw: 14323,
+    udx: 14324,
+    udy: 14325,
+    uez: 14326,
+    uea: 14327,
+    ueb: 14328,
+    uec: 14329,
+    ued: 14330,
+    uee: 14331,
+    uef: 14332,
+    ueg: 14333,
+    ueh: 14334,
+    uei: 14335,
+    uej: 14336,
+    uek: 14337,
+    uel: 14338,
+    uem: 14339,
+    uen: 14340,
+    ueo: 14341,
+    uep: 14342,
+    ueq: 14343,
+    uer: 14344,
+    ues: 14345,
+    uet: 14346,
+    ueu: 14347,
+    uev: 14348,
+    uew: 14349,
+    uex: 14350,
+    uey: 14351,
+    ufz: 14352,
+    ufa: 14353,
+    ufb: 14354,
+    ufc: 14355,
+    ufd: 14356,
+    ufe: 14357,
+    uff: 14358,
+    ufg: 14359,
+    ufh: 14360,
+    ufi: 14361,
+    ufj: 14362,
+    ufk: 14363,
+    ufl: 14364,
+    ufm: 14365,
+    ufn: 14366,
+    ufo: 14367,
+    ufp: 14368,
+    ufq: 14369,
+    ufr: 14370,
+    ufs: 14371,
+    uft: 14372,
+    ufu: 14373,
+    ufv: 14374,
+    ufw: 14375,
+    ufx: 14376,
+    ufy: 14377,
+    ugz: 14378,
+    uga: 14379,
+    ugb: 14380,
+    ugc: 14381,
+    ugd: 14382,
+    uge: 14383,
+    ugf: 14384,
+    ugg: 14385,
+    ugh: 14386,
+    ugi: 14387,
+    ugj: 14388,
+    ugk: 14389,
+    ugl: 14390,
+    ugm: 14391,
+    ugn: 14392,
+    ugo: 14393,
+    ugp: 14394,
+    ugq: 14395,
+    ugr: 14396,
+    ugs: 14397,
+    ugt: 14398,
+    ugu: 14399,
+    ugv: 14400,
+    ugw: 14401,
+    ugx: 14402,
+    ugy: 14403,
+    uhz: 14404,
+    uha: 14405,
+    uhb: 14406,
+    uhc: 14407,
+    uhd: 14408,
+    uhe: 14409,
+    uhf: 14410,
+    uhg: 14411,
+    uhh: 14412,
+    uhi: 14413,
+    uhj: 14414,
+    uhk: 14415,
+    uhl: 14416,
+    uhm: 14417,
+    uhn: 14418,
+    uho: 14419,
+    uhp: 14420,
+    uhq: 14421,
+    uhr: 14422,
+    uhs: 14423,
+    uht: 14424,
+    uhu: 14425,
+    uhv: 14426,
+    uhw: 14427,
+    uhx: 14428,
+    uhy: 14429,
+    uiz: 14430,
+    uia: 14431,
+    uib: 14432,
+    uic: 14433,
+    uid: 14434,
+    uie: 14435,
+    uif: 14436,
+    uig: 14437,
+    uih: 14438,
+    uii: 14439,
+    uij: 14440,
+    uik: 14441,
+    uil: 14442,
+    uim: 14443,
+    uin: 14444,
+    uio: 14445,
+    uip: 14446,
+    uiq: 14447,
+    uir: 14448,
+    uis: 14449,
+    uit: 14450,
+    uiu: 14451,
+    uiv: 14452,
+    uiw: 14453,
+    uix: 14454,
+    uiy: 14455,
+    ujz: 14456,
+    uja: 14457,
+    ujb: 14458,
+    ujc: 14459,
+    ujd: 14460,
+    uje: 14461,
+    ujf: 14462,
+    ujg: 14463,
+    ujh: 14464,
+    uji: 14465,
+    ujj: 14466,
+    ujk: 14467,
+    ujl: 14468,
+    ujm: 14469,
+    ujn: 14470,
+    ujo: 14471,
+    ujp: 14472,
+    ujq: 14473,
+    ujr: 14474,
+    ujs: 14475,
+    ujt: 14476,
+    uju: 14477,
+    ujv: 14478,
+    ujw: 14479,
+    ujx: 14480,
+    ujy: 14481,
+    ukz: 14482,
+    uka: 14483,
+    ukb: 14484,
+    ukc: 14485,
+    ukd: 14486,
+    uke: 14487,
+    ukf: 14488,
+    ukg: 14489,
+    ukh: 14490,
+    uki: 14491,
+    ukj: 14492,
+    ukk: 14493,
+    ukl: 14494,
+    ukm: 14495,
+    ukn: 14496,
+    uko: 14497,
+    ukp: 14498,
+    ukq: 14499,
+    ukr: 14500,
+    uks: 14501,
+    ukt: 14502,
+    uku: 14503,
+    ukv: 14504,
+    ukw: 14505,
+    ukx: 14506,
+    uky: 14507,
+    ulz: 14508,
+    ula: 14509,
+    ulb: 14510,
+    ulc: 14511,
+    uld: 14512,
+    ule: 14513,
+    ulf: 14514,
+    ulg: 14515,
+    ulh: 14516,
+    uli: 14517,
+    ulj: 14518,
+    ulk: 14519,
+    ull: 14520,
+    ulm: 14521,
+    uln: 14522,
+    ulo: 14523,
+    ulp: 14524,
+    ulq: 14525,
+    ulr: 14526,
+    uls: 14527,
+    ult: 14528,
+    ulu: 14529,
+    ulv: 14530,
+    ulw: 14531,
+    ulx: 14532,
+    uly: 14533,
+    umz: 14534,
+    uma: 14535,
+    umb: 14536,
+    umc: 14537,
+    umd: 14538,
+    ume: 14539,
+    umf: 14540,
+    umg: 14541,
+    umh: 14542,
+    umi: 14543,
+    umj: 14544,
+    umk: 14545,
+    uml: 14546,
+    umm: 14547,
+    umn: 14548,
+    umo: 14549,
+    ump: 14550,
+    umq: 14551,
+    umr: 14552,
+    ums: 14553,
+    umt: 14554,
+    umu: 14555,
+    umv: 14556,
+    umw: 14557,
+    umx: 14558,
+    umy: 14559,
+    unz: 14560,
+    una: 14561,
+    unb: 14562,
+    unc: 14563,
+    und: 14564,
+    une: 14565,
+    unf: 14566,
+    ung: 14567,
+    unh: 14568,
+    uni: 14569,
+    unj: 14570,
+    unk: 14571,
+    unl: 14572,
+    unm: 14573,
+    unn: 14574,
+    uno: 14575,
+    unp: 14576,
+    unq: 14577,
+    unr: 14578,
+    uns: 14579,
+    unt: 14580,
+    unu: 14581,
+    unv: 14582,
+    unw: 14583,
+    unx: 14584,
+    uny: 14585,
+    uoz: 14586,
+    uoa: 14587,
+    uob: 14588,
+    uoc: 14589,
+    uod: 14590,
+    uoe: 14591,
+    uof: 14592,
+    uog: 14593,
+    uoh: 14594,
+    uoi: 14595,
+    uoj: 14596,
+    uok: 14597,
+    uol: 14598,
+    uom: 14599,
+    uon: 14600,
+    uoo: 14601,
+    uop: 14602,
+    uoq: 14603,
+    uor: 14604,
+    uos: 14605,
+    uot: 14606,
+    uou: 14607,
+    uov: 14608,
+    uow: 14609,
+    uox: 14610,
+    uoy: 14611,
+    upz: 14612,
+    upa: 14613,
+    upb: 14614,
+    upc: 14615,
+    upd: 14616,
+    upe: 14617,
+    upf: 14618,
+    upg: 14619,
+    uph: 14620,
+    upi: 14621,
+    upj: 14622,
+    upk: 14623,
+    upl: 14624,
+    upm: 14625,
+    upn: 14626,
+    upo: 14627,
+    upp: 14628,
+    upq: 14629,
+    upr: 14630,
+    ups: 14631,
+    upt: 14632,
+    upu: 14633,
+    upv: 14634,
+    upw: 14635,
+    upx: 14636,
+    upy: 14637,
+    uqz: 14638,
+    uqa: 14639,
+    uqb: 14640,
+    uqc: 14641,
+    uqd: 14642,
+    uqe: 14643,
+    uqf: 14644,
+    uqg: 14645,
+    uqh: 14646,
+    uqi: 14647,
+    uqj: 14648,
+    uqk: 14649,
+    uql: 14650,
+    uqm: 14651,
+    uqn: 14652,
+    uqo: 14653,
+    uqp: 14654,
+    uqq: 14655,
+    uqr: 14656,
+    uqs: 14657,
+    uqt: 14658,
+    uqu: 14659,
+    uqv: 14660,
+    uqw: 14661,
+    uqx: 14662,
+    uqy: 14663,
+    urz: 14664,
+    ura: 14665,
+    urb: 14666,
+    urc: 14667,
+    urd: 14668,
+    ure: 14669,
+    urf: 14670,
+    urg: 14671,
+    urh: 14672,
+    uri: 14673,
+    urj: 14674,
+    urk: 14675,
+    url: 14676,
+    urm: 14677,
+    urn: 14678,
+    uro: 14679,
+    urp: 14680,
+    urq: 14681,
+    urr: 14682,
+    urs: 14683,
+    urt: 14684,
+    uru: 14685,
+    urv: 14686,
+    urw: 14687,
+    urx: 14688,
+    ury: 14689,
+    usz: 14690,
+    usa: 14691,
+    usb: 14692,
+    usc: 14693,
+    usd: 14694,
+    use: 14695,
+    usf: 14696,
+    usg: 14697,
+    ush: 14698,
+    usi: 14699,
+    usj: 14700,
+    usk: 14701,
+    usl: 14702,
+    usm: 14703,
+    usn: 14704,
+    uso: 14705,
+    usp: 14706,
+    usq: 14707,
+    usr: 14708,
+    uss: 14709,
+    ust: 14710,
+    usu: 14711,
+    usv: 14712,
+    usw: 14713,
+    usx: 14714,
+    usy: 14715,
+    utz: 14716,
+    uta: 14717,
+    utb: 14718,
+    utc: 14719,
+    utd: 14720,
+    ute: 14721,
+    utf: 14722,
+    utg: 14723,
+    uth: 14724,
+    uti: 14725,
+    utj: 14726,
+    utk: 14727,
+    utl: 14728,
+    utm: 14729,
+    utn: 14730,
+    uto: 14731,
+    utp: 14732,
+    utq: 14733,
+    utr: 14734,
+    uts: 14735,
+    utt: 14736,
+    utu: 14737,
+    utv: 14738,
+    utw: 14739,
+    utx: 14740,
+    uty: 14741,
+    uuz: 14742,
+    uua: 14743,
+    uub: 14744,
+    uuc: 14745,
+    uud: 14746,
+    uue: 14747,
+    uuf: 14748,
+    uug: 14749,
+    uuh: 14750,
+    uui: 14751,
+    uuj: 14752,
+    uuk: 14753,
+    uul: 14754,
+    uum: 14755,
+    uun: 14756,
+    uuo: 14757,
+    uup: 14758,
+    uuq: 14759,
+    uur: 14760,
+    uus: 14761,
+    uut: 14762,
+    uuu: 14763,
+    uuv: 14764,
+    uuw: 14765,
+    uux: 14766,
+    uuy: 14767,
+    uvz: 14768,
+    uva: 14769,
+    uvb: 14770,
+    uvc: 14771,
+    uvd: 14772,
+    uve: 14773,
+    uvf: 14774,
+    uvg: 14775,
+    uvh: 14776,
+    uvi: 14777,
+    uvj: 14778,
+    uvk: 14779,
+    uvl: 14780,
+    uvm: 14781,
+    uvn: 14782,
+    uvo: 14783,
+    uvp: 14784,
+    uvq: 14785,
+    uvr: 14786,
+    uvs: 14787,
+    uvt: 14788,
+    uvu: 14789,
+    uvv: 14790,
+    uvw: 14791,
+    uvx: 14792,
+    uvy: 14793,
+    uwz: 14794,
+    uwa: 14795,
+    uwb: 14796,
+    uwc: 14797,
+    uwd: 14798,
+    uwe: 14799,
+    uwf: 14800,
+    uwg: 14801,
+    uwh: 14802,
+    uwi: 14803,
+    uwj: 14804,
+    uwk: 14805,
+    uwl: 14806,
+    uwm: 14807,
+    uwn: 14808,
+    uwo: 14809,
+    uwp: 14810,
+    uwq: 14811,
+    uwr: 14812,
+    uws: 14813,
+    uwt: 14814,
+    uwu: 14815,
+    uwv: 14816,
+    uww: 14817,
+    uwx: 14818,
+    uwy: 14819,
+    uxz: 14820,
+    uxa: 14821,
+    uxb: 14822,
+    uxc: 14823,
+    uxd: 14824,
+    uxe: 14825,
+    uxf: 14826,
+    uxg: 14827,
+    uxh: 14828,
+    uxi: 14829,
+    uxj: 14830,
+    uxk: 14831,
+    uxl: 14832,
+    uxm: 14833,
+    uxn: 14834,
+    uxo: 14835,
+    uxp: 14836,
+    uxq: 14837,
+    uxr: 14838,
+    uxs: 14839,
+    uxt: 14840,
+    uxu: 14841,
+    uxv: 14842,
+    uxw: 14843,
+    uxx: 14844,
+    uxy: 14845,
+    uyz: 14846,
+    uya: 14847,
+    uyb: 14848,
+    uyc: 14849,
+    uyd: 14850,
+    uye: 14851,
+    uyf: 14852,
+    uyg: 14853,
+    uyh: 14854,
+    uyi: 14855,
+    uyj: 14856,
+    uyk: 14857,
+    uyl: 14858,
+    uym: 14859,
+    uyn: 14860,
+    uyo: 14861,
+    uyp: 14862,
+    uyq: 14863,
+    uyr: 14864,
+    uys: 14865,
+    uyt: 14866,
+    uyu: 14867,
+    uyv: 14868,
+    uyw: 14869,
+    uyx: 14870,
+    uyy: 14871,
+    vzz: 14872,
+    vza: 14873,
+    vzb: 14874,
+    vzc: 14875,
+    vzd: 14876,
+    vze: 14877,
+    vzf: 14878,
+    vzg: 14879,
+    vzh: 14880,
+    vzi: 14881,
+    vzj: 14882,
+    vzk: 14883,
+    vzl: 14884,
+    vzm: 14885,
+    vzn: 14886,
+    vzo: 14887,
+    vzp: 14888,
+    vzq: 14889,
+    vzr: 14890,
+    vzs: 14891,
+    vzt: 14892,
+    vzu: 14893,
+    vzv: 14894,
+    vzw: 14895,
+    vzx: 14896,
+    vzy: 14897,
+    vaz: 14898,
+    vaa: 14899,
+    vab: 14900,
+    vac: 14901,
+    vad: 14902,
+    vae: 14903,
+    vaf: 14904,
+    vag: 14905,
+    vah: 14906,
+    vai: 14907,
+    vaj: 14908,
+    vak: 14909,
+    val: 14910,
+    vam: 14911,
+    van: 14912,
+    vao: 14913,
+    vap: 14914,
+    vaq: 14915,
+    var: 14916,
+    vas: 14917,
+    vat: 14918,
+    vau: 14919,
+    vav: 14920,
+    vaw: 14921,
+    vax: 14922,
+    vay: 14923,
+    vbz: 14924,
+    vba: 14925,
+    vbb: 14926,
+    vbc: 14927,
+    vbd: 14928,
+    vbe: 14929,
+    vbf: 14930,
+    vbg: 14931,
+    vbh: 14932,
+    vbi: 14933,
+    vbj: 14934,
+    vbk: 14935,
+    vbl: 14936,
+    vbm: 14937,
+    vbn: 14938,
+    vbo: 14939,
+    vbp: 14940,
+    vbq: 14941,
+    vbr: 14942,
+    vbs: 14943,
+    vbt: 14944,
+    vbu: 14945,
+    vbv: 14946,
+    vbw: 14947,
+    vbx: 14948,
+    vby: 14949,
+    vcz: 14950,
+    vca: 14951,
+    vcb: 14952,
+    vcc: 14953,
+    vcd: 14954,
+    vce: 14955,
+    vcf: 14956,
+    vcg: 14957,
+    vch: 14958,
+    vci: 14959,
+    vcj: 14960,
+    vck: 14961,
+    vcl: 14962,
+    vcm: 14963,
+    vcn: 14964,
+    vco: 14965,
+    vcp: 14966,
+    vcq: 14967,
+    vcr: 14968,
+    vcs: 14969,
+    vct: 14970,
+    vcu: 14971,
+    vcv: 14972,
+    vcw: 14973,
+    vcx: 14974,
+    vcy: 14975,
+    vdz: 14976,
+    vda: 14977,
+    vdb: 14978,
+    vdc: 14979,
+    vdd: 14980,
+    vde: 14981,
+    vdf: 14982,
+    vdg: 14983,
+    vdh: 14984,
+    vdi: 14985,
+    vdj: 14986,
+    vdk: 14987,
+    vdl: 14988,
+    vdm: 14989,
+    vdn: 14990,
+    vdo: 14991,
+    vdp: 14992,
+    vdq: 14993,
+    vdr: 14994,
+    vds: 14995,
+    vdt: 14996,
+    vdu: 14997,
+    vdv: 14998,
+    vdw: 14999,
+    vdx: 15000,
+    vdy: 15001,
+    vez: 15002,
+    vea: 15003,
+    veb: 15004,
+    vec: 15005,
+    ved: 15006,
+    vee: 15007,
+    vef: 15008,
+    veg: 15009,
+    veh: 15010,
+    vei: 15011,
+    vej: 15012,
+    vek: 15013,
+    vel: 15014,
+    vem: 15015,
+    ven: 15016,
+    veo: 15017,
+    vep: 15018,
+    veq: 15019,
+    ver: 15020,
+    ves: 15021,
+    vet: 15022,
+    veu: 15023,
+    vev: 15024,
+    vew: 15025,
+    vex: 15026,
+    vey: 15027,
+    vfz: 15028,
+    vfa: 15029,
+    vfb: 15030,
+    vfc: 15031,
+    vfd: 15032,
+    vfe: 15033,
+    vff: 15034,
+    vfg: 15035,
+    vfh: 15036,
+    vfi: 15037,
+    vfj: 15038,
+    vfk: 15039,
+    vfl: 15040,
+    vfm: 15041,
+    vfn: 15042,
+    vfo: 15043,
+    vfp: 15044,
+    vfq: 15045,
+    vfr: 15046,
+    vfs: 15047,
+    vft: 15048,
+    vfu: 15049,
+    vfv: 15050,
+    vfw: 15051,
+    vfx: 15052,
+    vfy: 15053,
+    vgz: 15054,
+    vga: 15055,
+    vgb: 15056,
+    vgc: 15057,
+    vgd: 15058,
+    vge: 15059,
+    vgf: 15060,
+    vgg: 15061,
+    vgh: 15062,
+    vgi: 15063,
+    vgj: 15064,
+    vgk: 15065,
+    vgl: 15066,
+    vgm: 15067,
+    vgn: 15068,
+    vgo: 15069,
+    vgp: 15070,
+    vgq: 15071,
+    vgr: 15072,
+    vgs: 15073,
+    vgt: 15074,
+    vgu: 15075,
+    vgv: 15076,
+    vgw: 15077,
+    vgx: 15078,
+    vgy: 15079,
+    vhz: 15080,
+    vha: 15081,
+    vhb: 15082,
+    vhc: 15083,
+    vhd: 15084,
+    vhe: 15085,
+    vhf: 15086,
+    vhg: 15087,
+    vhh: 15088,
+    vhi: 15089,
+    vhj: 15090,
+    vhk: 15091,
+    vhl: 15092,
+    vhm: 15093,
+    vhn: 15094,
+    vho: 15095,
+    vhp: 15096,
+    vhq: 15097,
+    vhr: 15098,
+    vhs: 15099,
+    vht: 15100,
+    vhu: 15101,
+    vhv: 15102,
+    vhw: 15103,
+    vhx: 15104,
+    vhy: 15105,
+    viz: 15106,
+    via: 15107,
+    vib: 15108,
+    vic: 15109,
+    vid: 15110,
+    vie: 15111,
+    vif: 15112,
+    vig: 15113,
+    vih: 15114,
+    vii: 15115,
+    vij: 15116,
+    vik: 15117,
+    vil: 15118,
+    vim: 15119,
+    vin: 15120,
+    vio: 15121,
+    vip: 15122,
+    viq: 15123,
+    vir: 15124,
+    vis: 15125,
+    vit: 15126,
+    viu: 15127,
+    viv: 15128,
+    viw: 15129,
+    vix: 15130,
+    viy: 15131,
+    vjz: 15132,
+    vja: 15133,
+    vjb: 15134,
+    vjc: 15135,
+    vjd: 15136,
+    vje: 15137,
+    vjf: 15138,
+    vjg: 15139,
+    vjh: 15140,
+    vji: 15141,
+    vjj: 15142,
+    vjk: 15143,
+    vjl: 15144,
+    vjm: 15145,
+    vjn: 15146,
+    vjo: 15147,
+    vjp: 15148,
+    vjq: 15149,
+    vjr: 15150,
+    vjs: 15151,
+    vjt: 15152,
+    vju: 15153,
+    vjv: 15154,
+    vjw: 15155,
+    vjx: 15156,
+    vjy: 15157,
+    vkz: 15158,
+    vka: 15159,
+    vkb: 15160,
+    vkc: 15161,
+    vkd: 15162,
+    vke: 15163,
+    vkf: 15164,
+    vkg: 15165,
+    vkh: 15166,
+    vki: 15167,
+    vkj: 15168,
+    vkk: 15169,
+    vkl: 15170,
+    vkm: 15171,
+    vkn: 15172,
+    vko: 15173,
+    vkp: 15174,
+    vkq: 15175,
+    vkr: 15176,
+    vks: 15177,
+    vkt: 15178,
+    vku: 15179,
+    vkv: 15180,
+    vkw: 15181,
+    vkx: 15182,
+    vky: 15183,
+    vlz: 15184,
+    vla: 15185,
+    vlb: 15186,
+    vlc: 15187,
+    vld: 15188,
+    vle: 15189,
+    vlf: 15190,
+    vlg: 15191,
+    vlh: 15192,
+    vli: 15193,
+    vlj: 15194,
+    vlk: 15195,
+    vll: 15196,
+    vlm: 15197,
+    vln: 15198,
+    vlo: 15199,
+    vlp: 15200,
+    vlq: 15201,
+    vlr: 15202,
+    vls: 15203,
+    vlt: 15204,
+    vlu: 15205,
+    vlv: 15206,
+    vlw: 15207,
+    vlx: 15208,
+    vly: 15209,
+    vmz: 15210,
+    vma: 15211,
+    vmb: 15212,
+    vmc: 15213,
+    vmd: 15214,
+    vme: 15215,
+    vmf: 15216,
+    vmg: 15217,
+    vmh: 15218,
+    vmi: 15219,
+    vmj: 15220,
+    vmk: 15221,
+    vml: 15222,
+    vmm: 15223,
+    vmn: 15224,
+    vmo: 15225,
+    vmp: 15226,
+    vmq: 15227,
+    vmr: 15228,
+    vms: 15229,
+    vmt: 15230,
+    vmu: 15231,
+    vmv: 15232,
+    vmw: 15233,
+    vmx: 15234,
+    vmy: 15235,
+    vnz: 15236,
+    vna: 15237,
+    vnb: 15238,
+    vnc: 15239,
+    vnd: 15240,
+    vne: 15241,
+    vnf: 15242,
+    vng: 15243,
+    vnh: 15244,
+    vni: 15245,
+    vnj: 15246,
+    vnk: 15247,
+    vnl: 15248,
+    vnm: 15249,
+    vnn: 15250,
+    vno: 15251,
+    vnp: 15252,
+    vnq: 15253,
+    vnr: 15254,
+    vns: 15255,
+    vnt: 15256,
+    vnu: 15257,
+    vnv: 15258,
+    vnw: 15259,
+    vnx: 15260,
+    vny: 15261,
+    voz: 15262,
+    voa: 15263,
+    vob: 15264,
+    voc: 15265,
+    vod: 15266,
+    voe: 15267,
+    vof: 15268,
+    vog: 15269,
+    voh: 15270,
+    voi: 15271,
+    voj: 15272,
+    vok: 15273,
+    vol: 15274,
+    vom: 15275,
+    von: 15276,
+    voo: 15277,
+    vop: 15278,
+    voq: 15279,
+    vor: 15280,
+    vos: 15281,
+    vot: 15282,
+    vou: 15283,
+    vov: 15284,
+    vow: 15285,
+    vox: 15286,
+    voy: 15287,
+    vpz: 15288,
+    vpa: 15289,
+    vpb: 15290,
+    vpc: 15291,
+    vpd: 15292,
+    vpe: 15293,
+    vpf: 15294,
+    vpg: 15295,
+    vph: 15296,
+    vpi: 15297,
+    vpj: 15298,
+    vpk: 15299,
+    vpl: 15300,
+    vpm: 15301,
+    vpn: 15302,
+    vpo: 15303,
+    vpp: 15304,
+    vpq: 15305,
+    vpr: 15306,
+    vps: 15307,
+    vpt: 15308,
+    vpu: 15309,
+    vpv: 15310,
+    vpw: 15311,
+    vpx: 15312,
+    vpy: 15313,
+    vqz: 15314,
+    vqa: 15315,
+    vqb: 15316,
+    vqc: 15317,
+    vqd: 15318,
+    vqe: 15319,
+    vqf: 15320,
+    vqg: 15321,
+    vqh: 15322,
+    vqi: 15323,
+    vqj: 15324,
+    vqk: 15325,
+    vql: 15326,
+    vqm: 15327,
+    vqn: 15328,
+    vqo: 15329,
+    vqp: 15330,
+    vqq: 15331,
+    vqr: 15332,
+    vqs: 15333,
+    vqt: 15334,
+    vqu: 15335,
+    vqv: 15336,
+    vqw: 15337,
+    vqx: 15338,
+    vqy: 15339,
+    vrz: 15340,
+    vra: 15341,
+    vrb: 15342,
+    vrc: 15343,
+    vrd: 15344,
+    vre: 15345,
+    vrf: 15346,
+    vrg: 15347,
+    vrh: 15348,
+    vri: 15349,
+    vrj: 15350,
+    vrk: 15351,
+    vrl: 15352,
+    vrm: 15353,
+    vrn: 15354,
+    vro: 15355,
+    vrp: 15356,
+    vrq: 15357,
+    vrr: 15358,
+    vrs: 15359,
+    vrt: 15360,
+    vru: 15361,
+    vrv: 15362,
+    vrw: 15363,
+    vrx: 15364,
+    vry: 15365,
+    vsz: 15366,
+    vsa: 15367,
+    vsb: 15368,
+    vsc: 15369,
+    vsd: 15370,
+    vse: 15371,
+    vsf: 15372,
+    vsg: 15373,
+    vsh: 15374,
+    vsi: 15375,
+    vsj: 15376,
+    vsk: 15377,
+    vsl: 15378,
+    vsm: 15379,
+    vsn: 15380,
+    vso: 15381,
+    vsp: 15382,
+    vsq: 15383,
+    vsr: 15384,
+    vss: 15385,
+    vst: 15386,
+    vsu: 15387,
+    vsv: 15388,
+    vsw: 15389,
+    vsx: 15390,
+    vsy: 15391,
+    vtz: 15392,
+    vta: 15393,
+    vtb: 15394,
+    vtc: 15395,
+    vtd: 15396,
+    vte: 15397,
+    vtf: 15398,
+    vtg: 15399,
+    vth: 15400,
+    vti: 15401,
+    vtj: 15402,
+    vtk: 15403,
+    vtl: 15404,
+    vtm: 15405,
+    vtn: 15406,
+    vto: 15407,
+    vtp: 15408,
+    vtq: 15409,
+    vtr: 15410,
+    vts: 15411,
+    vtt: 15412,
+    vtu: 15413,
+    vtv: 15414,
+    vtw: 15415,
+    vtx: 15416,
+    vty: 15417,
+    vuz: 15418,
+    vua: 15419,
+    vub: 15420,
+    vuc: 15421,
+    vud: 15422,
+    vue: 15423,
+    vuf: 15424,
+    vug: 15425,
+    vuh: 15426,
+    vui: 15427,
+    vuj: 15428,
+    vuk: 15429,
+    vul: 15430,
+    vum: 15431,
+    vun: 15432,
+    vuo: 15433,
+    vup: 15434,
+    vuq: 15435,
+    vur: 15436,
+    vus: 15437,
+    vut: 15438,
+    vuu: 15439,
+    vuv: 15440,
+    vuw: 15441,
+    vux: 15442,
+    vuy: 15443,
+    vvz: 15444,
+    vva: 15445,
+    vvb: 15446,
+    vvc: 15447,
+    vvd: 15448,
+    vve: 15449,
+    vvf: 15450,
+    vvg: 15451,
+    vvh: 15452,
+    vvi: 15453,
+    vvj: 15454,
+    vvk: 15455,
+    vvl: 15456,
+    vvm: 15457,
+    vvn: 15458,
+    vvo: 15459,
+    vvp: 15460,
+    vvq: 15461,
+    vvr: 15462,
+    vvs: 15463,
+    vvt: 15464,
+    vvu: 15465,
+    vvv: 15466,
+    vvw: 15467,
+    vvx: 15468,
+    vvy: 15469,
+    vwz: 15470,
+    vwa: 15471,
+    vwb: 15472,
+    vwc: 15473,
+    vwd: 15474,
+    vwe: 15475,
+    vwf: 15476,
+    vwg: 15477,
+    vwh: 15478,
+    vwi: 15479,
+    vwj: 15480,
+    vwk: 15481,
+    vwl: 15482,
+    vwm: 15483,
+    vwn: 15484,
+    vwo: 15485,
+    vwp: 15486,
+    vwq: 15487,
+    vwr: 15488,
+    vws: 15489,
+    vwt: 15490,
+    vwu: 15491,
+    vwv: 15492,
+    vww: 15493,
+    vwx: 15494,
+    vwy: 15495,
+    vxz: 15496,
+    vxa: 15497,
+    vxb: 15498,
+    vxc: 15499,
+    vxd: 15500,
+    vxe: 15501,
+    vxf: 15502,
+    vxg: 15503,
+    vxh: 15504,
+    vxi: 15505,
+    vxj: 15506,
+    vxk: 15507,
+    vxl: 15508,
+    vxm: 15509,
+    vxn: 15510,
+    vxo: 15511,
+    vxp: 15512,
+    vxq: 15513,
+    vxr: 15514,
+    vxs: 15515,
+    vxt: 15516,
+    vxu: 15517,
+    vxv: 15518,
+    vxw: 15519,
+    vxx: 15520,
+    vxy: 15521,
+    vyz: 15522,
+    vya: 15523,
+    vyb: 15524,
+    vyc: 15525,
+    vyd: 15526,
+    vye: 15527,
+    vyf: 15528,
+    vyg: 15529,
+    vyh: 15530,
+    vyi: 15531,
+    vyj: 15532,
+    vyk: 15533,
+    vyl: 15534,
+    vym: 15535,
+    vyn: 15536,
+    vyo: 15537,
+    vyp: 15538,
+    vyq: 15539,
+    vyr: 15540,
+    vys: 15541,
+    vyt: 15542,
+    vyu: 15543,
+    vyv: 15544,
+    vyw: 15545,
+    vyx: 15546,
+    vyy: 15547,
+    wzz: 15548,
+    wza: 15549,
+    wzb: 15550,
+    wzc: 15551,
+    wzd: 15552,
+    wze: 15553,
+    wzf: 15554,
+    wzg: 15555,
+    wzh: 15556,
+    wzi: 15557,
+    wzj: 15558,
+    wzk: 15559,
+    wzl: 15560,
+    wzm: 15561,
+    wzn: 15562,
+    wzo: 15563,
+    wzp: 15564,
+    wzq: 15565,
+    wzr: 15566,
+    wzs: 15567,
+    wzt: 15568,
+    wzu: 15569,
+    wzv: 15570,
+    wzw: 15571,
+    wzx: 15572,
+    wzy: 15573,
+    waz: 15574,
+    waa: 15575,
+    wab: 15576,
+    wac: 15577,
+    wad: 15578,
+    wae: 15579,
+    waf: 15580,
+    wag: 15581,
+    wah: 15582,
+    wai: 15583,
+    waj: 15584,
+    wak: 15585,
+    wal: 15586,
+    wam: 15587,
+    wan: 15588,
+    wao: 15589,
+    wap: 15590,
+    waq: 15591,
+    war: 15592,
+    was: 15593,
+    wat: 15594,
+    wau: 15595,
+    wav: 15596,
+    waw: 15597,
+    wax: 15598,
+    way: 15599,
+    wbz: 15600,
+    wba: 15601,
+    wbb: 15602,
+    wbc: 15603,
+    wbd: 15604,
+    wbe: 15605,
+    wbf: 15606,
+    wbg: 15607,
+    wbh: 15608,
+    wbi: 15609,
+    wbj: 15610,
+    wbk: 15611,
+    wbl: 15612,
+    wbm: 15613,
+    wbn: 15614,
+    wbo: 15615,
+    wbp: 15616,
+    wbq: 15617,
+    wbr: 15618,
+    wbs: 15619,
+    wbt: 15620,
+    wbu: 15621,
+    wbv: 15622,
+    wbw: 15623,
+    wbx: 15624,
+    wby: 15625,
+    wcz: 15626,
+    wca: 15627,
+    wcb: 15628,
+    wcc: 15629,
+    wcd: 15630,
+    wce: 15631,
+    wcf: 15632,
+    wcg: 15633,
+    wch: 15634,
+    wci: 15635,
+    wcj: 15636,
+    wck: 15637,
+    wcl: 15638,
+    wcm: 15639,
+    wcn: 15640,
+    wco: 15641,
+    wcp: 15642,
+    wcq: 15643,
+    wcr: 15644,
+    wcs: 15645,
+    wct: 15646,
+    wcu: 15647,
+    wcv: 15648,
+    wcw: 15649,
+    wcx: 15650,
+    wcy: 15651,
+    wdz: 15652,
+    wda: 15653,
+    wdb: 15654,
+    wdc: 15655,
+    wdd: 15656,
+    wde: 15657,
+    wdf: 15658,
+    wdg: 15659,
+    wdh: 15660,
+    wdi: 15661,
+    wdj: 15662,
+    wdk: 15663,
+    wdl: 15664,
+    wdm: 15665,
+    wdn: 15666,
+    wdo: 15667,
+    wdp: 15668,
+    wdq: 15669,
+    wdr: 15670,
+    wds: 15671,
+    wdt: 15672,
+    wdu: 15673,
+    wdv: 15674,
+    wdw: 15675,
+    wdx: 15676,
+    wdy: 15677,
+    wez: 15678,
+    wea: 15679,
+    web: 15680,
+    wec: 15681,
+    wed: 15682,
+    wee: 15683,
+    wef: 15684,
+    weg: 15685,
+    weh: 15686,
+    wei: 15687,
+    wej: 15688,
+    wek: 15689,
+    wel: 15690,
+    wem: 15691,
+    wen: 15692,
+    weo: 15693,
+    wep: 15694,
+    weq: 15695,
+    wer: 15696,
+    wes: 15697,
+    wet: 15698,
+    weu: 15699,
+    wev: 15700,
+    wew: 15701,
+    wex: 15702,
+    wey: 15703,
+    wfz: 15704,
+    wfa: 15705,
+    wfb: 15706,
+    wfc: 15707,
+    wfd: 15708,
+    wfe: 15709,
+    wff: 15710,
+    wfg: 15711,
+    wfh: 15712,
+    wfi: 15713,
+    wfj: 15714,
+    wfk: 15715,
+    wfl: 15716,
+    wfm: 15717,
+    wfn: 15718,
+    wfo: 15719,
+    wfp: 15720,
+    wfq: 15721,
+    wfr: 15722,
+    wfs: 15723,
+    wft: 15724,
+    wfu: 15725,
+    wfv: 15726,
+    wfw: 15727,
+    wfx: 15728,
+    wfy: 15729,
+    wgz: 15730,
+    wga: 15731,
+    wgb: 15732,
+    wgc: 15733,
+    wgd: 15734,
+    wge: 15735,
+    wgf: 15736,
+    wgg: 15737,
+    wgh: 15738,
+    wgi: 15739,
+    wgj: 15740,
+    wgk: 15741,
+    wgl: 15742,
+    wgm: 15743,
+    wgn: 15744,
+    wgo: 15745,
+    wgp: 15746,
+    wgq: 15747,
+    wgr: 15748,
+    wgs: 15749,
+    wgt: 15750,
+    wgu: 15751,
+    wgv: 15752,
+    wgw: 15753,
+    wgx: 15754,
+    wgy: 15755,
+    whz: 15756,
+    wha: 15757,
+    whb: 15758,
+    whc: 15759,
+    whd: 15760,
+    whe: 15761,
+    whf: 15762,
+    whg: 15763,
+    whh: 15764,
+    whi: 15765,
+    whj: 15766,
+    whk: 15767,
+    whl: 15768,
+    whm: 15769,
+    whn: 15770,
+    who: 15771,
+    whp: 15772,
+    whq: 15773,
+    whr: 15774,
+    whs: 15775,
+    wht: 15776,
+    whu: 15777,
+    whv: 15778,
+    whw: 15779,
+    whx: 15780,
+    why: 15781,
+    wiz: 15782,
+    wia: 15783,
+    wib: 15784,
+    wic: 15785,
+    wid: 15786,
+    wie: 15787,
+    wif: 15788,
+    wig: 15789,
+    wih: 15790,
+    wii: 15791,
+    wij: 15792,
+    wik: 15793,
+    wil: 15794,
+    wim: 15795,
+    win: 15796,
+    wio: 15797,
+    wip: 15798,
+    wiq: 15799,
+    wir: 15800,
+    wis: 15801,
+    wit: 15802,
+    wiu: 15803,
+    wiv: 15804,
+    wiw: 15805,
+    wix: 15806,
+    wiy: 15807,
+    wjz: 15808,
+    wja: 15809,
+    wjb: 15810,
+    wjc: 15811,
+    wjd: 15812,
+    wje: 15813,
+    wjf: 15814,
+    wjg: 15815,
+    wjh: 15816,
+    wji: 15817,
+    wjj: 15818,
+    wjk: 15819,
+    wjl: 15820,
+    wjm: 15821,
+    wjn: 15822,
+    wjo: 15823,
+    wjp: 15824,
+    wjq: 15825,
+    wjr: 15826,
+    wjs: 15827,
+    wjt: 15828,
+    wju: 15829,
+    wjv: 15830,
+    wjw: 15831,
+    wjx: 15832,
+    wjy: 15833,
+    wkz: 15834,
+    wka: 15835,
+    wkb: 15836,
+    wkc: 15837,
+    wkd: 15838,
+    wke: 15839,
+    wkf: 15840,
+    wkg: 15841,
+    wkh: 15842,
+    wki: 15843,
+    wkj: 15844,
+    wkk: 15845,
+    wkl: 15846,
+    wkm: 15847,
+    wkn: 15848,
+    wko: 15849,
+    wkp: 15850,
+    wkq: 15851,
+    wkr: 15852,
+    wks: 15853,
+    wkt: 15854,
+    wku: 15855,
+    wkv: 15856,
+    wkw: 15857,
+    wkx: 15858,
+    wky: 15859,
+    wlz: 15860,
+    wla: 15861,
+    wlb: 15862,
+    wlc: 15863,
+    wld: 15864,
+    wle: 15865,
+    wlf: 15866,
+    wlg: 15867,
+    wlh: 15868,
+    wli: 15869,
+    wlj: 15870,
+    wlk: 15871,
+    wll: 15872,
+    wlm: 15873,
+    wln: 15874,
+    wlo: 15875,
+    wlp: 15876,
+    wlq: 15877,
+    wlr: 15878,
+    wls: 15879,
+    wlt: 15880,
+    wlu: 15881,
+    wlv: 15882,
+    wlw: 15883,
+    wlx: 15884,
+    wly: 15885,
+    wmz: 15886,
+    wma: 15887,
+    wmb: 15888,
+    wmc: 15889,
+    wmd: 15890,
+    wme: 15891,
+    wmf: 15892,
+    wmg: 15893,
+    wmh: 15894,
+    wmi: 15895,
+    wmj: 15896,
+    wmk: 15897,
+    wml: 15898,
+    wmm: 15899,
+    wmn: 15900,
+    wmo: 15901,
+    wmp: 15902,
+    wmq: 15903,
+    wmr: 15904,
+    wms: 15905,
+    wmt: 15906,
+    wmu: 15907,
+    wmv: 15908,
+    wmw: 15909,
+    wmx: 15910,
+    wmy: 15911,
+    wnz: 15912,
+    wna: 15913,
+    wnb: 15914,
+    wnc: 15915,
+    wnd: 15916,
+    wne: 15917,
+    wnf: 15918,
+    wng: 15919,
+    wnh: 15920,
+    wni: 15921,
+    wnj: 15922,
+    wnk: 15923,
+    wnl: 15924,
+    wnm: 15925,
+    wnn: 15926,
+    wno: 15927,
+    wnp: 15928,
+    wnq: 15929,
+    wnr: 15930,
+    wns: 15931,
+    wnt: 15932,
+    wnu: 15933,
+    wnv: 15934,
+    wnw: 15935,
+    wnx: 15936,
+    wny: 15937,
+    woz: 15938,
+    woa: 15939,
+    wob: 15940,
+    woc: 15941,
+    wod: 15942,
+    woe: 15943,
+    wof: 15944,
+    wog: 15945,
+    woh: 15946,
+    woi: 15947,
+    woj: 15948,
+    wok: 15949,
+    wol: 15950,
+    wom: 15951,
+    won: 15952,
+    woo: 15953,
+    wop: 15954,
+    woq: 15955,
+    wor: 15956,
+    wos: 15957,
+    wot: 15958,
+    wou: 15959,
+    wov: 15960,
+    wow: 15961,
+    wox: 15962,
+    woy: 15963,
+    wpz: 15964,
+    wpa: 15965,
+    wpb: 15966,
+    wpc: 15967,
+    wpd: 15968,
+    wpe: 15969,
+    wpf: 15970,
+    wpg: 15971,
+    wph: 15972,
+    wpi: 15973,
+    wpj: 15974,
+    wpk: 15975,
+    wpl: 15976,
+    wpm: 15977,
+    wpn: 15978,
+    wpo: 15979,
+    wpp: 15980,
+    wpq: 15981,
+    wpr: 15982,
+    wps: 15983,
+    wpt: 15984,
+    wpu: 15985,
+    wpv: 15986,
+    wpw: 15987,
+    wpx: 15988,
+    wpy: 15989,
+    wqz: 15990,
+    wqa: 15991,
+    wqb: 15992,
+    wqc: 15993,
+    wqd: 15994,
+    wqe: 15995,
+    wqf: 15996,
+    wqg: 15997,
+    wqh: 15998,
+    wqi: 15999,
+    wqj: 16000,
+    wqk: 16001,
+    wql: 16002,
+    wqm: 16003,
+    wqn: 16004,
+    wqo: 16005,
+    wqp: 16006,
+    wqq: 16007,
+    wqr: 16008,
+    wqs: 16009,
+    wqt: 16010,
+    wqu: 16011,
+    wqv: 16012,
+    wqw: 16013,
+    wqx: 16014,
+    wqy: 16015,
+    wrz: 16016,
+    wra: 16017,
+    wrb: 16018,
+    wrc: 16019,
+    wrd: 16020,
+    wre: 16021,
+    wrf: 16022,
+    wrg: 16023,
+    wrh: 16024,
+    wri: 16025,
+    wrj: 16026,
+    wrk: 16027,
+    wrl: 16028,
+    wrm: 16029,
+    wrn: 16030,
+    wro: 16031,
+    wrp: 16032,
+    wrq: 16033,
+    wrr: 16034,
+    wrs: 16035,
+    wrt: 16036,
+    wru: 16037,
+    wrv: 16038,
+    wrw: 16039,
+    wrx: 16040,
+    wry: 16041,
+    wsz: 16042,
+    wsa: 16043,
+    wsb: 16044,
+    wsc: 16045,
+    wsd: 16046,
+    wse: 16047,
+    wsf: 16048,
+    wsg: 16049,
+    wsh: 16050,
+    wsi: 16051,
+    wsj: 16052,
+    wsk: 16053,
+    wsl: 16054,
+    wsm: 16055,
+    wsn: 16056,
+    wso: 16057,
+    wsp: 16058,
+    wsq: 16059,
+    wsr: 16060,
+    wss: 16061,
+    wst: 16062,
+    wsu: 16063,
+    wsv: 16064,
+    wsw: 16065,
+    wsx: 16066,
+    wsy: 16067,
+    wtz: 16068,
+    wta: 16069,
+    wtb: 16070,
+    wtc: 16071,
+    wtd: 16072,
+    wte: 16073,
+    wtf: 16074,
+    wtg: 16075,
+    wth: 16076,
+    wti: 16077,
+    wtj: 16078,
+    wtk: 16079,
+    wtl: 16080,
+    wtm: 16081,
+    wtn: 16082,
+    wto: 16083,
+    wtp: 16084,
+    wtq: 16085,
+    wtr: 16086,
+    wts: 16087,
+    wtt: 16088,
+    wtu: 16089,
+    wtv: 16090,
+    wtw: 16091,
+    wtx: 16092,
+    wty: 16093,
+    wuz: 16094,
+    wua: 16095,
+    wub: 16096,
+    wuc: 16097,
+    wud: 16098,
+    wue: 16099,
+    wuf: 16100,
+    wug: 16101,
+    wuh: 16102,
+    wui: 16103,
+    wuj: 16104,
+    wuk: 16105,
+    wul: 16106,
+    wum: 16107,
+    wun: 16108,
+    wuo: 16109,
+    wup: 16110,
+    wuq: 16111,
+    wur: 16112,
+    wus: 16113,
+    wut: 16114,
+    wuu: 16115,
+    wuv: 16116,
+    wuw: 16117,
+    wux: 16118,
+    wuy: 16119,
+    wvz: 16120,
+    wva: 16121,
+    wvb: 16122,
+    wvc: 16123,
+    wvd: 16124,
+    wve: 16125,
+    wvf: 16126,
+    wvg: 16127,
+    wvh: 16128,
+    wvi: 16129,
+    wvj: 16130,
+    wvk: 16131,
+    wvl: 16132,
+    wvm: 16133,
+    wvn: 16134,
+    wvo: 16135,
+    wvp: 16136,
+    wvq: 16137,
+    wvr: 16138,
+    wvs: 16139,
+    wvt: 16140,
+    wvu: 16141,
+    wvv: 16142,
+    wvw: 16143,
+    wvx: 16144,
+    wvy: 16145,
+    wwz: 16146,
+    wwa: 16147,
+    wwb: 16148,
+    wwc: 16149,
+    wwd: 16150,
+    wwe: 16151,
+    wwf: 16152,
+    wwg: 16153,
+    wwh: 16154,
+    wwi: 16155,
+    wwj: 16156,
+    wwk: 16157,
+    wwl: 16158,
+    wwm: 16159,
+    wwn: 16160,
+    wwo: 16161,
+    wwp: 16162,
+    wwq: 16163,
+    wwr: 16164,
+    wws: 16165,
+    wwt: 16166,
+    wwu: 16167,
+    wwv: 16168,
+    www: 16169,
+    wwx: 16170,
+    wwy: 16171,
+    wxz: 16172,
+    wxa: 16173,
+    wxb: 16174,
+    wxc: 16175,
+    wxd: 16176,
+    wxe: 16177,
+    wxf: 16178,
+    wxg: 16179,
+    wxh: 16180,
+    wxi: 16181,
+    wxj: 16182,
+    wxk: 16183,
+    wxl: 16184,
+    wxm: 16185,
+    wxn: 16186,
+    wxo: 16187,
+    wxp: 16188,
+    wxq: 16189,
+    wxr: 16190,
+    wxs: 16191,
+    wxt: 16192,
+    wxu: 16193,
+    wxv: 16194,
+    wxw: 16195,
+    wxx: 16196,
+    wxy: 16197,
+    wyz: 16198,
+    wya: 16199,
+    wyb: 16200,
+    wyc: 16201,
+    wyd: 16202,
+    wye: 16203,
+    wyf: 16204,
+    wyg: 16205,
+    wyh: 16206,
+    wyi: 16207,
+    wyj: 16208,
+    wyk: 16209,
+    wyl: 16210,
+    wym: 16211,
+    wyn: 16212,
+    wyo: 16213,
+    wyp: 16214,
+    wyq: 16215,
+    wyr: 16216,
+    wys: 16217,
+    wyt: 16218,
+    wyu: 16219,
+    wyv: 16220,
+    wyw: 16221,
+    wyx: 16222,
+    wyy: 16223,
+    xzz: 16224,
+    xza: 16225,
+    xzb: 16226,
+    xzc: 16227,
+    xzd: 16228,
+    xze: 16229,
+    xzf: 16230,
+    xzg: 16231,
+    xzh: 16232,
+    xzi: 16233,
+    xzj: 16234,
+    xzk: 16235,
+    xzl: 16236,
+    xzm: 16237,
+    xzn: 16238,
+    xzo: 16239,
+    xzp: 16240,
+    xzq: 16241,
+    xzr: 16242,
+    xzs: 16243,
+    xzt: 16244,
+    xzu: 16245,
+    xzv: 16246,
+    xzw: 16247,
+    xzx: 16248,
+    xzy: 16249,
+    xaz: 16250,
+    xaa: 16251,
+    xab: 16252,
+    xac: 16253,
+    xad: 16254,
+    xae: 16255,
+    xaf: 16256,
+    xag: 16257,
+    xah: 16258,
+    xai: 16259,
+    xaj: 16260,
+    xak: 16261,
+    xal: 16262,
+    xam: 16263,
+    xan: 16264,
+    xao: 16265,
+    xap: 16266,
+    xaq: 16267,
+    xar: 16268,
+    xas: 16269,
+    xat: 16270,
+    xau: 16271,
+    xav: 16272,
+    xaw: 16273,
+    xax: 16274,
+    xay: 16275,
+    xbz: 16276,
+    xba: 16277,
+    xbb: 16278,
+    xbc: 16279,
+    xbd: 16280,
+    xbe: 16281,
+    xbf: 16282,
+    xbg: 16283,
+    xbh: 16284,
+    xbi: 16285,
+    xbj: 16286,
+    xbk: 16287,
+    xbl: 16288,
+    xbm: 16289,
+    xbn: 16290,
+    xbo: 16291,
+    xbp: 16292,
+    xbq: 16293,
+    xbr: 16294,
+    xbs: 16295,
+    xbt: 16296,
+    xbu: 16297,
+    xbv: 16298,
+    xbw: 16299,
+    xbx: 16300,
+    xby: 16301,
+    xcz: 16302,
+    xca: 16303,
+    xcb: 16304,
+    xcc: 16305,
+    xcd: 16306,
+    xce: 16307,
+    xcf: 16308,
+    xcg: 16309,
+    xch: 16310,
+    xci: 16311,
+    xcj: 16312,
+    xck: 16313,
+    xcl: 16314,
+    xcm: 16315,
+    xcn: 16316,
+    xco: 16317,
+    xcp: 16318,
+    xcq: 16319,
+    xcr: 16320,
+    xcs: 16321,
+    xct: 16322,
+    xcu: 16323,
+    xcv: 16324,
+    xcw: 16325,
+    xcx: 16326,
+    xcy: 16327,
+    xdz: 16328,
+    xda: 16329,
+    xdb: 16330,
+    xdc: 16331,
+    xdd: 16332,
+    xde: 16333,
+    xdf: 16334,
+    xdg: 16335,
+    xdh: 16336,
+    xdi: 16337,
+    xdj: 16338,
+    xdk: 16339,
+    xdl: 16340,
+    xdm: 16341,
+    xdn: 16342,
+    xdo: 16343,
+    xdp: 16344,
+    xdq: 16345,
+    xdr: 16346,
+    xds: 16347,
+    xdt: 16348,
+    xdu: 16349,
+    xdv: 16350,
+    xdw: 16351,
+    xdx: 16352,
+    xdy: 16353,
+    xez: 16354,
+    xea: 16355,
+    xeb: 16356,
+    xec: 16357,
+    xed: 16358,
+    xee: 16359,
+    xef: 16360,
+    xeg: 16361,
+    xeh: 16362,
+    xei: 16363,
+    xej: 16364,
+    xek: 16365,
+    xel: 16366,
+    xem: 16367,
+    xen: 16368,
+    xeo: 16369,
+    xep: 16370,
+    xeq: 16371,
+    xer: 16372,
+    xes: 16373,
+    xet: 16374,
+    xeu: 16375,
+    xev: 16376,
+    xew: 16377,
+    xex: 16378,
+    xey: 16379,
+    xfz: 16380,
+    xfa: 16381,
+    xfb: 16382,
+    xfc: 16383,
+    xfd: 16384,
+    xfe: 16385,
+    xff: 16386,
+    xfg: 16387,
+    xfh: 16388,
+    xfi: 16389,
+    xfj: 16390,
+    xfk: 16391,
+    xfl: 16392,
+    xfm: 16393,
+    xfn: 16394,
+    xfo: 16395,
+    xfp: 16396,
+    xfq: 16397,
+    xfr: 16398,
+    xfs: 16399,
+    xft: 16400,
+    xfu: 16401,
+    xfv: 16402,
+    xfw: 16403,
+    xfx: 16404,
+    xfy: 16405,
+    xgz: 16406,
+    xga: 16407,
+    xgb: 16408,
+    xgc: 16409,
+    xgd: 16410,
+    xge: 16411,
+    xgf: 16412,
+    xgg: 16413,
+    xgh: 16414,
+    xgi: 16415,
+    xgj: 16416,
+    xgk: 16417,
+    xgl: 16418,
+    xgm: 16419,
+    xgn: 16420,
+    xgo: 16421,
+    xgp: 16422,
+    xgq: 16423,
+    xgr: 16424,
+    xgs: 16425,
+    xgt: 16426,
+    xgu: 16427,
+    xgv: 16428,
+    xgw: 16429,
+    xgx: 16430,
+    xgy: 16431,
+    xhz: 16432,
+    xha: 16433,
+    xhb: 16434,
+    xhc: 16435,
+    xhd: 16436,
+    xhe: 16437,
+    xhf: 16438,
+    xhg: 16439,
+    xhh: 16440,
+    xhi: 16441,
+    xhj: 16442,
+    xhk: 16443,
+    xhl: 16444,
+    xhm: 16445,
+    xhn: 16446,
+    xho: 16447,
+    xhp: 16448,
+    xhq: 16449,
+    xhr: 16450,
+    xhs: 16451,
+    xht: 16452,
+    xhu: 16453,
+    xhv: 16454,
+    xhw: 16455,
+    xhx: 16456,
+    xhy: 16457,
+    xiz: 16458,
+    xia: 16459,
+    xib: 16460,
+    xic: 16461,
+    xid: 16462,
+    xie: 16463,
+    xif: 16464,
+    xig: 16465,
+    xih: 16466,
+    xii: 16467,
+    xij: 16468,
+    xik: 16469,
+    xil: 16470,
+    xim: 16471,
+    xin: 16472,
+    xio: 16473,
+    xip: 16474,
+    xiq: 16475,
+    xir: 16476,
+    xis: 16477,
+    xit: 16478,
+    xiu: 16479,
+    xiv: 16480,
+    xiw: 16481,
+    xix: 16482,
+    xiy: 16483,
+    xjz: 16484,
+    xja: 16485,
+    xjb: 16486,
+    xjc: 16487,
+    xjd: 16488,
+    xje: 16489,
+    xjf: 16490,
+    xjg: 16491,
+    xjh: 16492,
+    xji: 16493,
+    xjj: 16494,
+    xjk: 16495,
+    xjl: 16496,
+    xjm: 16497,
+    xjn: 16498,
+    xjo: 16499,
+    xjp: 16500,
+    xjq: 16501,
+    xjr: 16502,
+    xjs: 16503,
+    xjt: 16504,
+    xju: 16505,
+    xjv: 16506,
+    xjw: 16507,
+    xjx: 16508,
+    xjy: 16509,
+    xkz: 16510,
+    xka: 16511,
+    xkb: 16512,
+    xkc: 16513,
+    xkd: 16514,
+    xke: 16515,
+    xkf: 16516,
+    xkg: 16517,
+    xkh: 16518,
+    xki: 16519,
+    xkj: 16520,
+    xkk: 16521,
+    xkl: 16522,
+    xkm: 16523,
+    xkn: 16524,
+    xko: 16525,
+    xkp: 16526,
+    xkq: 16527,
+    xkr: 16528,
+    xks: 16529,
+    xkt: 16530,
+    xku: 16531,
+    xkv: 16532,
+    xkw: 16533,
+    xkx: 16534,
+    xky: 16535,
+    xlz: 16536,
+    xla: 16537,
+    xlb: 16538,
+    xlc: 16539,
+    xld: 16540,
+    xle: 16541,
+    xlf: 16542,
+    xlg: 16543,
+    xlh: 16544,
+    xli: 16545,
+    xlj: 16546,
+    xlk: 16547,
+    xll: 16548,
+    xlm: 16549,
+    xln: 16550,
+    xlo: 16551,
+    xlp: 16552,
+    xlq: 16553,
+    xlr: 16554,
+    xls: 16555,
+    xlt: 16556,
+    xlu: 16557,
+    xlv: 16558,
+    xlw: 16559,
+    xlx: 16560,
+    xly: 16561,
+    xmz: 16562,
+    xma: 16563,
+    xmb: 16564,
+    xmc: 16565,
+    xmd: 16566,
+    xme: 16567,
+    xmf: 16568,
+    xmg: 16569,
+    xmh: 16570,
+    xmi: 16571,
+    xmj: 16572,
+    xmk: 16573,
+    xml: 16574,
+    xmm: 16575,
+    xmn: 16576,
+    xmo: 16577,
+    xmp: 16578,
+    xmq: 16579,
+    xmr: 16580,
+    xms: 16581,
+    xmt: 16582,
+    xmu: 16583,
+    xmv: 16584,
+    xmw: 16585,
+    xmx: 16586,
+    xmy: 16587,
+    xnz: 16588,
+    xna: 16589,
+    xnb: 16590,
+    xnc: 16591,
+    xnd: 16592,
+    xne: 16593,
+    xnf: 16594,
+    xng: 16595,
+    xnh: 16596,
+    xni: 16597,
+    xnj: 16598,
+    xnk: 16599,
+    xnl: 16600,
+    xnm: 16601,
+    xnn: 16602,
+    xno: 16603,
+    xnp: 16604,
+    xnq: 16605,
+    xnr: 16606,
+    xns: 16607,
+    xnt: 16608,
+    xnu: 16609,
+    xnv: 16610,
+    xnw: 16611,
+    xnx: 16612,
+    xny: 16613,
+    xoz: 16614,
+    xoa: 16615,
+    xob: 16616,
+    xoc: 16617,
+    xod: 16618,
+    xoe: 16619,
+    xof: 16620,
+    xog: 16621,
+    xoh: 16622,
+    xoi: 16623,
+    xoj: 16624,
+    xok: 16625,
+    xol: 16626,
+    xom: 16627,
+    xon: 16628,
+    xoo: 16629,
+    xop: 16630,
+    xoq: 16631,
+    xor: 16632,
+    xos: 16633,
+    xot: 16634,
+    xou: 16635,
+    xov: 16636,
+    xow: 16637,
+    xox: 16638,
+    xoy: 16639,
+    xpz: 16640,
+    xpa: 16641,
+    xpb: 16642,
+    xpc: 16643,
+    xpd: 16644,
+    xpe: 16645,
+    xpf: 16646,
+    xpg: 16647,
+    xph: 16648,
+    xpi: 16649,
+    xpj: 16650,
+    xpk: 16651,
+    xpl: 16652,
+    xpm: 16653,
+    xpn: 16654,
+    xpo: 16655,
+    xpp: 16656,
+    xpq: 16657,
+    xpr: 16658,
+    xps: 16659,
+    xpt: 16660,
+    xpu: 16661,
+    xpv: 16662,
+    xpw: 16663,
+    xpx: 16664,
+    xpy: 16665,
+    xqz: 16666,
+    xqa: 16667,
+    xqb: 16668,
+    xqc: 16669,
+    xqd: 16670,
+    xqe: 16671,
+    xqf: 16672,
+    xqg: 16673,
+    xqh: 16674,
+    xqi: 16675,
+    xqj: 16676,
+    xqk: 16677,
+    xql: 16678,
+    xqm: 16679,
+    xqn: 16680,
+    xqo: 16681,
+    xqp: 16682,
+    xqq: 16683,
+    xqr: 16684,
+    xqs: 16685,
+    xqt: 16686,
+    xqu: 16687,
+    xqv: 16688,
+    xqw: 16689,
+    xqx: 16690,
+    xqy: 16691,
+    xrz: 16692,
+    xra: 16693,
+    xrb: 16694,
+    xrc: 16695,
+    xrd: 16696,
+    xre: 16697,
+    xrf: 16698,
+    xrg: 16699,
+    xrh: 16700,
+    xri: 16701,
+    xrj: 16702,
+    xrk: 16703,
+    xrl: 16704,
+    xrm: 16705,
+    xrn: 16706,
+    xro: 16707,
+    xrp: 16708,
+    xrq: 16709,
+    xrr: 16710,
+    xrs: 16711,
+    xrt: 16712,
+    xru: 16713,
+    xrv: 16714,
+    xrw: 16715,
+    xrx: 16716,
+    xry: 16717,
+    xsz: 16718,
+    xsa: 16719,
+    xsb: 16720,
+    xsc: 16721,
+    xsd: 16722,
+    xse: 16723,
+    xsf: 16724,
+    xsg: 16725,
+    xsh: 16726,
+    xsi: 16727,
+    xsj: 16728,
+    xsk: 16729,
+    xsl: 16730,
+    xsm: 16731,
+    xsn: 16732,
+    xso: 16733,
+    xsp: 16734,
+    xsq: 16735,
+    xsr: 16736,
+    xss: 16737,
+    xst: 16738,
+    xsu: 16739,
+    xsv: 16740,
+    xsw: 16741,
+    xsx: 16742,
+    xsy: 16743,
+    xtz: 16744,
+    xta: 16745,
+    xtb: 16746,
+    xtc: 16747,
+    xtd: 16748,
+    xte: 16749,
+    xtf: 16750,
+    xtg: 16751,
+    xth: 16752,
+    xti: 16753,
+    xtj: 16754,
+    xtk: 16755,
+    xtl: 16756,
+    xtm: 16757,
+    xtn: 16758,
+    xto: 16759,
+    xtp: 16760,
+    xtq: 16761,
+    xtr: 16762,
+    xts: 16763,
+    xtt: 16764,
+    xtu: 16765,
+    xtv: 16766,
+    xtw: 16767,
+    xtx: 16768,
+    xty: 16769,
+    xuz: 16770,
+    xua: 16771,
+    xub: 16772,
+    xuc: 16773,
+    xud: 16774,
+    xue: 16775,
+    xuf: 16776,
+    xug: 16777,
+    xuh: 16778,
+    xui: 16779,
+    xuj: 16780,
+    xuk: 16781,
+    xul: 16782,
+    xum: 16783,
+    xun: 16784,
+    xuo: 16785,
+    xup: 16786,
+    xuq: 16787,
+    xur: 16788,
+    xus: 16789,
+    xut: 16790,
+    xuu: 16791,
+    xuv: 16792,
+    xuw: 16793,
+    xux: 16794,
+    xuy: 16795,
+    xvz: 16796,
+    xva: 16797,
+    xvb: 16798,
+    xvc: 16799,
+    xvd: 16800,
+    xve: 16801,
+    xvf: 16802,
+    xvg: 16803,
+    xvh: 16804,
+    xvi: 16805,
+    xvj: 16806,
+    xvk: 16807,
+    xvl: 16808,
+    xvm: 16809,
+    xvn: 16810,
+    xvo: 16811,
+    xvp: 16812,
+    xvq: 16813,
+    xvr: 16814,
+    xvs: 16815,
+    xvt: 16816,
+    xvu: 16817,
+    xvv: 16818,
+    xvw: 16819,
+    xvx: 16820,
+    xvy: 16821,
+    xwz: 16822,
+    xwa: 16823,
+    xwb: 16824,
+    xwc: 16825,
+    xwd: 16826,
+    xwe: 16827,
+    xwf: 16828,
+    xwg: 16829,
+    xwh: 16830,
+    xwi: 16831,
+    xwj: 16832,
+    xwk: 16833,
+    xwl: 16834,
+    xwm: 16835,
+    xwn: 16836,
+    xwo: 16837,
+    xwp: 16838,
+    xwq: 16839,
+    xwr: 16840,
+    xws: 16841,
+    xwt: 16842,
+    xwu: 16843,
+    xwv: 16844,
+    xww: 16845,
+    xwx: 16846,
+    xwy: 16847,
+    xxz: 16848,
+    xxa: 16849,
+    xxb: 16850,
+    xxc: 16851,
+    xxd: 16852,
+    xxe: 16853,
+    xxf: 16854,
+    xxg: 16855,
+    xxh: 16856,
+    xxi: 16857,
+    xxj: 16858,
+    xxk: 16859,
+    xxl: 16860,
+    xxm: 16861,
+    xxn: 16862,
+    xxo: 16863,
+    xxp: 16864,
+    xxq: 16865,
+    xxr: 16866,
+    xxs: 16867,
+    xxt: 16868,
+    xxu: 16869,
+    xxv: 16870,
+    xxw: 16871,
+    xxx: 16872,
+    xxy: 16873,
+    xyz: 16874,
+    xya: 16875,
+    xyb: 16876,
+    xyc: 16877,
+    xyd: 16878,
+    xye: 16879,
+    xyf: 16880,
+    xyg: 16881,
+    xyh: 16882,
+    xyi: 16883,
+    xyj: 16884,
+    xyk: 16885,
+    xyl: 16886,
+    xym: 16887,
+    xyn: 16888,
+    xyo: 16889,
+    xyp: 16890,
+    xyq: 16891,
+    xyr: 16892,
+    xys: 16893,
+    xyt: 16894,
+    xyu: 16895,
+    xyv: 16896,
+    xyw: 16897,
+    xyx: 16898,
+    xyy: 16899,
+    yzz: 16900,
+    yza: 16901,
+    yzb: 16902,
+    yzc: 16903,
+    yzd: 16904,
+    yze: 16905,
+    yzf: 16906,
+    yzg: 16907,
+    yzh: 16908,
+    yzi: 16909,
+    yzj: 16910,
+    yzk: 16911,
+    yzl: 16912,
+    yzm: 16913,
+    yzn: 16914,
+    yzo: 16915,
+    yzp: 16916,
+    yzq: 16917,
+    yzr: 16918,
+    yzs: 16919,
+    yzt: 16920,
+    yzu: 16921,
+    yzv: 16922,
+    yzw: 16923,
+    yzx: 16924,
+    yzy: 16925,
+    yaz: 16926,
+    yaa: 16927,
+    yab: 16928,
+    yac: 16929,
+    yad: 16930,
+    yae: 16931,
+    yaf: 16932,
+    yag: 16933,
+    yah: 16934,
+    yai: 16935,
+    yaj: 16936,
+    yak: 16937,
+    yal: 16938,
+    yam: 16939,
+    yan: 16940,
+    yao: 16941,
+    yap: 16942,
+    yaq: 16943,
+    yar: 16944,
+    yas: 16945,
+    yat: 16946,
+    yau: 16947,
+    yav: 16948,
+    yaw: 16949,
+    yax: 16950,
+    yay: 16951,
+    ybz: 16952,
+    yba: 16953,
+    ybb: 16954,
+    ybc: 16955,
+    ybd: 16956,
+    ybe: 16957,
+    ybf: 16958,
+    ybg: 16959,
+    ybh: 16960,
+    ybi: 16961,
+    ybj: 16962,
+    ybk: 16963,
+    ybl: 16964,
+    ybm: 16965,
+    ybn: 16966,
+    ybo: 16967,
+    ybp: 16968,
+    ybq: 16969,
+    ybr: 16970,
+    ybs: 16971,
+    ybt: 16972,
+    ybu: 16973,
+    ybv: 16974,
+    ybw: 16975,
+    ybx: 16976,
+    yby: 16977,
+    ycz: 16978,
+    yca: 16979,
+    ycb: 16980,
+    ycc: 16981,
+    ycd: 16982,
+    yce: 16983,
+    ycf: 16984,
+    ycg: 16985,
+    ych: 16986,
+    yci: 16987,
+    ycj: 16988,
+    yck: 16989,
+    ycl: 16990,
+    ycm: 16991,
+    ycn: 16992,
+    yco: 16993,
+    ycp: 16994,
+    ycq: 16995,
+    ycr: 16996,
+    ycs: 16997,
+    yct: 16998,
+    ycu: 16999,
+    ycv: 17000,
+    ycw: 17001,
+    ycx: 17002,
+    ycy: 17003,
+    ydz: 17004,
+    yda: 17005,
+    ydb: 17006,
+    ydc: 17007,
+    ydd: 17008,
+    yde: 17009,
+    ydf: 17010,
+    ydg: 17011,
+    ydh: 17012,
+    ydi: 17013,
+    ydj: 17014,
+    ydk: 17015,
+    ydl: 17016,
+    ydm: 17017,
+    ydn: 17018,
+    ydo: 17019,
+    ydp: 17020,
+    ydq: 17021,
+    ydr: 17022,
+    yds: 17023,
+    ydt: 17024,
+    ydu: 17025,
+    ydv: 17026,
+    ydw: 17027,
+    ydx: 17028,
+    ydy: 17029,
+    yez: 17030,
+    yea: 17031,
+    yeb: 17032,
+    yec: 17033,
+    yed: 17034,
+    yee: 17035,
+    yef: 17036,
+    yeg: 17037,
+    yeh: 17038,
+    yei: 17039,
+    yej: 17040,
+    yek: 17041,
+    yel: 17042,
+    yem: 17043,
+    yen: 17044,
+    yeo: 17045,
+    yep: 17046,
+    yeq: 17047,
+    yer: 17048,
+    yes: 17049,
+    yet: 17050,
+    yeu: 17051,
+    yev: 17052,
+    yew: 17053,
+    yex: 17054,
+    yey: 17055,
+    yfz: 17056,
+    yfa: 17057,
+    yfb: 17058,
+    yfc: 17059,
+    yfd: 17060,
+    yfe: 17061,
+    yff: 17062,
+    yfg: 17063,
+    yfh: 17064,
+    yfi: 17065,
+    yfj: 17066,
+    yfk: 17067,
+    yfl: 17068,
+    yfm: 17069,
+    yfn: 17070,
+    yfo: 17071,
+    yfp: 17072,
+    yfq: 17073,
+    yfr: 17074,
+    yfs: 17075,
+    yft: 17076,
+    yfu: 17077,
+    yfv: 17078,
+    yfw: 17079,
+    yfx: 17080,
+    yfy: 17081,
+    ygz: 17082,
+    yga: 17083,
+    ygb: 17084,
+    ygc: 17085,
+    ygd: 17086,
+    yge: 17087,
+    ygf: 17088,
+    ygg: 17089,
+    ygh: 17090,
+    ygi: 17091,
+    ygj: 17092,
+    ygk: 17093,
+    ygl: 17094,
+    ygm: 17095,
+    ygn: 17096,
+    ygo: 17097,
+    ygp: 17098,
+    ygq: 17099,
+    ygr: 17100,
+    ygs: 17101,
+    ygt: 17102,
+    ygu: 17103,
+    ygv: 17104,
+    ygw: 17105,
+    ygx: 17106,
+    ygy: 17107,
+    yhz: 17108,
+    yha: 17109,
+    yhb: 17110,
+    yhc: 17111,
+    yhd: 17112,
+    yhe: 17113,
+    yhf: 17114,
+    yhg: 17115,
+    yhh: 17116,
+    yhi: 17117,
+    yhj: 17118,
+    yhk: 17119,
+    yhl: 17120,
+    yhm: 17121,
+    yhn: 17122,
+    yho: 17123,
+    yhp: 17124,
+    yhq: 17125,
+    yhr: 17126,
+    yhs: 17127,
+    yht: 17128,
+    yhu: 17129,
+    yhv: 17130,
+    yhw: 17131,
+    yhx: 17132,
+    yhy: 17133,
+    yiz: 17134,
+    yia: 17135,
+    yib: 17136,
+    yic: 17137,
+    yid: 17138,
+    yie: 17139,
+    yif: 17140,
+    yig: 17141,
+    yih: 17142,
+    yii: 17143,
+    yij: 17144,
+    yik: 17145,
+    yil: 17146,
+    yim: 17147,
+    yin: 17148,
+    yio: 17149,
+    yip: 17150,
+    yiq: 17151,
+    yir: 17152,
+    yis: 17153,
+    yit: 17154,
+    yiu: 17155,
+    yiv: 17156,
+    yiw: 17157,
+    yix: 17158,
+    yiy: 17159,
+    yjz: 17160,
+    yja: 17161,
+    yjb: 17162,
+    yjc: 17163,
+    yjd: 17164,
+    yje: 17165,
+    yjf: 17166,
+    yjg: 17167,
+    yjh: 17168,
+    yji: 17169,
+    yjj: 17170,
+    yjk: 17171,
+    yjl: 17172,
+    yjm: 17173,
+    yjn: 17174,
+    yjo: 17175,
+    yjp: 17176,
+    yjq: 17177,
+    yjr: 17178,
+    yjs: 17179,
+    yjt: 17180,
+    yju: 17181,
+    yjv: 17182,
+    yjw: 17183,
+    yjx: 17184,
+    yjy: 17185,
+    ykz: 17186,
+    yka: 17187,
+    ykb: 17188,
+    ykc: 17189,
+    ykd: 17190,
+    yke: 17191,
+    ykf: 17192,
+    ykg: 17193,
+    ykh: 17194,
+    yki: 17195,
+    ykj: 17196,
+    ykk: 17197,
+    ykl: 17198,
+    ykm: 17199,
+    ykn: 17200,
+    yko: 17201,
+    ykp: 17202,
+    ykq: 17203,
+    ykr: 17204,
+    yks: 17205,
+    ykt: 17206,
+    yku: 17207,
+    ykv: 17208,
+    ykw: 17209,
+    ykx: 17210,
+    yky: 17211,
+    ylz: 17212,
+    yla: 17213,
+    ylb: 17214,
+    ylc: 17215,
+    yld: 17216,
+    yle: 17217,
+    ylf: 17218,
+    ylg: 17219,
+    ylh: 17220,
+    yli: 17221,
+    ylj: 17222,
+    ylk: 17223,
+    yll: 17224,
+    ylm: 17225,
+    yln: 17226,
+    ylo: 17227,
+    ylp: 17228,
+    ylq: 17229,
+    ylr: 17230,
+    yls: 17231,
+    ylt: 17232,
+    ylu: 17233,
+    ylv: 17234,
+    ylw: 17235,
+    ylx: 17236,
+    yly: 17237,
+    ymz: 17238,
+    yma: 17239,
+    ymb: 17240,
+    ymc: 17241,
+    ymd: 17242,
+    yme: 17243,
+    ymf: 17244,
+    ymg: 17245,
+    ymh: 17246,
+    ymi: 17247,
+    ymj: 17248,
+    ymk: 17249,
+    yml: 17250,
+    ymm: 17251,
+    ymn: 17252,
+    ymo: 17253,
+    ymp: 17254,
+    ymq: 17255,
+    ymr: 17256,
+    yms: 17257,
+    ymt: 17258,
+    ymu: 17259,
+    ymv: 17260,
+    ymw: 17261,
+    ymx: 17262,
+    ymy: 17263,
+    ynz: 17264,
+    yna: 17265,
+    ynb: 17266,
+    ync: 17267,
+    ynd: 17268,
+    yne: 17269,
+    ynf: 17270,
+    yng: 17271,
+    ynh: 17272,
+    yni: 17273,
+    ynj: 17274,
+    ynk: 17275,
+    ynl: 17276,
+    ynm: 17277,
+    ynn: 17278,
+    yno: 17279,
+    ynp: 17280,
+    ynq: 17281,
+    ynr: 17282,
+    yns: 17283,
+    ynt: 17284,
+    ynu: 17285,
+    ynv: 17286,
+    ynw: 17287,
+    ynx: 17288,
+    yny: 17289,
+    yoz: 17290,
+    yoa: 17291,
+    yob: 17292,
+    yoc: 17293,
+    yod: 17294,
+    yoe: 17295,
+    yof: 17296,
+    yog: 17297,
+    yoh: 17298,
+    yoi: 17299,
+    yoj: 17300,
+    yok: 17301,
+    yol: 17302,
+    yom: 17303,
+    yon: 17304,
+    yoo: 17305,
+    yop: 17306,
+    yoq: 17307,
+    yor: 17308,
+    yos: 17309,
+    yot: 17310,
+    you: 17311,
+    yov: 17312,
+    yow: 17313,
+    yox: 17314,
+    yoy: 17315,
+    ypz: 17316,
+    ypa: 17317,
+    ypb: 17318,
+    ypc: 17319,
+    ypd: 17320,
+    ype: 17321,
+    ypf: 17322,
+    ypg: 17323,
+    yph: 17324,
+    ypi: 17325,
+    ypj: 17326,
+    ypk: 17327,
+    ypl: 17328,
+    ypm: 17329,
+    ypn: 17330,
+    ypo: 17331,
+    ypp: 17332,
+    ypq: 17333,
+    ypr: 17334,
+    yps: 17335,
+    ypt: 17336,
+    ypu: 17337,
+    ypv: 17338,
+    ypw: 17339,
+    ypx: 17340,
+    ypy: 17341,
+    yqz: 17342,
+    yqa: 17343,
+    yqb: 17344,
+    yqc: 17345,
+    yqd: 17346,
+    yqe: 17347,
+    yqf: 17348,
+    yqg: 17349,
+    yqh: 17350,
+    yqi: 17351,
+    yqj: 17352,
+    yqk: 17353,
+    yql: 17354,
+    yqm: 17355,
+    yqn: 17356,
+    yqo: 17357,
+    yqp: 17358,
+    yqq: 17359,
+    yqr: 17360,
+    yqs: 17361,
+    yqt: 17362,
+    yqu: 17363,
+    yqv: 17364,
+    yqw: 17365,
+    yqx: 17366,
+    yqy: 17367,
+    yrz: 17368,
+    yra: 17369,
+    yrb: 17370,
+    yrc: 17371,
+    yrd: 17372,
+    yre: 17373,
+    yrf: 17374,
+    yrg: 17375,
+    yrh: 17376,
+    yri: 17377,
+    yrj: 17378,
+    yrk: 17379,
+    yrl: 17380,
+    yrm: 17381,
+    yrn: 17382,
+    yro: 17383,
+    yrp: 17384,
+    yrq: 17385,
+    yrr: 17386,
+    yrs: 17387,
+    yrt: 17388,
+    yru: 17389,
+    yrv: 17390,
+    yrw: 17391,
+    yrx: 17392,
+    yry: 17393,
+    ysz: 17394,
+    ysa: 17395,
+    ysb: 17396,
+    ysc: 17397,
+    ysd: 17398,
+    yse: 17399,
+    ysf: 17400,
+    ysg: 17401,
+    ysh: 17402,
+    ysi: 17403,
+    ysj: 17404,
+    ysk: 17405,
+    ysl: 17406,
+    ysm: 17407,
+    ysn: 17408,
+    yso: 17409,
+    ysp: 17410,
+    ysq: 17411,
+    ysr: 17412,
+    yss: 17413,
+    yst: 17414,
+    ysu: 17415,
+    ysv: 17416,
+    ysw: 17417,
+    ysx: 17418,
+    ysy: 17419,
+    ytz: 17420,
+    yta: 17421,
+    ytb: 17422,
+    ytc: 17423,
+    ytd: 17424,
+    yte: 17425,
+    ytf: 17426,
+    ytg: 17427,
+    yth: 17428,
+    yti: 17429,
+    ytj: 17430,
+    ytk: 17431,
+    ytl: 17432,
+    ytm: 17433,
+    ytn: 17434,
+    yto: 17435,
+    ytp: 17436,
+    ytq: 17437,
+    ytr: 17438,
+    yts: 17439,
+    ytt: 17440,
+    ytu: 17441,
+    ytv: 17442,
+    ytw: 17443,
+    ytx: 17444,
+    yty: 17445,
+    yuz: 17446,
+    yua: 17447,
+    yub: 17448,
+    yuc: 17449,
+    yud: 17450,
+    yue: 17451,
+    yuf: 17452,
+    yug: 17453,
+    yuh: 17454,
+    yui: 17455,
+    yuj: 17456,
+    yuk: 17457,
+    yul: 17458,
+    yum: 17459,
+    yun: 17460,
+    yuo: 17461,
+    yup: 17462,
+    yuq: 17463,
+    yur: 17464,
+    yus: 17465,
+    yut: 17466,
+    yuu: 17467,
+    yuv: 17468,
+    yuw: 17469,
+    yux: 17470,
+    yuy: 17471,
+    yvz: 17472,
+    yva: 17473,
+    yvb: 17474,
+    yvc: 17475,
+    yvd: 17476,
+    yve: 17477,
+    yvf: 17478,
+    yvg: 17479,
+    yvh: 17480,
+    yvi: 17481,
+    yvj: 17482,
+    yvk: 17483,
+    yvl: 17484,
+    yvm: 17485,
+    yvn: 17486,
+    yvo: 17487,
+    yvp: 17488,
+    yvq: 17489,
+    yvr: 17490,
+    yvs: 17491,
+    yvt: 17492,
+    yvu: 17493,
+    yvv: 17494,
+    yvw: 17495,
+    yvx: 17496,
+    yvy: 17497,
+    ywz: 17498,
+    ywa: 17499,
+    ywb: 17500,
+    ywc: 17501,
+    ywd: 17502,
+    ywe: 17503,
+    ywf: 17504,
+    ywg: 17505,
+    ywh: 17506,
+    ywi: 17507,
+    ywj: 17508,
+    ywk: 17509,
+    ywl: 17510,
+    ywm: 17511,
+    ywn: 17512,
+    ywo: 17513,
+    ywp: 17514,
+    ywq: 17515,
+    ywr: 17516,
+    yws: 17517,
+    ywt: 17518,
+    ywu: 17519,
+    ywv: 17520,
+    yww: 17521,
+    ywx: 17522,
+    ywy: 17523,
+    yxz: 17524,
+    yxa: 17525,
+    yxb: 17526,
+    yxc: 17527,
+    yxd: 17528,
+    yxe: 17529,
+    yxf: 17530,
+    yxg: 17531,
+    yxh: 17532,
+    yxi: 17533,
+    yxj: 17534,
+    yxk: 17535,
+    yxl: 17536,
+    yxm: 17537,
+    yxn: 17538,
+    yxo: 17539,
+    yxp: 17540,
+    yxq: 17541,
+    yxr: 17542,
+    yxs: 17543,
+    yxt: 17544,
+    yxu: 17545,
+    yxv: 17546,
+    yxw: 17547,
+    yxx: 17548,
+    yxy: 17549,
+    yyz: 17550,
+    yya: 17551,
+    yyb: 17552,
+    yyc: 17553,
+    yyd: 17554,
+    yye: 17555,
+    yyf: 17556,
+    yyg: 17557,
+    yyh: 17558,
+    yyi: 17559,
+    yyj: 17560,
+    yyk: 17561,
+    yyl: 17562,
+    yym: 17563,
+    yyn: 17564,
+    yyo: 17565,
+    yyp: 17566,
+    yyq: 17567,
+    yyr: 17568,
+    yys: 17569,
+    yyt: 17570,
+    yyu: 17571,
+    yyv: 17572,
+    111: 111,
+    yyw: 17573,
+    yyx: 17574,
+    yyy: 17575,
+    get X() { print("getting X"); return "X"; },
+    set X(value) { print("setting X"); },
+};
+
+print(x.aaa);
+print(x.hhh);
+print(x.yyy);
+print(x[111]);
+print(x.X);
+x.X = 0;
+var keys = Object.keys(x);
+print(keys.length);
+print(keys[0]);
+print(keys[703]);
+print(keys[5624]);
+print(keys[17575]);
+print(keys[17576]);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8017084.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,13 @@
+703
+5624
+17575
+111
+getting X
+X
+setting X
+17577
+111
+aaa
+hhh
+yyy
+X
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8017768.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8017768: Allow use of dot notation for inner class names.
+ * 
+ * @test
+ * @run
+ */
+
+print(Java.type("java.awt.geom.Arc2D.Float") === Java.type("java.awt.geom.Arc2D$Float"))
+var iisc = Java.type("jdk.nashorn.test.models.OuterClass$InnerStaticClass$InnerInnerStaticClass")
+print(Java.type("jdk.nashorn.test.models.OuterClass.InnerStaticClass.InnerInnerStaticClass") === iisc)
+print(Java.type("jdk.nashorn.test.models.OuterClass$InnerStaticClass.InnerInnerStaticClass") === iisc)
+print(Java.type("jdk.nashorn.test.models.OuterClass.InnerStaticClass$InnerInnerStaticClass") === iisc)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8017768.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,4 @@
+true
+true
+true
+true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019585.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019585 - use before def issues with vars using the declared var
+ * legal - but needs to set "a" as undefined
+ *
+ * @test
+ * @run
+ */
+
+function f() {
+    var a = b == 17 && (a = toto(b)) && toto2(a); 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019629.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019629: void operator should always evaluate to undefined 
+ *
+ * @test
+ * @run
+ */
+
+function check(str) {
+    var val = eval(str);
+    if (typeof val !== 'undefined') {
+        print("FAILED: " + str + " does not evaluate to 'undefined'");
+    }
+}
+
+check("void +this");
+check("void +(void 0)");
+check("(function f(){return void +(void 0)})()");
+check("void function() {}");
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019783.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8019783: typeof does not work properly for java methods and foreign objects
+ *
+ * @test
+ * @run
+ */
+
+function printTypeof(str) {
+    print("typeof(" + str + ") =  " + eval('typeof ' + str));
+}
+
+// Java methods
+printTypeof("java.lang.System.exit");
+printTypeof("java.lang.System['exit']");
+// full signature
+printTypeof("java.lang.System['exit(int)']");
+// overloaded method
+printTypeof("java.security.AccessController.doPrivileged");
+printTypeof("java.security.AccessController['doPrivileged']");
+
+// foreign objects
+var global = loadWithNewGlobal({ name: "t", script: "this" });
+print("typeof(global.Object) = " + (typeof global.Object));
+print("typeof(new global.Object()) = " + (typeof (new global.Object())));
+
+// foreign engine objects
+var m = new javax.script.ScriptEngineManager();
+var engine = m.getEngineByName("nashorn");
+var engineGlobal = engine.eval("this");
+
+print("typeof(engineGlobal.Object) = " + (typeof engineGlobal.Object));
+print("typeof(new engineGlobal.Object()) = " + (typeof (new engineGlobal.Object())));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019783.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,9 @@
+typeof(java.lang.System.exit) =  function
+typeof(java.lang.System['exit']) =  function
+typeof(java.lang.System['exit(int)']) =  function
+typeof(java.security.AccessController.doPrivileged) =  function
+typeof(java.security.AccessController['doPrivileged']) =  function
+typeof(global.Object) = function
+typeof(new global.Object()) = object
+typeof(engineGlobal.Object) = function
+typeof(new engineGlobal.Object()) = object
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019791.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019791: ~ is a unary operator
+ *
+ * @test
+ * @run
+ */
+
+// Used to crash instead of SyntaxError
+try {
+    eval('"" ~ ""');
+    print("FAILED: SyntaxError expected for: \"\" ~ \"\"");
+} catch (e) {
+    print(e.toString().replace(/\\/g, '/'));
+}
+
+// Used to crash instead of SyntaxError
+try {
+    eval("function() { if (1~0) return 0; return 1 }");
+    print("FAILED: SyntaxError expected for: if (1~0) ");
+} catch (e) {
+    print(e.toString().replace(/\\/g, '/'));
+}
+
+// The following are valid, but used to crash
+Function("0 \n ~ 2 \n ~ 1")();
+
+Function("~ ~ 0 \n ~ ~ 1")();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019791.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,6 @@
+SyntaxError: test/script/basic/JDK-8019791.js#33<eval>:1:3 Expected ; but found ~
+"" ~ ""
+   ^
+SyntaxError: test/script/basic/JDK-8019791.js#41<eval>:1:18 Expected ) but found ~
+function() { if (1~0) return 0; return 1 }
+                  ^
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019805.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8019805: for each (init; test; modify) is invalid
+ *
+ * @test
+ * @run
+ */
+
+try {
+    eval("for each(var v=0;false;);");
+    print("FAILED: for each(var v=0; false;); should have thrown error");
+} catch (e) {
+    print(e.toString().replace(/\\/g, '/'));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019805.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+SyntaxError: test/script/basic/JDK-8019805.js#32<eval>:1:16 for each can only be used with for..in
+for each(var v=0;false;);
+                ^
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019808.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8019808: Switch on empty array breaks codegen
+ *
+ * @test
+ * @run
+ */
+
+Function("switch([]) { case 7: }"); 
+
+function f() {
+    switch([]) {
+    case 7:
+    }
+}
+
+f();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019809.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019809: Break return combo that generates erroneous bytecode
+ *
+ * @test
+ * @run
+ */
+
+//Function("L: {break L;return; }"); 
+
+function f() {
+    L: { break L; return; }
+}
+
+f();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019810.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8019810: Assertion error in attr in function body
+ *
+ * @test
+ * @run
+ */
+
+Function("return (void ({ set each (x2)y }));");
+
+function f() {
+    return (void ({ set each (x2)y }));
+}
+print(f());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019810.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,1 @@
+undefined
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019811.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019811: Number coercion for return values of static calls was broken
+ *
+ * @test
+ * @run
+ */
+
+function f(x) {
+    var window = 17;
+    return function (x) { 
+	return true 
+    } (x) >> window;
+}
+
+Function("L:if((function x ()3)() + arguments++) {return; } else if (new gc()) while(((x2.prop = functional)) && 0){ }"); 
+
+Function("var x = x -= '' "); 
+
+Function("switch((Math.pow ? x = 1.2e3 : 3)) { default: return; }") 
+
+Function("x = 0.1, x\ntrue\n~this");
+
+Function("with((function (x)x2)() ^ this){return; }");
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019814.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8019814: Add regression test for passing cases
+ *
+ * @test
+ * @run
+ */
+
+// java.lang.VerifyError: Bad type on operand stack
+Function("switch([]) { case 7: }");
+
+// java.lang.AssertionError: expecting integer type or object for jump, but found double
+Function("with(\nnull == (this % {}))( /x/g );");
+
+// java.lang.AssertionError: expecting equivalent types on stack but got double and int 
+try {
+    eval('Function("/*infloop*/while(((function ()4.)([z1,,], [,,]) - true++))switch(1e+81.x) { default: break; \u0009 }")');
+} catch (e) {
+    print(e.toString().replace(/\\/g, '/'));
+}
+
+// java.lang.VerifyError: get long/double overflows locals
+Function("var x = x -= '' ");
+
+// java.lang.AssertionError: object is not compatible with boolean
+Function("return (null != [,,] <= this);");
+
+// java.lang.AssertionError: Only return value on stack allowed at return point
+// - depth=2 stack = jdk.nashorn.internal.codegen.Label$Stack@4bd0d62f 
+Function("x = 0.1, x\ntrue\n~this");
+
+// java.lang.AssertionError: node NaN ~ window class jdk.nashorn.internal.ir.BinaryNode
+// has no symbol! [object] function _L1() 
+Function("throw NaN\n~window;");
+
+// java.lang.AssertionError: array element type doesn't match array type
+Function("if(([(this >>> 4.)].map(gc))) x;");
+
+try {
+    eval('Function("if(--) y;")');
+} catch (e) {
+    print(e.toString().replace(/\\/g, '/'));
+}
+
+// java.lang.AssertionError: stacks jdk.nashorn.internal.codegen.Label$Stack@4918f90f
+// is not equivalent with jdk.nashorn.internal.codegen.Label$Stack@5f9b21a1 at join point 
+Function("if((null ^ [1]) !== (this.yoyo(false))) {var NaN, x;x\n~[,,z1] }");
+
+// java.lang.AssertionError
+//    at jdk.nashorn.internal.codegen.Attr.enterFunctionBody(Attr.java:276) 
+Function("return (void ({ set each (x2)y }));"); 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019814.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,6 @@
+ReferenceError: <function>:1:50 Invalid left hand side for assignment
+/*infloop*/while(((function ()4.)([z1,,], [,,]) - true++))switch(1e+81.x) { default: break; 	 }
+                                                  ^
+SyntaxError: <function>:1:5 Expected l-value but found )
+if(--) y;
+     ^
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019817.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019817: More number coercion issues
+ *
+ * @test
+ * @run
+ */
+var y = 17.17;
+
+Function("return y % function(q) { return q; }();"); 
+
+function f() {
+    return y % function(q) { return q; }();
+}
+f();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019819.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019819: scope symbol didn't get a slot in certain cases
+ * 
+ * @test
+ * @run
+ */
+function f() {
+    try {
+    } catch(e if [].g(e)) { 
+        with({}) { 
+            throw e;
+        }
+    }
+}
+
+function g() {
+    try {
+    } catch(e) { 
+        with({}) { 
+            throw e;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019821.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019821: boolean switch value accidentally triggered "allInts" case 
+ * as boolean is considered narrower than int. This caused a ClassCastException
+ *
+ * @test
+ * @run
+ */
+
+function f() { 
+    switch(gc()) { 
+    case true: 
+    case 1:  
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019822.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019822: Duplicate name/signature for a function in finally block
+ *
+ * @test
+ */
+try { function (x) /x/ } finally { (function(id) { return id }); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019947.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019947: inherited property invalidation does not work with two globals in same context
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+function func(arr) {
+    try {
+       print(arr.toString());
+    } catch (e) {
+       print(e.stack);
+    }
+}
+
+var arr = ["hello", "world"]
+
+func(arr);
+
+var global = loadWithNewGlobal({
+   name: "t",
+   script: <<EOF
+
+
+function func(arr) {
+   try {
+       print(arr.toString());
+   } catch (e) {
+       print(e.stack);
+   }
+}
+
+var arr = [1, 2, 3];
+
+func(arr);
+
+delete Array.prototype.toString;
+
+// Object.prototype.toString should be visible
+// after Array.prototype.toString is deleted.
+func(arr);
+this;
+EOF
+});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019947.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+hello,world
+1,2,3
+[object Array]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019963.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019963: empty char range in regex
+ *
+ * @test
+ * @run
+ */
+
+var re1 = /[\x00-\x08\x0B\x0C\x0E-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/;
+
+print(re1.test("\x00"));
+print(re1.test("\x04"));
+print(re1.test("\x08"));
+print(re1.test("\x0a"));
+print(re1.test("\x0B"));
+print(re1.test("\x0C"));
+print(re1.test("\x0E"));
+print(re1.test("\x10"));
+print(re1.test("\x1A"));
+print(re1.test("\x2F"));
+print(re1.test("\x8E"));
+print(re1.test("\x8F"));
+print(re1.test("\x9F"));
+print(re1.test("\xA0"));
+print(re1.test("\xAF"));
+print(re1.test("\uD800"));
+print(re1.test("\xDA00"));
+print(re1.test("\xDCFF"));
+print(re1.test("\xDFFF"));
+print(re1.test("\xFFFE"));
+print(re1.test("\xFFFF"));
+
+var re2 = /[\x1F\x7F-\x84\x86]/;
+
+print(re2.test("\x1F"));
+print(re2.test("\x2F"));
+print(re2.test("\x3F"));
+print(re2.test("\x7F"));
+print(re2.test("\x80"));
+print(re2.test("\x84"));
+print(re2.test("\x85"));
+print(re2.test("\x86"));
+
+var re3 = /^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019963.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,29 @@
+true
+true
+true
+false
+true
+true
+true
+true
+true
+true
+true
+true
+true
+false
+false
+true
+true
+true
+true
+true
+true
+true
+false
+false
+true
+true
+true
+false
+true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019983.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8019983.js return without expression combined with return with expression should produce object
+ * return type (undefined)
+ * 
+ * @test
+ * @run
+ */
+
+
+function g() { 
+    switch(1) { 
+    case 0: 
+    case '': 
+    default:
+	return;
+    }
+    return 10;
+}
+print(g());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8019983.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,1 @@
+undefined
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020124.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020124: explicit conversion needed for switch tag
+ *
+ * @test
+ * @run
+ */
+
+x = {};
+Function("switch((a? x = 1 : 3)) { default: return; }")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020223.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020223: ClassCastException: String can not be casted to ScriptFunction
+ *
+ * @test
+ * @run
+ */
+
+__noSuchMethod__ = "";
+
+try {
+    foo();
+    fail("Must have thrown exception");
+} catch (e) {
+    if (! (e instanceof TypeError)) {
+        fail("TypeError expected, got " + e);
+    }
+}
+
+__noSuchProperty__ = 23;
+
+try {
+    foo;
+    fail("Must have thrown exception");
+} catch (e) {
+    if (! (e instanceof ReferenceError)) {
+        fail("ReferenceError expected, got " + e);
+    }
+}
+
+var obj = new JSAdapter() {
+    __get__: 332,
+    __call__: "hello"
+}
+
+try {
+    obj.foo; // should just be undefined
+} catch (e) {
+    fail("unexpected error : " + e);
+}
+
+try {
+    obj.foo();
+    fail("Must have thrown exception");
+} catch(e) {
+    if (! (e instanceof TypeError)) {
+        fail("TypeError expected, got " + e);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020324.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020324: Implement Object.bindProperties(target, source) for beans
+ *
+ * @test
+ * @run
+ */
+
+var PropertyBind = Java.type("jdk.nashorn.test.models.PropertyBind")
+var bean = new PropertyBind
+
+var obj1 = {}
+Object.bindProperties(obj1, bean)
+
+printBanner("Two-way read-write instance field")
+printEval("obj1.publicInt = 13")
+printEval("bean.publicInt")
+printEval("bean.publicInt = 15")
+printEval("obj1.publicInt")
+
+printBanner("Read only public instance field")
+printEval("obj1.publicFinalInt")
+printEval("obj1.publicFinalInt = 16")
+printEval("obj1.publicFinalInt")
+printEval("bean.publicFinalInt")
+
+printBanner("Two-way read-write instance property")
+printEval("obj1.readWrite = 17")
+printEval("bean.readWrite")
+printEval("bean.readWrite = 18")
+printEval("obj1.readWrite")
+printEval("obj1.getReadWrite()")
+printEval("obj1.setReadWrite(19)")
+printEval("obj1.readWrite")
+printEval("bean.readWrite")
+
+printBanner("Read only instance property")
+printEval("obj1.readOnly")
+printEval("obj1.readOnly = 20")
+printEval("obj1.readOnly")
+printEval("obj1.getReadOnly()")
+printEval("bean.getReadOnly()")
+
+printBanner("Write only instance property")
+printEval("obj1.writeOnly = 21")
+printEval("obj1.writeOnly")
+printEval("bean.writeOnly")
+printEval("bean.peekWriteOnly()")
+
+var obj2 = {}
+Object.bindProperties(obj2, PropertyBind)
+
+printBanner("Two-way read-write public static field")
+printEval("obj2.publicStaticInt = 22")
+printEval("PropertyBind.publicStaticInt")
+printEval("PropertyBind.publicStaticInt = 23")
+printEval("obj2.publicStaticInt")
+
+printBanner("Read only public static field")
+printEval("obj2.publicStaticFinalInt")
+printEval("obj2.publicStaticFinalInt = 24")
+printEval("obj2.publicStaticFinalInt")
+printEval("PropertyBind.publicStaticFinalInt")
+
+printBanner("Two-way read-write static property")
+printEval("obj2.staticReadWrite = 25")
+printEval("PropertyBind.staticReadWrite")
+printEval("PropertyBind.staticReadWrite = 26")
+printEval("obj2.staticReadWrite")
+printEval("obj2.getStaticReadWrite()")
+printEval("obj2.setStaticReadWrite(27)")
+printEval("obj2.staticReadWrite")
+printEval("PropertyBind.staticReadWrite")
+
+printBanner("Read only static property")
+printEval("obj2.staticReadOnly")
+printEval("obj2.staticReadOnly = 28")
+printEval("obj2.staticReadOnly")
+printEval("obj2.getStaticReadOnly()")
+printEval("PropertyBind.getStaticReadOnly()")
+
+printBanner("Write only static property")
+printEval("obj2.staticWriteOnly = 29")
+printEval("obj2.staticWriteOnly")
+printEval("PropertyBind.staticWriteOnly")
+printEval("PropertyBind.peekStaticWriteOnly()")
+
+printBanner("Sanity check to ensure property values remained what they were")
+printEval("obj1.publicInt")
+printEval("bean.publicInt")
+printEval("obj1.publicFinalInt")
+printEval("bean.publicFinalInt")
+printEval("obj1.readWrite")
+printEval("bean.readWrite")
+printEval("obj1.readOnly")
+printEval("bean.readOnly")
+printEval("bean.peekWriteOnly()")
+
+printEval("obj2.publicStaticInt")
+printEval("PropertyBind.publicStaticInt")
+printEval("obj2.publicStaticFinalInt")
+printEval("PropertyBind.publicStaticFinalInt")
+printEval("obj2.staticReadWrite")
+printEval("PropertyBind.staticReadWrite")
+printEval("obj2.staticReadOnly")
+printEval("PropertyBind.staticReadOnly")
+printEval("PropertyBind.peekStaticWriteOnly()")
+
+
+function printEval(s) {
+    print(s + ": " + eval(s))
+}
+
+function printBanner(s) {
+    print()
+    print("==== " + s + " ====")
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020324.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,90 @@
+
+==== Two-way read-write instance field ====
+obj1.publicInt = 13: 13
+bean.publicInt: 13
+bean.publicInt = 15: 15
+obj1.publicInt: 15
+
+==== Read only public instance field ====
+obj1.publicFinalInt: 42
+obj1.publicFinalInt = 16: 16
+obj1.publicFinalInt: 42
+bean.publicFinalInt: 42
+
+==== Two-way read-write instance property ====
+obj1.readWrite = 17: 17
+bean.readWrite: 17
+bean.readWrite = 18: 18
+obj1.readWrite: 18
+obj1.getReadWrite(): 18
+obj1.setReadWrite(19): null
+obj1.readWrite: 19
+bean.readWrite: 19
+
+==== Read only instance property ====
+obj1.readOnly: 123
+obj1.readOnly = 20: 20
+obj1.readOnly: 123
+obj1.getReadOnly(): 123
+bean.getReadOnly(): 123
+
+==== Write only instance property ====
+obj1.writeOnly = 21: 21
+obj1.writeOnly: undefined
+bean.writeOnly: undefined
+bean.peekWriteOnly(): 21
+
+==== Two-way read-write public static field ====
+obj2.publicStaticInt = 22: 22
+PropertyBind.publicStaticInt: 22
+PropertyBind.publicStaticInt = 23: 23
+obj2.publicStaticInt: 23
+
+==== Read only public static field ====
+obj2.publicStaticFinalInt: 2112
+obj2.publicStaticFinalInt = 24: 24
+obj2.publicStaticFinalInt: 2112
+PropertyBind.publicStaticFinalInt: 2112
+
+==== Two-way read-write static property ====
+obj2.staticReadWrite = 25: 25
+PropertyBind.staticReadWrite: 25
+PropertyBind.staticReadWrite = 26: 26
+obj2.staticReadWrite: 26
+obj2.getStaticReadWrite(): 26
+obj2.setStaticReadWrite(27): null
+obj2.staticReadWrite: 27
+PropertyBind.staticReadWrite: 27
+
+==== Read only static property ====
+obj2.staticReadOnly: 1230
+obj2.staticReadOnly = 28: 28
+obj2.staticReadOnly: 1230
+obj2.getStaticReadOnly(): 1230
+PropertyBind.getStaticReadOnly(): 1230
+
+==== Write only static property ====
+obj2.staticWriteOnly = 29: 29
+obj2.staticWriteOnly: undefined
+PropertyBind.staticWriteOnly: undefined
+PropertyBind.peekStaticWriteOnly(): 29
+
+==== Sanity check to ensure property values remained what they were ====
+obj1.publicInt: 15
+bean.publicInt: 15
+obj1.publicFinalInt: 42
+bean.publicFinalInt: 42
+obj1.readWrite: 19
+bean.readWrite: 19
+obj1.readOnly: 123
+bean.readOnly: 123
+bean.peekWriteOnly(): 21
+obj2.publicStaticInt: 23
+PropertyBind.publicStaticInt: 23
+obj2.publicStaticFinalInt: 2112
+PropertyBind.publicStaticFinalInt: 2112
+obj2.staticReadWrite: 27
+PropertyBind.staticReadWrite: 27
+obj2.staticReadOnly: 1230
+PropertyBind.staticReadOnly: 1230
+PropertyBind.peekStaticWriteOnly(): 29
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020325.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020325: static property does not work on accessible, public classes
+ *
+ * @test
+ * @run
+ */
+
+function printStatic(obj) {
+    print(obj.getClass().static);
+}
+
+printStatic(new java.util.ArrayList());
+printStatic(new java.util.HashMap());
+printStatic(new java.lang.Object());
+printStatic(new (Java.type("java.lang.Object[]"))(0));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020325.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,4 @@
+[JavaClass java.util.ArrayList]
+[JavaClass java.util.HashMap]
+[JavaClass java.lang.Object]
+[JavaClass [Ljava.lang.Object;]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020354.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020354: Object literal property initialization is not done in source order
+ *
+ * @test
+ * @run
+ */
+
+
+var obj = ({a: print(1), b: print(2), a: print(3)});
+
+var obj = ({
+    a: print(1),
+    get x() { print("getting x"); return "x" },
+    set x(v) { print("setting x"); },
+    b: print(2),
+    a: print(3)
+});
+
+print(obj.x);
+obj.x = 4;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020354.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,9 @@
+1
+2
+3
+1
+2
+3
+getting x
+x
+setting x
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020357.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020357: Return range error for too big native array buffers
+ *
+ * @test
+ * @run
+ */
+
+var UNSIGNED_INT_BITS = 31
+var BYTES_PER_INT_32  =  4
+
+var limit = Math.pow(2, UNSIGNED_INT_BITS)/BYTES_PER_INT_32
+
+try {
+    // A value at or under the limit should either succeed if we have
+    // enough heap, or throw an OutOfMemoryError if we don't.
+    Int32Array(limit - 1)
+} catch(e) {
+    if(!(e instanceof java.lang.OutOfMemoryError)) {
+        // Only print an unexpected result; OutOfMemoryError is expected
+        print(e)
+    }
+}
+
+// A value over the limit should throw a RangeError.
+try {
+    Int32Array(limit)
+} catch(e) {
+    print(e)
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020357.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,1 @@
+RangeError: inappropriate array buffer length: 536870912
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020358.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020358: Array(0xfffffff) throws OutOfMemoryError
+ *
+ * @test
+ * @run
+ */
+
+var x = new Array(0xfffffff);
+print(x.length);
+x[0xffffffe] = 1;
+print(x.length);
+x[0xfffffff] = 1;
+print(x.length);
+
+x = new Array(0x8ffff);
+print(x.length);
+print(Function("return 'ok'").apply(null, x));
+x[0] = "pass";
+print(Function("p", "return p").apply(null, x));
+print(Function("return arguments[0]").apply(null, x));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020358.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,7 @@
+268435455
+268435455
+268435456
+589823
+ok
+pass
+pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020380.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8020380: __noSuchProperty__ defined in mozilla_compat.js script should be non-enumerable
+ *
+ * @test
+ * @run
+ */
+
+load("nashorn:mozilla_compat.js");
+
+var desc = Object.getOwnPropertyDescriptor(this, "__noSuchProperty__");
+if (typeof desc.enumerable != 'boolean' || desc.enumerable != false) {
+    fail("__noSuchProperty__ is enumerable");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020437.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020437: Wrong handling of line numbers with multiline string literals
+ *
+ * @test
+ * @option -scripting
+ * @run
+ */
+
+print({
+   text: <<EOF
+This is a multiple line
+text inside a sting literal.
+Run this with -scripting option.
+EOF}); f();
+
+function f() {
+   try {
+       func();
+   } catch (e) {
+       print(e.stack.replace(/\\/g, '/'));
+   }
+}
+
+function func() {
+    throw new Error();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020437.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,5 @@
+[object Object]
+Error
+	at func (test/script/basic/JDK-8020437.js:48)
+	at f (test/script/basic/JDK-8020437.js:41)
+	at <program> (test/script/basic/JDK-8020437.js:37)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020463.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020463: Input argument array wrapping in loadWithNewGlobal is wrong
+ *
+ * @test
+ * @run
+ */
+
+loadWithNewGlobal({
+    name: "test",
+    script: "arguments[0]();"
+}, func);
+
+function func() {
+    try {
+        foo;
+    } catch (e) {
+        if (! (e instanceof ReferenceError)) {
+            fail("FAILED: expected ReferenceError!");
+        }
+    }
+}
+
+// identity
+var result = loadWithNewGlobal({
+    name: "test2",
+    script: "arguments[0]"
+}, this);
+
+if (result !== this) {
+    fail("FAILED: expected global to be returned 'as is'");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020508.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8020508: Enforce reflection check on 
+ * Object.bindProperties(target, source) for beans
+ *
+ * @test
+ * @run
+ */
+
+var x = {}
+try {
+  Object.bindProperties(x, java.util.Vector.class)
+} catch(e) {
+  print(e)
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8020508.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,1 @@
+java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "nashorn.JavaReflection")
--- a/nashorn/test/script/basic/NASHORN-759.js.EXPECTED	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/script/basic/NASHORN-759.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -11,7 +11,7 @@
 true
 
 object
-object
+function
 false
 
 T,h,e, ,q,u,i,c,k, ,g,r,a,y, ,n,a,s,h,o,r,n, ,j,u,m,p,s, ,o,v,e,r, ,t,h,e, ,l,a,z,y, ,z,e,b,r,a,.
--- a/nashorn/test/script/basic/forin.js	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/script/basic/forin.js	Fri Jul 26 14:07:32 2013 -0700
@@ -49,8 +49,3 @@
 // 'each' is a contextual keyword. Ok to use as identifier elsewhere..
 var each = "This is each";
 print(each);
-
-// it is ok to use "each" is usual for loop. Ignored as noise word.
-for each (var i = 0; i < 10; i++) {
-    print(i);
-}
--- a/nashorn/test/script/basic/forin.js.EXPECTED	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/script/basic/forin.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -25,13 +25,3 @@
 bear
 car
 This is each
-0
-1
-2
-3
-4
-5
-6
-7
-8
-9
--- a/nashorn/test/script/currently-failing/JDK-8006529.js	Fri Jul 26 10:12:14 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- * 
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- * 
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Please 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-8006529 : Methods should not always get callee parameter, and they
- * should not be too eager in creation of scopes.
- *
- * @test
- * @run
- */
-
-/*
- * This test script depends on nashorn Compiler internals. It uses reflection
- * to get access to private field and many public methods of Compiler and
- * FunctionNode classes. Note that this is trusted code and access to such
- * internal package classes and methods is okay. But, if you modify any 
- * Compiler or FunctionNode class, you may have to revisit this script.
- * We cannot use direct Java class (via dynalink bean linker) to Compiler
- * and FunctionNode because of package-access check and so reflective calls.
- */
-
-var Parser            = Java.type("jdk.nashorn.internal.parser.Parser")
-var Compiler          = Java.type("jdk.nashorn.internal.codegen.Compiler")
-var Context           = Java.type("jdk.nashorn.internal.runtime.Context")
-var ScriptEnvironment = Java.type("jdk.nashorn.internal.runtime.ScriptEnvironment")
-var Source            = Java.type("jdk.nashorn.internal.runtime.Source")
-var FunctionNode      = Java.type("jdk.nashorn.internal.ir.FunctionNode")
-var ThrowErrorManager = Java.type("jdk.nashorn.internal.runtime.Context$ThrowErrorManager");
-
-// Compiler class methods and fields
-var parseMethod = Parser.class.getMethod("parse");
-var compileMethod = Compiler.class.getMethod("compile");
-
-// NOTE: private field. But this is a trusted test!
-// Compiler.functionNode
-var functionNodeField = Compiler.class.getDeclaredField("functionNode");
-functionNodeField.setAccessible(true);
-
-// FunctionNode methods
-
-// FunctionNode.getFunctions method
-var getFunctionsMethod = FunctionNode.class.getMethod("getFunctions");
-
-// These are method names of methods in FunctionNode class
-var allAssertionList = ['isVarArg', 'needsParentScope', 'needsCallee', 'needsScope', 'needsSelfSymbol', 'isSplit', 'hasEval', 'hasWith', 'hasDeepWithOrEval', 'allVarsInScope', 'isStrictMode']
-
-// corresponding Method objects of FunctionNode class
-var functionNodeMethods = {};
-// initialize FunctionNode methods
-(function() {
-    for (var f in allAssertionList) {
-        var method = allAssertionList[f];
-        functionNodeMethods[method] = FunctionNode.class.getMethod(method);
-    }
-})();
-
-// returns "script" functionNode from Compiler instance
-function getScriptNode(compiler) {
-    // compiler.functionNode
-    return functionNodeField.get(compiler);
-}
-
-// returns functionNode.getFunctions().get(0)
-function getFirstFunction(functionNode) {
-    // functionNode.getFunctions().get(0)
-    return getFunctionsMethod.invoke(functionNode).get(0);
-}
-
-// compile(script) -- compiles a script specified as a string with its 
-// source code, returns a jdk.nashorn.internal.ir.FunctionNode object 
-// representing it.
-function compile(source) {
-    var source   = new Source("<no name>", source);
-    var parser   = new Parser(Context.getContext().getEnv(), source, new ThrowErrorManager());
-    var func     = parseMethod.invoke(parser);
-    var compiler = new Compiler(Context.getContext().getEnv(), func);
-
-    compileMethod.invoke(compiler);
-
-    return getScriptNode(compiler);
-};
-
-var allAssertions = (function() {
-    var allAssertions = {}
-    for(var assertion in allAssertionList) {
-        allAssertions[allAssertionList[assertion]] = true
-    }
-    return allAssertions;
-})();
-
-
-// test(f[, assertions...]) tests whether all the specified assertions on the
-// passed function node are true.
-function test(f) {
-    var assertions = {}
-    for(var i = 1; i < arguments.length; ++i) {
-        var assertion = arguments[i]
-        if(!allAssertions[assertion]) {
-            throw "Unknown assertion " + assertion + " for " + f;
-        }
-        assertions[assertion] = true
-    }
-    for(var assertion in allAssertions) {
-        var expectedValue = !!assertions[assertion]
-        if(functionNodeMethods[assertion].invoke(f) !== expectedValue) {
-            throw "Expected " + assertion + " === " + expectedValue + " for " + f;
-        }
-    }
-}
-
-// testFirstFn(script[, assertions...] tests whether all the specified
-// assertions are true in the first function in the given script; "script"
-// is a string with the source text of the script.
-function testFirstFn(script) {
-    arguments[0] = getFirstFunction(compile(script))
-    test.apply(null, arguments)
-}
-
-// ---------------------------------- ACTUAL TESTS START HERE --------------
-
-// The simplest possible functions have no attributes set
-testFirstFn("function f() { }")
-testFirstFn("function f(x) { x }")
-
-// A function referencing a global needs parent scope, and it needs callee
-// (because parent scope is passed through callee)
-testFirstFn("function f() { x }", 'needsCallee', 'needsParentScope')
-
-// A function referencing "arguments" will have to be vararg. It also needs
-// the callee, as it needs to fill out "arguments.callee".
-testFirstFn("function f() { arguments }", 'needsCallee', 'isVarArg')
-
-// A function referencing "arguments" will have to be vararg. If it is
-// strict, it will not have to have a callee, though.
-testFirstFn("function f() {'use strict'; arguments }", 'isVarArg', 'isStrictMode')
-
-// A function defining "arguments" as a parameter will not be vararg.
-testFirstFn("function f(arguments) { arguments }")
-
-// A function defining "arguments" as a nested function will not be vararg.
-testFirstFn("function f() { function arguments() {}; arguments; }")
-
-// A function defining "arguments" as a local variable will be vararg.
-testFirstFn("function f() { var arguments; arguments; }", 'isVarArg', 'needsCallee')
-
-// A self-referencing function defined as a statement doesn't need a self 
-// symbol, as it'll rather obtain itself from the parent scope.
-testFirstFn("function f() { f() }", 'needsCallee', 'needsParentScope')
-
-// A self-referencing function defined as an expression needs a self symbol,
-// as it can't obtain itself from the parent scope.
-testFirstFn("(function f() { f() })", 'needsCallee', 'needsSelfSymbol')
-
-// A child function accessing parent's variable triggers the need for scope
-// in parent
-testFirstFn("(function f() { var x; function g() { x } })", 'needsScope')
-
-// A child function accessing parent's parameter triggers the need for scope
-// in parent
-testFirstFn("(function f(x) { function g() { x } })", 'needsScope')
-
-// A child function accessing a global variable triggers the need for parent
-// scope in parent
-testFirstFn("(function f() { function g() { x } })", 'needsParentScope', 'needsCallee')
-
-// A child function redefining a local variable from its parent should not 
-// affect the parent function in any way
-testFirstFn("(function f() { var x; function g() { var x; x } })")
-
-// Using "with" unleashes a lot of needs: parent scope, callee, own scope, 
-// and all variables in scope. Actually, we could make "with" less wasteful,
-// and only put those variables in scope that it actually references, similar
-// to what nested functions do with variables in their parents.
-testFirstFn("(function f() { var o; with(o) {} })", 'needsParentScope', 'needsCallee', 'needsScope', 'hasWith', 'hasDeepWithOrEval', 'allVarsInScope')
-
-// Using "eval" is as bad as using "with" with the added requirement of
-// being vararg, 'cause we don't know if eval will be using "arguments".
-testFirstFn("(function f() { eval() })", 'needsParentScope', 'needsCallee', 'needsScope', 'hasEval', 'isVarArg', 'hasDeepWithOrEval', 'allVarsInScope')
-
-// Nested function using "with" is pretty much the same as the parent
-// function needing with.
-testFirstFn("(function f() { function g() { var o; with(o) {} } })", 'needsParentScope', 'needsCallee', 'needsScope', 'hasDeepWithOrEval', 'allVarsInScope')
-// Nested function using "eval" is almost the same as parent function using
-// eval, but at least the parent doesn't have to be vararg.
-testFirstFn("(function f() { function g() { eval() } })", 'needsParentScope', 'needsCallee', 'needsScope', 'hasDeepWithOrEval', 'allVarsInScope')
-
-// Function with 250 named parameters is ordinary
-testFirstFn("function f(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127, p128, p129, p130, p131, p132, p133, p134, p135, p136, p137, p138, p139, p140, p141, p142, p143, p144, p145, p146, p147, p148, p149, p150, p151, p152, p153, p154, p155, p156, p157, p158, p159, p160, p161, p162, p163, p164, p165, p166, p167, p168, p169, p170, p171, p172, p173, p174, p175, p176, p177, p178, p179, p180, p181, p182, p183, p184, p185, p186, p187, p188, p189, p190, p191, p192, p193, p194, p195, p196, p197, p198, p199, p200, p201, p202, p203, p204, p205, p206, p207, p208, p209, p210, p211, p212, p213, p214, p215, p216, p217, p218, p219, p220, p221, p222, p223, p224, p225, p226, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p240, p241, p242, p243, p244, p245, p246, p247, p248, p249, p250) { p250 = p249 }")
-
-// Function with 251 named parameters is variable arguments
-testFirstFn("function f(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127, p128, p129, p130, p131, p132, p133, p134, p135, p136, p137, p138, p139, p140, p141, p142, p143, p144, p145, p146, p147, p148, p149, p150, p151, p152, p153, p154, p155, p156, p157, p158, p159, p160, p161, p162, p163, p164, p165, p166, p167, p168, p169, p170, p171, p172, p173, p174, p175, p176, p177, p178, p179, p180, p181, p182, p183, p184, p185, p186, p187, p188, p189, p190, p191, p192, p193, p194, p195, p196, p197, p198, p199, p200, p201, p202, p203, p204, p205, p206, p207, p208, p209, p210, p211, p212, p213, p214, p215, p216, p217, p218, p219, p220, p221, p222, p223, p224, p225, p226, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p240, p241, p242, p243, p244, p245, p246, p247, p248, p249, p250, p251) { p250 = p251 }", 'isVarArg')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/error/JDK-8020437-2.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8020437: Wrong handling of line numbers with multiline string literals
+ *
+ * @test/compile-error
+ * @option -scripting
+ */
+
+print({
+   text: <<EOF
+This is a multiple line
+text inside a sting literal.
+Run this with -scripting option.
+EOF}); var x++; // syntax error in same line
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/error/JDK-8020437-2.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+test/script/error/JDK-8020437-2.js:36:12 Expected ; but found ++
+EOF}); var x++; // syntax error in same line
+            ^
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/error/JDK-8020437.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please 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-8020437: Wrong handling of line numbers with multiline string literals
+ *
+ * @test/compile-error
+ * @option -scripting
+ */
+
+print({
+   text: <<EOF
+This is a multiple line
+text inside a sting literal.
+Run this with -scripting option.
+EOF);  // missing "}" to end object literal
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/error/JDK-8020437.js.EXPECTED	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,3 @@
+test/script/error/JDK-8020437.js:36:3 Expected comma but found )
+EOF);  // missing "}" to end object literal
+   ^
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/trusted/JDK-8006529.js	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8006529 : Methods should not always get callee parameter, and they
+ * should not be too eager in creation of scopes.
+ *
+ * @test
+ * @run
+ */
+
+/*
+ * This test script depends on nashorn Compiler internals. It uses reflection
+ * to get access to private field and many public methods of Compiler and
+ * FunctionNode classes. Note that this is trusted code and access to such
+ * internal package classes and methods is okay. But, if you modify any 
+ * Compiler or FunctionNode class, you may have to revisit this script.
+ * We cannot use direct Java class (via dynalink bean linker) to Compiler
+ * and FunctionNode because of package-access check and so reflective calls.
+ */
+
+var Parser              = Java.type("jdk.nashorn.internal.parser.Parser")
+var Compiler            = Java.type("jdk.nashorn.internal.codegen.Compiler")
+var Context             = Java.type("jdk.nashorn.internal.runtime.Context")
+var ScriptEnvironment   = Java.type("jdk.nashorn.internal.runtime.ScriptEnvironment")
+var Source              = Java.type("jdk.nashorn.internal.runtime.Source")
+var FunctionNode        = Java.type("jdk.nashorn.internal.ir.FunctionNode")
+var Block               = Java.type("jdk.nashorn.internal.ir.Block")
+var VarNode             = Java.type("jdk.nashorn.internal.ir.VarNode")
+var ExpressionStatement = Java.type("jdk.nashorn.internal.ir.ExpressionStatement")
+var UnaryNode           = Java.type("jdk.nashorn.internal.ir.UnaryNode")
+var BinaryNode          = Java.type("jdk.nashorn.internal.ir.BinaryNode")
+var ThrowErrorManager   = Java.type("jdk.nashorn.internal.runtime.Context$ThrowErrorManager")
+var Debug               = Java.type("jdk.nashorn.internal.runtime.Debug")
+
+var parseMethod = Parser.class.getMethod("parse");
+var compileMethod = Compiler.class.getMethod("compile", FunctionNode.class);
+var getBodyMethod = FunctionNode.class.getMethod("getBody");
+var getStatementsMethod = Block.class.getMethod("getStatements");
+var getInitMethod = VarNode.class.getMethod("getInit");
+var getExpressionMethod = ExpressionStatement.class.getMethod("getExpression")
+var rhsMethod = UnaryNode.class.getMethod("rhs")
+var lhsMethod = BinaryNode.class.getMethod("lhs")
+var binaryRhsMethod = BinaryNode.class.getMethod("rhs")
+var debugIdMethod = Debug.class.getMethod("id", java.lang.Object.class)
+
+// These are method names of methods in FunctionNode class
+var allAssertionList = ['isVarArg', 'needsParentScope', 'needsCallee', 'hasScopeBlock', 'needsSelfSymbol', 'isSplit', 'hasEval', 'allVarsInScope', 'isStrict']
+
+// corresponding Method objects of FunctionNode class
+var functionNodeMethods = {};
+// initialize FunctionNode methods
+(function() {
+    for (var f in allAssertionList) {
+        var method = allAssertionList[f];
+        functionNodeMethods[method] = FunctionNode.class.getMethod(method);
+    }
+})();
+
+// returns functionNode.getBody().getStatements().get(0)
+function getFirstFunction(functionNode) {
+    var f = findFunction(getBodyMethod.invoke(functionNode))
+    if (f == null) {
+        throw new Error();
+    }
+    return f;
+}
+
+function findFunction(node) {
+    if(node instanceof Block) {
+        var stmts = getStatementsMethod.invoke(node)
+        for(var i = 0; i < stmts.size(); ++i) {
+            var retval = findFunction(stmts.get(i))
+            if(retval != null) {
+                return retval;
+            }
+        }
+    } else if(node instanceof VarNode) {
+        return findFunction(getInitMethod.invoke(node))
+    } else if(node instanceof UnaryNode) {
+        return findFunction(rhsMethod.invoke(node))
+    } else if(node instanceof BinaryNode) {
+        return findFunction(lhsMethod.invoke(node)) || findFunction(binaryRhsMethod.invoke(node))
+	} else if(node instanceof ExpressionStatement) {
+		return findFunction(getExpressionMethod.invoke(node))
+    } else if(node instanceof FunctionNode) {
+        return node
+    }
+}
+
+var getContextMethod = Context.class.getMethod("getContext")
+var getEnvMethod = Context.class.getMethod("getEnv")
+
+// compile(script) -- compiles a script specified as a string with its 
+// source code, returns a jdk.nashorn.internal.ir.FunctionNode object 
+// representing it.
+function compile(source) {
+    var source   = new Source("<no name>", source);
+
+    var env = getEnvMethod.invoke(getContextMethod.invoke(null))
+
+    var parser   = new Parser(env, source, new ThrowErrorManager());
+    var func     = parseMethod.invoke(parser);
+
+    var compiler = new Compiler(env);
+
+    return compileMethod.invoke(compiler, func);
+};
+
+var allAssertions = (function() {
+    var allAssertions = {}
+    for(var assertion in allAssertionList) {
+        allAssertions[allAssertionList[assertion]] = true
+    }
+    return allAssertions;
+})();
+
+
+// test(f[, assertions...]) tests whether all the specified assertions on the
+// passed function node are true.
+function test(f) {
+    var assertions = {}
+    for(var i = 1; i < arguments.length; ++i) {
+        var assertion = arguments[i]
+        if(!allAssertions[assertion]) {
+            throw "Unknown assertion " + assertion + " for " + f;
+        }
+        assertions[assertion] = true
+    }
+    for(var assertion in allAssertions) {
+        var expectedValue = !!assertions[assertion]
+        var actualValue = functionNodeMethods[assertion].invoke(f)
+        if(actualValue !== expectedValue) {
+            throw "Expected " + assertion + " === " + expectedValue + ", got " + actualValue + " for " + f + ":" + debugIdMethod.invoke(null, f);
+        }
+    }
+}
+
+// testFirstFn(script[, assertions...] tests whether all the specified
+// assertions are true in the first function in the given script; "script"
+// is a string with the source text of the script.
+function testFirstFn(script) {
+    arguments[0] = getFirstFunction(compile(script))
+    test.apply(null, arguments)
+}
+
+// ---------------------------------- ACTUAL TESTS START HERE --------------
+
+// The simplest possible functions have no attributes set
+testFirstFn("function f() { }")
+testFirstFn("function f(x) { x }")
+
+// A function referencing a global needs parent scope, and it needs callee
+// (because parent scope is passed through callee)
+testFirstFn("function f() { x }", 'needsCallee', 'needsParentScope')
+
+// A function referencing "arguments" will have to be vararg. It also needs
+// the callee, as it needs to fill out "arguments.callee".
+testFirstFn("function f() { arguments }", 'needsCallee', 'isVarArg')
+
+// A function referencing "arguments" will have to be vararg. If it is
+// strict, it will not have to have a callee, though.
+testFirstFn("function f() {'use strict'; arguments }", 'isVarArg', 'isStrict')
+
+// A function defining "arguments" as a parameter will not be vararg.
+testFirstFn("function f(arguments) { arguments }")
+
+// A function defining "arguments" as a nested function will not be vararg.
+testFirstFn("function f() { function arguments() {}; arguments; }")
+
+// A function defining "arguments" as a local variable will be vararg.
+testFirstFn("function f() { var arguments; arguments; }", 'isVarArg', 'needsCallee')
+
+// A self-referencing function defined as a statement doesn't need a self 
+// symbol, as it'll rather obtain itself from the parent scope.
+testFirstFn("function f() { f() }", 'needsCallee', 'needsParentScope')
+
+// A self-referencing function defined as an expression needs a self symbol,
+// as it can't obtain itself from the parent scope.
+testFirstFn("(function f() { f() })", 'needsCallee', 'needsSelfSymbol')
+
+// A child function accessing parent's variable triggers the need for scope
+// in parent
+testFirstFn("(function f() { var x; function g() { x } })", 'hasScopeBlock')
+
+// A child function accessing parent's parameter triggers the need for scope
+// in parent
+testFirstFn("(function f(x) { function g() { x } })", 'hasScopeBlock')
+
+// A child function accessing a global variable triggers the need for parent
+// scope in parent
+testFirstFn("(function f() { function g() { x } })", 'needsParentScope', 'needsCallee')
+
+// A child function redefining a local variable from its parent should not 
+// affect the parent function in any way
+testFirstFn("(function f() { var x; function g() { var x; x } })")
+
+// Using "with" on its own doesn't do much.
+testFirstFn("(function f() { var o; with(o) {} })")
+
+// "with" referencing a local variable triggers scoping.
+testFirstFn("(function f() { var x; var y; with(x) { y } })", 'hasScopeBlock')
+
+// "with" referencing a non-local variable triggers parent scope.
+testFirstFn("(function f() { var x; with(x) { y } })", 'needsCallee', 'needsParentScope')
+
+// Nested function using "with" is pretty much the same as the parent
+// function needing with.
+testFirstFn("(function f() { function g() { var o; with(o) {} } })")
+
+// Nested function using "with" referencing a local variable.
+testFirstFn("(function f() { var x; function g() { var o; with(o) { x } } })", 'hasScopeBlock')
+
+// Using "eval" triggers pretty much everything. The function even needs to be
+// vararg, 'cause we don't know if eval will be using "arguments".
+testFirstFn("(function f() { eval() })", 'needsParentScope', 'needsCallee', 'hasScopeBlock', 'hasEval', 'isVarArg', 'allVarsInScope')
+
+// Nested function using "eval" is almost the same as parent function using
+// eval, but at least the parent doesn't have to be vararg.
+testFirstFn("(function f() { function g() { eval() } })", 'needsParentScope', 'needsCallee', 'hasScopeBlock', 'allVarsInScope')
+
+// Function with 250 named parameters is ordinary
+testFirstFn("function f(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127, p128, p129, p130, p131, p132, p133, p134, p135, p136, p137, p138, p139, p140, p141, p142, p143, p144, p145, p146, p147, p148, p149, p150, p151, p152, p153, p154, p155, p156, p157, p158, p159, p160, p161, p162, p163, p164, p165, p166, p167, p168, p169, p170, p171, p172, p173, p174, p175, p176, p177, p178, p179, p180, p181, p182, p183, p184, p185, p186, p187, p188, p189, p190, p191, p192, p193, p194, p195, p196, p197, p198, p199, p200, p201, p202, p203, p204, p205, p206, p207, p208, p209, p210, p211, p212, p213, p214, p215, p216, p217, p218, p219, p220, p221, p222, p223, p224, p225, p226, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p240, p241, p242, p243, p244, p245, p246, p247, p248, p249, p250) { p250 = p249 }")
+
+// Function with 251 named parameters is variable arguments
+testFirstFn("function f(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127, p128, p129, p130, p131, p132, p133, p134, p135, p136, p137, p138, p139, p140, p141, p142, p143, p144, p145, p146, p147, p148, p149, p150, p151, p152, p153, p154, p155, p156, p157, p158, p159, p160, p161, p162, p163, p164, p165, p166, p167, p168, p169, p170, p171, p172, p173, p174, p175, p176, p177, p178, p179, p180, p181, p182, p183, p184, p185, p186, p187, p188, p189, p190, p191, p192, p193, p194, p195, p196, p197, p198, p199, p200, p201, p202, p203, p204, p205, p206, p207, p208, p209, p210, p211, p212, p213, p214, p215, p216, p217, p218, p219, p220, p221, p222, p223, p224, p225, p226, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p240, p241, p242, p243, p244, p245, p246, p247, p248, p249, p250, p251) { p250 = p251 }", 'isVarArg')
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineSecurityTest.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineSecurityTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -27,7 +27,10 @@
 
 import static org.testng.Assert.fail;
 
+import java.util.Objects;
+import javax.script.Invocable;
 import javax.script.ScriptEngine;
+import javax.script.ScriptException;
 import javax.script.ScriptEngineManager;
 import org.testng.annotations.Test;
 
@@ -44,6 +47,7 @@
     public void securityPackagesTest() {
         if (System.getSecurityManager() == null) {
             // pass vacuously
+            return;
         }
 
         final ScriptEngineManager m = new ScriptEngineManager();
@@ -64,6 +68,7 @@
     public void securityJavaTypeTest() {
         if (System.getSecurityManager() == null) {
             // pass vacuously
+            return;
         }
 
         final ScriptEngineManager m = new ScriptEngineManager();
@@ -84,6 +89,7 @@
     public void securityClassForNameTest() {
         if (System.getSecurityManager() == null) {
             // pass vacuously
+            return;
         }
 
         final ScriptEngineManager m = new ScriptEngineManager();
@@ -104,6 +110,7 @@
     public void securitySystemExit() {
         if (System.getSecurityManager() == null) {
             // pass vacuously
+            return;
         }
 
         final ScriptEngineManager m = new ScriptEngineManager();
@@ -124,6 +131,7 @@
     public void securitySystemLoadLibrary() {
         if (System.getSecurityManager() == null) {
             // pass vacuously
+            return;
         }
 
         final ScriptEngineManager m = new ScriptEngineManager();
@@ -139,4 +147,40 @@
             }
         }
     }
+
+    @Test
+    /**
+     * Check that script can't implement sensitive package interfaces.
+     */
+    public void checkSensitiveInterfaceImplTest() throws ScriptException {
+        if (System.getSecurityManager() == null) {
+            // pass vacuously
+            return;
+        }
+
+        final ScriptEngineManager m = new ScriptEngineManager();
+        final ScriptEngine e = m.getEngineByName("nashorn");
+        final Object[] holder = new Object[1];
+        e.put("holder", holder);
+        // put an empty script object into array
+        e.eval("holder[0] = {}");
+        // holder[0] is an object of some subclass of ScriptObject
+        Class ScriptObjectClass = holder[0].getClass().getSuperclass();
+        Class PropertyAccessClass = ScriptObjectClass.getInterfaces()[0];
+        // implementation methods for PropertyAccess class
+        e.eval("function set() {}; function get() {}; function getInt(){} " +
+               "function getDouble(){}; function getLong() {}; " +
+               "this.delete = function () {}; function has() {}; " +
+               "function hasOwnProperty() {}");
+
+        // get implementation of a restricted package interface
+        try {
+            log(Objects.toString(((Invocable)e).getInterface((Class<?>)PropertyAccessClass)));
+            fail("should have thrown SecurityException");
+        } catch (final Exception exp) {
+            if (! (exp instanceof SecurityException)) {
+                fail("SecurityException expected, got " + exp);
+            }
+        }
+    }
 }
--- a/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -36,6 +36,7 @@
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.Callable;
 import javax.script.Bindings;
 import javax.script.Compilable;
@@ -345,6 +346,23 @@
     }
 
     @Test
+    /**
+     * Try passing non-interface Class object for interface implementation.
+     */
+    public void getNonInterfaceGetInterfaceTest() {
+        final ScriptEngineManager manager = new ScriptEngineManager();
+        final ScriptEngine engine = manager.getEngineByName("nashorn");
+        try {
+            log(Objects.toString(((Invocable)engine).getInterface(Object.class)));
+            fail("Should have thrown IllegalArgumentException");
+        } catch (final Exception exp) {
+            if (! (exp instanceof IllegalArgumentException)) {
+                fail("IllegalArgumentException expected, got " + exp);
+            }
+        }
+    }
+
+    @Test
     public void accessGlobalTest() {
         final ScriptEngineManager m = new ScriptEngineManager();
         final ScriptEngine e = m.getEngineByName("nashorn");
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/TrustedScriptEngineTest.java	Fri Jul 26 14:07:32 2013 -0700
@@ -145,4 +145,55 @@
 
         fail("Cannot find nashorn factory!");
     }
+
+    @Test
+    /**
+     * Test repeated evals with --loader-per-compile=false
+     * We used to get "class redefinition error".
+     */
+    public void noLoaderPerCompilerTest() {
+        final ScriptEngineManager sm = new ScriptEngineManager();
+        for (ScriptEngineFactory fac : sm.getEngineFactories()) {
+            if (fac instanceof NashornScriptEngineFactory) {
+                final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+                final String[] options = new String[] { "--loader-per-compile=false" };
+                final ScriptEngine e = nfac.getScriptEngine(options);
+                try {
+                    e.eval("2 + 3");
+                    e.eval("4 + 4");
+                } catch (final ScriptException se) {
+                    se.printStackTrace();
+                    fail(se.getMessage());
+                }
+                return;
+            }
+        }
+        fail("Cannot find nashorn factory!");
+    }
+
+    @Test
+    /**
+     * Test that we can use same script name in repeated evals with --loader-per-compile=false
+     * We used to get "class redefinition error" as name was derived from script name.
+     */
+    public void noLoaderPerCompilerWithSameNameTest() {
+        final ScriptEngineManager sm = new ScriptEngineManager();
+        for (ScriptEngineFactory fac : sm.getEngineFactories()) {
+            if (fac instanceof NashornScriptEngineFactory) {
+                final NashornScriptEngineFactory nfac = (NashornScriptEngineFactory)fac;
+                final String[] options = new String[] { "--loader-per-compile=false" };
+                final ScriptEngine e = nfac.getScriptEngine(options);
+                e.put(ScriptEngine.FILENAME, "test.js");
+                try {
+                    e.eval("2 + 3");
+                    e.eval("4 + 4");
+                } catch (final ScriptException se) {
+                    se.printStackTrace();
+                    fail(se.getMessage());
+                }
+                return;
+            }
+        }
+        fail("Cannot find nashorn factory!");
+    }
 }
--- a/nashorn/test/src/jdk/nashorn/test/models/OuterClass.java	Fri Jul 26 10:12:14 2013 +0200
+++ b/nashorn/test/src/jdk/nashorn/test/models/OuterClass.java	Fri Jul 26 14:07:32 2013 -0700
@@ -33,6 +33,10 @@
     }
 
     public static class InnerStaticClass {
+
+        public static class InnerInnerStaticClass {
+        }
+
         private final String value;
 
         public InnerStaticClass(String value) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/src/jdk/nashorn/test/models/PropertyBind.java	Fri Jul 26 14:07:32 2013 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.test.models;
+
+public class PropertyBind {
+    public static int publicStaticInt;
+    public static final int publicStaticFinalInt = 2112;
+
+    private static int staticReadWrite;
+    private static int staticReadOnly = 1230;
+    private static int staticWriteOnly;
+
+    public int publicInt;
+    public final int publicFinalInt = 42;
+
+    private int readWrite;
+    private int readOnly = 123;
+    private int writeOnly;
+
+    public int getReadWrite() {
+        return readWrite;
+    }
+
+    public void setReadWrite(int readWrite) {
+        this.readWrite = readWrite;
+    }
+
+    public int getReadOnly() {
+        return readOnly;
+    }
+
+    public void setWriteOnly(int writeOnly) {
+        this.writeOnly = writeOnly;
+    }
+
+    public int peekWriteOnly() {
+        return writeOnly;
+    }
+
+    public static int getStaticReadWrite() {
+        return staticReadWrite;
+    }
+
+    public static void setStaticReadWrite(int staticReadWrite) {
+        PropertyBind.staticReadWrite = staticReadWrite;
+    }
+
+    public static int getStaticReadOnly() {
+        return staticReadOnly;
+    }
+
+    public static void setStaticWriteOnly(int staticWriteOnly) {
+        PropertyBind.staticWriteOnly = staticWriteOnly;
+    }
+
+    public static int peekStaticWriteOnly() {
+        return PropertyBind.staticWriteOnly;
+    }
+}