changeset 44938:ca6e2248ebbc

Merge
author duke
date Wed, 05 Jul 2017 23:21:47 +0200
parents a5c0bfac4b0b 1a0cba08a6cb
children 52511ad44be2
files jdk/make/CopySamples.gmk jdk/src/demo/share/jvmti/agent_util/README.txt jdk/src/demo/share/jvmti/agent_util/agent_util.c jdk/src/demo/share/jvmti/agent_util/agent_util.h jdk/src/demo/share/jvmti/compiledMethodLoad/README.txt jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c jdk/src/demo/share/jvmti/compiledMethodLoad/sample.makefile.txt jdk/src/demo/share/jvmti/gctest/README.txt jdk/src/demo/share/jvmti/gctest/gctest.c jdk/src/demo/share/jvmti/gctest/sample.makefile.txt jdk/src/demo/share/jvmti/heapTracker/HeapTracker.java jdk/src/demo/share/jvmti/heapTracker/README.txt jdk/src/demo/share/jvmti/heapTracker/heapTracker.c jdk/src/demo/share/jvmti/heapTracker/heapTracker.h jdk/src/demo/share/jvmti/heapTracker/sample.makefile.txt jdk/src/demo/share/jvmti/heapViewer/README.txt jdk/src/demo/share/jvmti/heapViewer/heapViewer.c jdk/src/demo/share/jvmti/heapViewer/sample.makefile.txt jdk/src/demo/share/jvmti/index.html jdk/src/demo/share/jvmti/java_crw_demo/README.txt jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.c jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.h jdk/src/demo/share/jvmti/java_crw_demo/sample.makefile.txt jdk/src/demo/share/jvmti/minst/Minst.java jdk/src/demo/share/jvmti/minst/README.txt jdk/src/demo/share/jvmti/minst/minst.c jdk/src/demo/share/jvmti/minst/minst.h jdk/src/demo/share/jvmti/minst/sample.makefile.txt jdk/src/demo/share/jvmti/mtrace/Mtrace.java jdk/src/demo/share/jvmti/mtrace/README.txt jdk/src/demo/share/jvmti/mtrace/mtrace.c jdk/src/demo/share/jvmti/mtrace/mtrace.h jdk/src/demo/share/jvmti/mtrace/sample.makefile.txt jdk/src/demo/share/jvmti/versionCheck/README.txt jdk/src/demo/share/jvmti/versionCheck/sample.makefile.txt jdk/src/demo/share/jvmti/versionCheck/versionCheck.c jdk/src/demo/share/jvmti/waiters/Agent.cpp jdk/src/demo/share/jvmti/waiters/Agent.hpp jdk/src/demo/share/jvmti/waiters/Monitor.cpp jdk/src/demo/share/jvmti/waiters/Monitor.hpp jdk/src/demo/share/jvmti/waiters/README.txt jdk/src/demo/share/jvmti/waiters/Thread.cpp jdk/src/demo/share/jvmti/waiters/Thread.hpp jdk/src/demo/share/jvmti/waiters/sample.makefile.txt jdk/src/demo/share/jvmti/waiters/waiters.cpp jdk/src/demo/share/management/FullThreadDump/Deadlock.java jdk/src/demo/share/management/FullThreadDump/FullThreadDump.java jdk/src/demo/share/management/FullThreadDump/README.txt jdk/src/demo/share/management/FullThreadDump/ThreadMonitor.java jdk/src/demo/share/management/JTop/JTop.java jdk/src/demo/share/management/JTop/JTopPlugin.java jdk/src/demo/share/management/JTop/META-INF/services/com.sun.tools.jconsole.JConsolePlugin jdk/src/demo/share/management/JTop/README.txt jdk/src/demo/share/management/MemoryMonitor/MemoryMonitor.java jdk/src/demo/share/management/MemoryMonitor/README.txt jdk/src/demo/share/management/VerboseGC/PrintGCStat.java jdk/src/demo/share/management/VerboseGC/README.txt jdk/src/demo/share/management/VerboseGC/VerboseGC.java jdk/src/demo/share/management/index.html jdk/src/demo/share/scripting/jconsole-plugin/README.txt jdk/src/demo/share/scripting/jconsole-plugin/build.xml jdk/src/demo/share/scripting/jconsole-plugin/src/META-INF/services/com.sun.tools.jconsole.JConsolePlugin jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java jdk/src/demo/share/scripting/jconsole-plugin/src/resources/jconsole.js jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/heapdump.js jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/hello.js jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/invoke.js jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jstack.js jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jtop.js jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/sysprops.js jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/verbose.js jdk/src/demo/solaris/jni/Poller/Client.java jdk/src/demo/solaris/jni/Poller/LinkedQueue.java jdk/src/demo/solaris/jni/Poller/Poller.c jdk/src/demo/solaris/jni/Poller/Poller.java jdk/src/demo/solaris/jni/Poller/PollingServer.java jdk/src/demo/solaris/jni/Poller/README.txt jdk/src/demo/solaris/jni/Poller/SimpleServer.java jdk/src/java.management/share/classes/mgmt-overview.html jdk/src/java.security.jgss/share/classes/jgss-overview.html jdk/src/jdk.jdi/share/classes/jdi-overview.html jdk/src/jdk.security.auth/share/classes/jaas-overview.html jdk/src/sample/share/README jdk/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/Device.java jdk/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml jdk/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/Module.java jdk/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/PluginChecker.java jdk/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/Require.java jdk/src/sample/share/annotations/DependencyChecker/PluginChecker/src/checker/RequireContainer.java jdk/src/sample/share/annotations/DependencyChecker/Plugins/src/plugins/BoilerPlugin.java jdk/src/sample/share/annotations/DependencyChecker/Plugins/src/plugins/ExtendedBoilerPlugin.java jdk/src/sample/share/annotations/DependencyChecker/Plugins/src/plugins/TimerPlugin.java jdk/src/sample/share/annotations/Validator/src/PositiveIntegerSupplier.java jdk/src/sample/share/annotations/Validator/src/SupplierValidator.java jdk/src/sample/share/annotations/Validator/src/Validate.java jdk/src/sample/share/annotations/Validator/src/Validator.java jdk/src/sample/share/annotations/index.html jdk/src/sample/share/forkjoin/mergesort/MergeDemo.java jdk/src/sample/share/forkjoin/mergesort/MergeSort.java jdk/src/sample/share/jmx/jmx-scandir/build.properties jdk/src/sample/share/jmx/jmx-scandir/build.xml jdk/src/sample/share/jmx/jmx-scandir/index.html jdk/src/sample/share/jmx/jmx-scandir/logging.properties jdk/src/sample/share/jmx/jmx-scandir/manifest.mf jdk/src/sample/share/jmx/jmx-scandir/nbproject/file-targets.xml jdk/src/sample/share/jmx/jmx-scandir/nbproject/jdk.xml jdk/src/sample/share/jmx/jmx-scandir/nbproject/netbeans-targets.xml jdk/src/sample/share/jmx/jmx-scandir/nbproject/project.xml jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScanner.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScannerMXBean.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManager.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManagerMXBean.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirAgent.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirClient.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfig.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfigMXBean.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManager.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManagerMXBean.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/DirectoryScannerConfig.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/FileMatch.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultLogConfig.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultRecord.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ScanManagerConfig.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/XmlConfigUtils.java jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/package.html jdk/src/sample/share/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/package.html jdk/src/sample/share/jmx/jmx-scandir/src/etc/access.properties jdk/src/sample/share/jmx/jmx-scandir/src/etc/management.properties jdk/src/sample/share/jmx/jmx-scandir/src/etc/password.properties jdk/src/sample/share/jmx/jmx-scandir/src/etc/testconfig.xml jdk/src/sample/share/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/DirectoryScannerTest.java jdk/src/sample/share/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanDirConfigTest.java jdk/src/sample/share/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanManagerTest.java jdk/src/sample/share/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/TestUtils.java jdk/src/sample/share/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/config/XmlConfigUtilsTest.java jdk/src/sample/share/lambda/BulkDataOperations/index.html jdk/src/sample/share/lambda/BulkDataOperations/src/CSVProcessor.java jdk/src/sample/share/lambda/BulkDataOperations/src/Grep.java jdk/src/sample/share/lambda/BulkDataOperations/src/PasswordGenerator.java jdk/src/sample/share/lambda/BulkDataOperations/src/WC.java jdk/src/sample/share/lambda/DefaultMethods/ArrayIterator.java jdk/src/sample/share/lambda/DefaultMethods/DiamondInheritance.java jdk/src/sample/share/lambda/DefaultMethods/Inheritance.java jdk/src/sample/share/lambda/DefaultMethods/MixIn.java jdk/src/sample/share/lambda/DefaultMethods/Reflection.java jdk/src/sample/share/lambda/DefaultMethods/SimplestUsage.java jdk/src/sample/share/nbproject/project.xml jdk/src/sample/share/nio/chatserver/ChatServer.java jdk/src/sample/share/nio/chatserver/Client.java jdk/src/sample/share/nio/chatserver/ClientReader.java jdk/src/sample/share/nio/chatserver/DataReader.java jdk/src/sample/share/nio/chatserver/MessageReader.java jdk/src/sample/share/nio/chatserver/NameReader.java jdk/src/sample/share/nio/chatserver/README.txt jdk/src/sample/share/nio/file/AclEdit.java jdk/src/sample/share/nio/file/Chmod.java jdk/src/sample/share/nio/file/Copy.java jdk/src/sample/share/nio/file/DiskUsage.java jdk/src/sample/share/nio/file/FileType.java jdk/src/sample/share/nio/file/WatchDir.java jdk/src/sample/share/nio/file/Xdd.java jdk/src/sample/share/nio/multicast/MulticastAddress.java jdk/src/sample/share/nio/multicast/Reader.java jdk/src/sample/share/nio/multicast/Sender.java jdk/src/sample/share/nio/server/AcceptHandler.java jdk/src/sample/share/nio/server/Acceptor.java jdk/src/sample/share/nio/server/B1.java jdk/src/sample/share/nio/server/BN.java jdk/src/sample/share/nio/server/BP.java jdk/src/sample/share/nio/server/ChannelIO.java jdk/src/sample/share/nio/server/ChannelIOSecure.java jdk/src/sample/share/nio/server/Content.java jdk/src/sample/share/nio/server/Dispatcher.java jdk/src/sample/share/nio/server/Dispatcher1.java jdk/src/sample/share/nio/server/DispatcherN.java jdk/src/sample/share/nio/server/FileContent.java jdk/src/sample/share/nio/server/Handler.java jdk/src/sample/share/nio/server/MalformedRequestException.java jdk/src/sample/share/nio/server/N1.java jdk/src/sample/share/nio/server/N2.java jdk/src/sample/share/nio/server/README.txt jdk/src/sample/share/nio/server/Reply.java jdk/src/sample/share/nio/server/Request.java jdk/src/sample/share/nio/server/RequestHandler.java jdk/src/sample/share/nio/server/RequestServicer.java jdk/src/sample/share/nio/server/Sendable.java jdk/src/sample/share/nio/server/Server.java jdk/src/sample/share/nio/server/StringContent.java jdk/src/sample/share/nio/server/URLDumper.java jdk/src/sample/share/scripting/scriptpad/README.txt jdk/src/sample/share/scripting/scriptpad/build.properties jdk/src/sample/share/scripting/scriptpad/build.xml jdk/src/sample/share/scripting/scriptpad/nbproject/file-targets.xml jdk/src/sample/share/scripting/scriptpad/nbproject/jdk.xml jdk/src/sample/share/scripting/scriptpad/nbproject/netbeans-targets.xml jdk/src/sample/share/scripting/scriptpad/nbproject/project.xml jdk/src/sample/share/scripting/scriptpad/src/META-INF/manifest.mf jdk/src/sample/share/scripting/scriptpad/src/com/sun/sample/scriptpad/Main.java jdk/src/sample/share/scripting/scriptpad/src/resources/Main.js jdk/src/sample/share/scripting/scriptpad/src/resources/conc.js jdk/src/sample/share/scripting/scriptpad/src/resources/gui.js jdk/src/sample/share/scripting/scriptpad/src/resources/mm.js jdk/src/sample/share/scripting/scriptpad/src/resources/scriptpad.js jdk/src/sample/share/scripting/scriptpad/src/scripts/README.txt jdk/src/sample/share/scripting/scriptpad/src/scripts/browse.js jdk/src/sample/share/scripting/scriptpad/src/scripts/insertfile.js jdk/src/sample/share/scripting/scriptpad/src/scripts/linewrap.js jdk/src/sample/share/scripting/scriptpad/src/scripts/mail.js jdk/src/sample/share/scripting/scriptpad/src/scripts/memmonitor.js jdk/src/sample/share/scripting/scriptpad/src/scripts/memory.bat jdk/src/sample/share/scripting/scriptpad/src/scripts/memory.js jdk/src/sample/share/scripting/scriptpad/src/scripts/memory.sh jdk/src/sample/share/scripting/scriptpad/src/scripts/textcolor.js jdk/src/sample/share/try-with-resources/index.html jdk/src/sample/share/try-with-resources/src/CustomAutoCloseableSample.java jdk/src/sample/share/try-with-resources/src/Unzip.java jdk/src/sample/share/try-with-resources/src/ZipCat.java jdk/src/sample/share/vm/clr-jvm/Makefile jdk/src/sample/share/vm/clr-jvm/README.txt jdk/src/sample/share/vm/clr-jvm/invoked.java jdk/src/sample/share/vm/clr-jvm/invoker.cs jdk/src/sample/share/vm/clr-jvm/jinvoker.cpp jdk/src/sample/share/vm/clr-jvm/jinvokerExp.h jdk/src/sample/share/vm/jvm-clr/Makefile jdk/src/sample/share/vm/jvm-clr/README.txt jdk/src/sample/share/vm/jvm-clr/invoked.cs jdk/src/sample/share/vm/jvm-clr/invoker.cpp jdk/src/sample/share/vm/jvm-clr/invoker.h jdk/src/sample/share/vm/jvm-clr/invoker.java jdk/src/sample/share/vm/jvm-clr/invokerExp.h jdk/src/sample/solaris/dtrace/README.txt jdk/src/sample/solaris/dtrace/helpers/dtrace_helper.d jdk/src/sample/solaris/dtrace/hotspot/README.txt jdk/src/sample/solaris/dtrace/hotspot/class_loading_stat.d jdk/src/sample/solaris/dtrace/hotspot/gc_time_stat.d jdk/src/sample/solaris/dtrace/hotspot/hotspot_calls_tree.d jdk/src/sample/solaris/dtrace/hotspot/method_compile_stat.d jdk/src/sample/solaris/dtrace/hotspot/method_invocation_stat.d jdk/src/sample/solaris/dtrace/hotspot/method_invocation_stat_filter.d jdk/src/sample/solaris/dtrace/hotspot/method_invocation_tree.d jdk/src/sample/solaris/dtrace/hotspot/monitors.d jdk/src/sample/solaris/dtrace/hotspot/object_allocation_stat.d jdk/src/sample/solaris/dtrace/hotspot_jni/CriticalSection.d jdk/src/sample/solaris/dtrace/hotspot_jni/CriticalSection_slow.d jdk/src/sample/solaris/dtrace/hotspot_jni/README.txt jdk/src/sample/solaris/dtrace/hotspot_jni/hotspot_jni_calls_stat.d jdk/src/sample/solaris/dtrace/hotspot_jni/hotspot_jni_calls_tree.d jdk/test/demo/jvmti/Context.java jdk/test/demo/jvmti/DemoRun.java jdk/test/demo/jvmti/HeapUser.java jdk/test/demo/jvmti/Hello.java jdk/test/demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java jdk/test/demo/jvmti/gctest/BigHello.java jdk/test/demo/jvmti/gctest/Gctest.java jdk/test/demo/jvmti/heapTracker/HeapTrackerTest.java jdk/test/demo/jvmti/heapViewer/HeapViewerTest.java jdk/test/demo/jvmti/minst/MinstExample.java jdk/test/demo/jvmti/minst/MinstTest.java jdk/test/demo/jvmti/versionCheck/FailsWhenJvmtiVersionDiffers.java jdk/test/demo/jvmti/waiters/WaitersTest.java jdk/test/java/time/TEST.properties jdk/test/java/util/BitSet/BitSetStreamTest.java jdk/test/jdk/asm/AsmSanity.java
diffstat 772 files changed, 14953 insertions(+), 49585 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags-top-repo	Fri May 05 04:50:17 2017 +0000
+++ b/.hgtags-top-repo	Wed Jul 05 23:21:47 2017 +0200
@@ -400,6 +400,7 @@
 8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154
 688a3863c00ebc089ab17ee1fc46272cbbd96815 jdk-9+155
 783ec7542cf7154e5d2b87f55bb97d28f81e9ada jdk-9+156
+4df5f619c9ead4604d2f97ed231b3a35ec688c41 jdk-10+1
 4eb77fb98952dc477a4229575c81d2263a9ce711 jdk-9+157
 a4087bc10a88a43ea3ad0919b5b4af1c86977221 jdk-9+158
 fe8466adaef8178dba94be53c789a0aaa87d13bb jdk-9+159
@@ -410,3 +411,10 @@
 7810f75d016a52e32295c4233009de5ca90e31af jdk-9+164
 aff4f339acd40942d3dab499846b52acd87b3af1 jdk-9+165
 ba5b16c9c6d80632b61959a33d424b1c3398ce62 jdk-9+166
+35017c286513ddcbcc6b63b99679c604993fc639 jdk-9+167
+143d4c87bc1ef1ed6dadd613cd9dd4488fdefc29 jdk-9+168
+9c7248b787c39b034d4f48d4aa48df903836cca7 jdk-10+2
+06373236a30801f72e2a31ee5c691c2a1e500f57 jdk-10+3
+8ec175c61fc3f58328a3324f07d7ded00e060be3 jdk-10+4
+111e2e7d00f45c983cdbc9c59ae40552152fcc23 jdk-10+5
+03fe61bb7670644cf6e46b5cfafb6b27c0e0157e jdk-10+6
\ No newline at end of file
--- a/common/autoconf/basics.m4	Fri May 05 04:50:17 2017 +0000
+++ b/common/autoconf/basics.m4	Wed Jul 05 23:21:47 2017 +0200
@@ -1095,6 +1095,7 @@
     OTOOL="true"
   fi
   BASIC_PATH_PROGS(READELF, [greadelf readelf])
+  BASIC_PATH_PROGS(DOT, dot)
   BASIC_PATH_PROGS(HG, hg)
   BASIC_PATH_PROGS(STAT, stat)
   BASIC_PATH_PROGS(TIME, time)
--- a/common/autoconf/generated-configure.sh	Fri May 05 04:50:17 2017 +0000
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 23:21:47 2017 +0200
@@ -918,6 +918,7 @@
 INCLUDE_SA
 UNLIMITED_CRYPTO
 CACERTS_FILE
+ENABLE_FULL_DOCS
 ENABLE_HEADLESS_ONLY
 DEFAULT_MAKE_TARGET
 OS_VERSION_MICRO
@@ -936,6 +937,7 @@
 TIME
 STAT
 HG
+DOT
 READELF
 OTOOL
 LDD
@@ -994,9 +996,8 @@
 OPENJDK_TARGET_CPU_ISADIR
 OPENJDK_TARGET_CPU_LEGACY_LIB
 OPENJDK_TARGET_CPU_LEGACY
-REQUIRED_OS_VERSION
-REQUIRED_OS_ARCH
-REQUIRED_OS_NAME
+OPENJDK_MODULE_TARGET_OS_ARCH
+OPENJDK_MODULE_TARGET_OS_NAME
 COMPILE_TYPE
 OPENJDK_TARGET_CPU_ENDIAN
 OPENJDK_TARGET_CPU_BITS
@@ -1139,6 +1140,7 @@
 with_output_sync
 with_default_make_target
 enable_headless_only
+enable_full_docs
 with_cacerts_file
 enable_unlimited_crypto
 with_copyright_year
@@ -1291,6 +1293,7 @@
 LDD
 OTOOL
 READELF
+DOT
 HG
 STAT
 TIME
@@ -1972,6 +1975,8 @@
   --enable-debug          set the debug level to fastdebug (shorthand for
                           --with-debug-level=fastdebug) [disabled]
   --enable-headless-only  only build headless (no GUI) support [disabled]
+  --enable-full-docs      build complete documentation [enabled if all tools
+                          found]
   --disable-unlimited-crypto
                           Disable unlimited crypto policy [enabled]
   --disable-keep-packaged-modules
@@ -2256,6 +2261,7 @@
   LDD         Override default value for LDD
   OTOOL       Override default value for OTOOL
   READELF     Override default value for READELF
+  DOT         Override default value for DOT
   HG          Override default value for HG
   STAT        Override default value for STAT
   TIME        Override default value for TIME
@@ -5177,7 +5183,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1490900744
+DATE_WHEN_GENERATED=1492975963
 
 ###############################################################################
 #
@@ -16025,32 +16031,17 @@
 $as_echo "$COMPILE_TYPE" >&6; }
 
 
-  if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
-    REQUIRED_OS_NAME=SunOS
-    REQUIRED_OS_VERSION=5.10
-  fi
-  if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
-    REQUIRED_OS_NAME=Linux
-    REQUIRED_OS_VERSION=2.6
-  fi
-  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
-    REQUIRED_OS_NAME=Windows
-    if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
-      REQUIRED_OS_VERSION=5.2
-    else
-      REQUIRED_OS_VERSION=5.1
-    fi
-  fi
-  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
-    REQUIRED_OS_NAME="Mac OS X"
-    REQUIRED_OS_VERSION=11.2
-  fi
-  if test "x$OPENJDK_TARGET_OS" = "xaix"; then
-    REQUIRED_OS_NAME=AIX
-    REQUIRED_OS_VERSION=7.1
-  fi
-  REQUIRED_OS_ARCH=${OPENJDK_TARGET_CPU}
-
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    OPENJDK_MODULE_TARGET_OS_NAME="macos"
+  else
+    OPENJDK_MODULE_TARGET_OS_NAME="$OPENJDK_TARGET_OS"
+  fi
+
+  if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+    OPENJDK_MODULE_TARGET_OS_ARCH="amd64"
+  else
+    OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU"
+  fi
 
 
 
@@ -22476,6 +22467,203 @@
   # Publish this variable in the help.
 
 
+  if [ -z "${DOT+x}" ]; then
+    # The variable is not set by user, try to locate tool using the code snippet
+    for ac_prog in dot
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DOT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $DOT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DOT="$DOT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DOT=$ac_cv_path_DOT
+if test -n "$DOT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5
+$as_echo "$DOT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$DOT" && break
+done
+
+  else
+    # The variable is set, but is it from the command line or the environment?
+
+    # Try to remove the string !DOT! from our list.
+    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DOT!/}
+    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
+      # If it failed, the variable was not from the command line. Ignore it,
+      # but warn the user (except for BASH, which is always set by the calling BASH).
+      if test "xDOT" != xBASH; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DOT from the environment. Use command line variables instead." >&5
+$as_echo "$as_me: WARNING: Ignoring value of DOT from the environment. Use command line variables instead." >&2;}
+      fi
+      # Try to locate tool using the code snippet
+      for ac_prog in dot
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DOT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $DOT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DOT="$DOT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DOT=$ac_cv_path_DOT
+if test -n "$DOT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5
+$as_echo "$DOT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$DOT" && break
+done
+
+    else
+      # If it succeeded, then it was overridden by the user. We will use it
+      # for the tool.
+
+      # First remove it from the list of overridden variables, so we can test
+      # for unknown variables in the end.
+      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
+
+      # Check if we try to supply an empty value
+      if test "x$DOT" = x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DOT= (no value)" >&5
+$as_echo "$as_me: Setting user supplied tool DOT= (no value)" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOT" >&5
+$as_echo_n "checking for DOT... " >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+      else
+        # Check if the provided tool contains a complete path.
+        tool_specified="$DOT"
+        tool_basename="${tool_specified##*/}"
+        if test "x$tool_basename" = "x$tool_specified"; then
+          # A command without a complete path is provided, search $PATH.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DOT=$tool_basename" >&5
+$as_echo "$as_me: Will search for user supplied tool DOT=$tool_basename" >&6;}
+          # Extract the first word of "$tool_basename", so it can be a program name with args.
+set dummy $tool_basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_DOT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $DOT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DOT="$DOT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+DOT=$ac_cv_path_DOT
+if test -n "$DOT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5
+$as_echo "$DOT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+          if test "x$DOT" = x; then
+            as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
+          fi
+        else
+          # Otherwise we believe it is a complete path. Use it as it is.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DOT=$tool_specified" >&5
+$as_echo "$as_me: Will use user supplied tool DOT=$tool_specified" >&6;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOT" >&5
+$as_echo_n "checking for DOT... " >&6; }
+          if test ! -x "$tool_specified"; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+            as_fn_error $? "User supplied tool DOT=$tool_specified does not exist or is not executable" "$LINENO" 5
+          fi
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
+$as_echo "$tool_specified" >&6; }
+        fi
+      fi
+    fi
+
+  fi
+
+
+
+
+  # Publish this variable in the help.
+
+
   if [ -z "${HG+x}" ]; then
     # The variable is not set by user, try to locate tool using the code snippet
     for ac_prog in hg
@@ -24723,6 +24911,101 @@
 
 
 
+  # Should we build the complete docs, or just a lightweight version?
+  # Check whether --enable-full-docs was given.
+if test "${enable_full_docs+set}" = set; then :
+  enableval=$enable_full_docs;
+fi
+
+
+  # Verify dependencies
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for graphviz dot" >&5
+$as_echo_n "checking for graphviz dot... " >&6; }
+  if test "x$DOT" != "x"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cannot generate full docs" >&5
+$as_echo "no, cannot generate full docs" >&6; }
+    FULL_DOCS_DEP_MISSING=true
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pandoc" >&5
+$as_echo_n "checking for pandoc... " >&6; }
+  if test "x$PANDOC" != "x"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cannot generate full docs" >&5
+$as_echo "no, cannot generate full docs" >&6; }
+    FULL_DOCS_DEP_MISSING=true
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking full docs" >&5
+$as_echo_n "checking full docs... " >&6; }
+  if test "x$enable_full_docs" = xyes; then
+    if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5
+$as_echo "no, missing dependencies" >&6; }
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # dot is the help tag: freetype, cups, alsa etc
+  MISSING_DEPENDENCY=dot
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      brew)
+        brew_help    $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+      as_fn_error $? "Cannot enable full docs with missing dependencies. See above. $HELP_MSG" "$LINENO" 5
+    else
+      ENABLE_FULL_DOCS=true
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+    fi
+  elif test "x$enable_full_docs" = xno; then
+    ENABLE_FULL_DOCS=false
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+  elif test "x$enable_full_docs" = x; then
+    # Check for prerequisites
+    if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then
+      ENABLE_FULL_DOCS=false
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5
+$as_echo "no, missing dependencies" >&6; }
+    else
+      ENABLE_FULL_DOCS=true
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, dependencies present" >&5
+$as_echo "yes, dependencies present" >&6; }
+    fi
+  else
+    as_fn_error $? "--enable-full-docs can only take yes or no" "$LINENO" 5
+  fi
+
+
+
   # Choose cacerts source file
 
 # Check whether --with-cacerts-file was given.
--- a/common/autoconf/jdk-options.m4	Fri May 05 04:50:17 2017 +0000
+++ b/common/autoconf/jdk-options.m4	Wed Jul 05 23:21:47 2017 +0200
@@ -154,6 +154,55 @@
 
   AC_SUBST(ENABLE_HEADLESS_ONLY)
 
+  # Should we build the complete docs, or just a lightweight version?
+  AC_ARG_ENABLE([full-docs], [AS_HELP_STRING([--enable-full-docs],
+      [build complete documentation @<:@enabled if all tools found@:>@])])
+
+  # Verify dependencies
+  AC_MSG_CHECKING([for graphviz dot])
+  if test "x$DOT" != "x"; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no, cannot generate full docs])
+    FULL_DOCS_DEP_MISSING=true
+  fi
+
+  AC_MSG_CHECKING([for pandoc])
+  if test "x$PANDOC" != "x"; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no, cannot generate full docs])
+    FULL_DOCS_DEP_MISSING=true
+  fi
+
+  AC_MSG_CHECKING([full docs])
+  if test "x$enable_full_docs" = xyes; then
+    if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then
+      AC_MSG_RESULT([no, missing dependencies])
+      HELP_MSG_MISSING_DEPENDENCY([dot])
+      AC_MSG_ERROR([Cannot enable full docs with missing dependencies. See above. $HELP_MSG])
+    else
+      ENABLE_FULL_DOCS=true
+      AC_MSG_RESULT([yes, forced])
+    fi
+  elif test "x$enable_full_docs" = xno; then
+    ENABLE_FULL_DOCS=false
+    AC_MSG_RESULT([no, forced])
+  elif test "x$enable_full_docs" = x; then
+    # Check for prerequisites
+    if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then
+      ENABLE_FULL_DOCS=false
+      AC_MSG_RESULT([no, missing dependencies])
+    else
+      ENABLE_FULL_DOCS=true
+      AC_MSG_RESULT([yes, dependencies present])
+    fi
+  else
+    AC_MSG_ERROR([--enable-full-docs can only take yes or no])
+  fi
+
+  AC_SUBST(ENABLE_FULL_DOCS)
+
   # Choose cacerts source file
   AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
       [specify alternative cacerts file])])
--- a/common/autoconf/platform.m4	Fri May 05 04:50:17 2017 +0000
+++ b/common/autoconf/platform.m4	Wed Jul 05 23:21:47 2017 +0200
@@ -433,37 +433,22 @@
 
 ])
 
-AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
+AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES],
 [
-  if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
-    REQUIRED_OS_NAME=SunOS
-    REQUIRED_OS_VERSION=5.10
-  fi
-  if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
-    REQUIRED_OS_NAME=Linux
-    REQUIRED_OS_VERSION=2.6
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    OPENJDK_MODULE_TARGET_OS_NAME="macos"
+  else
+    OPENJDK_MODULE_TARGET_OS_NAME="$OPENJDK_TARGET_OS"
   fi
-  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
-    REQUIRED_OS_NAME=Windows
-    if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
-      REQUIRED_OS_VERSION=5.2
-    else
-      REQUIRED_OS_VERSION=5.1
-    fi
+
+  if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+    OPENJDK_MODULE_TARGET_OS_ARCH="amd64"
+  else
+    OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU"
   fi
-  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
-    REQUIRED_OS_NAME="Mac OS X"
-    REQUIRED_OS_VERSION=11.2
-  fi
-  if test "x$OPENJDK_TARGET_OS" = "xaix"; then
-    REQUIRED_OS_NAME=AIX
-    REQUIRED_OS_VERSION=7.1
-  fi
-  REQUIRED_OS_ARCH=${OPENJDK_TARGET_CPU}
 
-  AC_SUBST(REQUIRED_OS_NAME)
-  AC_SUBST(REQUIRED_OS_ARCH)
-  AC_SUBST(REQUIRED_OS_VERSION)
+  AC_SUBST(OPENJDK_MODULE_TARGET_OS_NAME)
+  AC_SUBST(OPENJDK_MODULE_TARGET_OS_ARCH)
 ])
 
 #%%% Build and target systems %%%
@@ -480,7 +465,7 @@
 
   PLATFORM_EXTRACT_TARGET_AND_BUILD
   PLATFORM_SETUP_TARGET_CPU_BITS
-  PLATFORM_SET_RELEASE_FILE_OS_VALUES
+  PLATFORM_SET_MODULE_TARGET_OS_VALUES
   PLATFORM_SETUP_LEGACY_VARS
 ])
 
--- a/common/autoconf/spec.gmk.in	Fri May 05 04:50:17 2017 +0000
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 23:21:47 2017 +0200
@@ -101,10 +101,9 @@
 OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@
 OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@
 
-# OS values for use in release file.
-REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
-REQUIRED_OS_ARCH:=@REQUIRED_OS_ARCH@
-REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@
+# OS values for use in ModuleTarget class file attribute.
+OPENJDK_MODULE_TARGET_OS_NAME:=@OPENJDK_MODULE_TARGET_OS_NAME@
+OPENJDK_MODULE_TARGET_OS_ARCH:=@OPENJDK_MODULE_TARGET_OS_ARCH@
 
 LIBM:=@LIBM@
 LIBDL:=@LIBDL@
@@ -245,6 +244,8 @@
 # Only build headless support or not
 ENABLE_HEADLESS_ONLY := @ENABLE_HEADLESS_ONLY@
 
+ENABLE_FULL_DOCS := @ENABLE_FULL_DOCS@
+
 # JDK_OUTPUTDIR specifies where a working jvm is built.
 # You can run $(JDK_OUTPUTDIR)/bin/java
 # Though the layout of the contents of $(JDK_OUTPUTDIR) is not
@@ -679,6 +680,7 @@
 READELF:=@READELF@
 EXPR:=@EXPR@
 FILE:=@FILE@
+DOT:=@DOT@
 HG:=@HG@
 OBJCOPY:=@OBJCOPY@
 SETFILE:=@SETFILE@
@@ -842,11 +844,6 @@
     jre-$(VERSION_SHORT)+$(VERSION_BUILD)-compact3_$(OPENJDK_TARGET_BUNDLE_PLATFORM)_bin$(DEBUG_PART).tar.gz
 JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
 JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).zip
-else
-  DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).tar.gz
-endif
 TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
 DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
 
@@ -854,7 +851,6 @@
 JRE_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME)
 JDK_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
 JRE_SYMBOLS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME)
-DEMOS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(DEMOS_BUNDLE_NAME)
 TEST_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
 DOCS_BUNDLE :=  $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)
 
--- a/common/bin/compare_exceptions.sh.incl	Fri May 05 04:50:17 2017 +0000
+++ b/common/bin/compare_exceptions.sh.incl	Wed Jul 05 23:21:47 2017 +0200
@@ -38,25 +38,9 @@
 if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
 
   STRIP_BEFORE_COMPARE="
-      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-      ./demo/jvmti/gctest/lib/libgctest.so
-      ./demo/jvmti/heapTracker/lib/libheapTracker.so
-      ./demo/jvmti/heapViewer/lib/libheapViewer.so
-      ./demo/jvmti/minst/lib/libminst.so
-      ./demo/jvmti/mtrace/lib/libmtrace.so
-      ./demo/jvmti/versionCheck/lib/libversionCheck.so
-      ./demo/jvmti/waiters/lib/libwaiters.so
       "
 
   ACCEPTED_BIN_DIFF="
-      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-      ./demo/jvmti/gctest/lib/libgctest.so
-      ./demo/jvmti/heapTracker/lib/libheapTracker.so
-      ./demo/jvmti/heapViewer/lib/libheapViewer.so
-      ./demo/jvmti/minst/lib/libminst.so
-      ./demo/jvmti/mtrace/lib/libmtrace.so
-      ./demo/jvmti/versionCheck/lib/libversionCheck.so
-      ./demo/jvmti/waiters/lib/libwaiters.so
       ./lib/client/libjsig.so
       ./lib/client/libjvm.so
       ./lib/libattach.so
@@ -151,15 +135,6 @@
 if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
 
   STRIP_BEFORE_COMPARE="
-      ./demo/jni/Poller/lib/libPoller.so
-      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-      ./demo/jvmti/gctest/lib/libgctest.so
-      ./demo/jvmti/heapTracker/lib/libheapTracker.so
-      ./demo/jvmti/heapViewer/lib/libheapViewer.so
-      ./demo/jvmti/minst/lib/libminst.so
-      ./demo/jvmti/mtrace/lib/libmtrace.so
-      ./demo/jvmti/versionCheck/lib/libversionCheck.so
-      ./demo/jvmti/waiters/lib/libwaiters.so
       "
 
   SORT_SYMBOLS="
@@ -174,15 +149,6 @@
   SKIP_BIN_DIFF="true"
 
   ACCEPTED_SMALL_SIZE_DIFF="
-      ./demo/jni/Poller/lib/libPoller.so
-      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-      ./demo/jvmti/gctest/lib/libgctest.so
-      ./demo/jvmti/heapTracker/lib/libheapTracker.so
-      ./demo/jvmti/heapViewer/lib/libheapViewer.so
-      ./demo/jvmti/minst/lib/libminst.so
-      ./demo/jvmti/mtrace/lib/libmtrace.so
-      ./demo/jvmti/versionCheck/lib/libversionCheck.so
-      ./demo/jvmti/waiters/lib/libwaiters.so
       ./lib/jli/libjli.so
       ./lib/jspawnhelper
       ./lib/libJdbcOdbc.so
@@ -279,19 +245,9 @@
 if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "sparcv9" ]; then
 
   STRIP_BEFORE_COMPARE="
-      ./demo/jni/Poller/lib/libPoller.so
-      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-      ./demo/jvmti/gctest/lib/libgctest.so
-      ./demo/jvmti/heapTracker/lib/libheapTracker.so
-      ./demo/jvmti/heapViewer/lib/libheapViewer.so
-      ./demo/jvmti/minst/lib/libminst.so
-      ./demo/jvmti/mtrace/lib/libmtrace.so
-      ./demo/jvmti/versionCheck/lib/libversionCheck.so
-      ./demo/jvmti/waiters/lib/libwaiters.so
       "
 
   SORT_SYMBOLS="
-      ./demo/jvmti/waiters/lib/libwaiters.so
       ./lib/libjsig.so
       ./lib/libfontmanager.so
       ./lib/libjimage.so
@@ -305,15 +261,6 @@
   SKIP_BIN_DIFF="true"
 
   ACCEPTED_SMALL_SIZE_DIFF="
-      ./demo/jni/Poller/lib/libPoller.so
-      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
-      ./demo/jvmti/gctest/lib/libgctest.so
-      ./demo/jvmti/heapTracker/lib/libheapTracker.so
-      ./demo/jvmti/heapViewer/lib/libheapViewer.so
-      ./demo/jvmti/minst/lib/libminst.so
-      ./demo/jvmti/mtrace/lib/libmtrace.so
-      ./demo/jvmti/versionCheck/lib/libversionCheck.so
-      ./demo/jvmti/waiters/lib/libwaiters.so
       ./lib/client/libjvm.so
       ./lib/jli/libjli.so
       ./lib/jspawnhelper
@@ -438,9 +385,6 @@
 
   # Probably should add all libs here
   ACCEPTED_SMALL_SIZE_DIFF="
-      ./demo/jvmti/gctest/lib/gctest.dll
-      ./demo/jvmti/heapTracker/lib/heapTracker.dll
-      ./demo/jvmti/minst/lib/minst.dll
       ./bin/attach.dll
       ./bin/jsoundds.dll
       ./bin/client/jvm.dll
@@ -579,14 +523,6 @@
       ./bin/wsgen
       ./bin/wsimport
       ./bin/xjc
-      ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.dylib
-      ./demo/jvmti/gctest/lib/libgctest.dylib
-      ./demo/jvmti/heapTracker/lib/libheapTracker.dylib
-      ./demo/jvmti/heapViewer/lib/libheapViewer.dylib
-      ./demo/jvmti/minst/lib/libminst.dylib
-      ./demo/jvmti/mtrace/lib/libmtrace.dylib
-      ./demo/jvmti/versionCheck/lib/libversionCheck.dylib
-      ./demo/jvmti/waiters/lib/libwaiters.dylib
       ./Contents/Home/bin/_javaws
       ./Contents/Home/bin/javaws
       ./Contents/Home/bin/idlj
--- a/common/conf/jib-profiles.js	Fri May 05 04:50:17 2017 +0000
+++ b/common/conf/jib-profiles.js	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -422,8 +422,9 @@
         "linux-x64": {
             target_os: "linux",
             target_cpu: "x64",
-            dependencies: ["devkit"],
-            configure_args: concat(common.configure_args_64bit, "--with-zlib=system"),
+            dependencies: ["devkit", "graphviz", "pandoc"],
+            configure_args: concat(common.configure_args_64bit,
+                "--enable-full-docs", "--with-zlib=system"),
             default_make_targets: ["docs-bundles"],
         },
 
@@ -964,7 +965,23 @@
             ext: "tar.gz",
             revision: "2.7.1-v120+1.0",
             module: "freetype-" + input.target_platform
-        }
+        },
+
+        graphviz: {
+            organization: common.organization,
+            ext: "tar.gz",
+            revision: "2.38.0-1+1.1",
+            module: "graphviz-" + input.target_platform,
+            configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot"
+        },
+
+        pandoc: {
+            organization: common.organization,
+            ext: "tar.gz",
+            revision: "1.17.2+1.0",
+            module: "pandoc-" + input.target_platform,
+            configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc"
+        },
     };
 
     return dependencies;
--- a/common/nb_native/nbproject/configurations.xml	Fri May 05 04:50:17 2017 +0000
+++ b/common/nb_native/nbproject/configurations.xml	Wed Jul 05 23:21:47 2017 +0200
@@ -982,52 +982,6 @@
           </df>
         </df>
         <df name="src">
-          <df name="demo">
-            <df name="share">
-              <df name="jvmti">
-                <df name="agent_util">
-                  <in>agent_util.c</in>
-                </df>
-                <df name="compiledMethodLoad">
-                  <in>compiledMethodLoad.c</in>
-                </df>
-                <df name="gctest">
-                  <in>gctest.c</in>
-                </df>
-                <df name="heapTracker">
-                  <in>heapTracker.c</in>
-                </df>
-                <df name="heapViewer">
-                  <in>heapViewer.c</in>
-                </df>
-                <df name="java_crw_demo">
-                  <in>java_crw_demo.c</in>
-                </df>
-                <df name="minst">
-                  <in>minst.c</in>
-                </df>
-                <df name="mtrace">
-                  <in>mtrace.c</in>
-                </df>
-                <df name="versionCheck">
-                  <in>versionCheck.c</in>
-                </df>
-                <df name="waiters">
-                  <in>Agent.cpp</in>
-                  <in>Monitor.cpp</in>
-                  <in>Thread.cpp</in>
-                  <in>waiters.cpp</in>
-                </df>
-              </df>
-            </df>
-            <df name="solaris">
-              <df name="jni">
-                <df name="Poller">
-                  <in>Poller.c</in>
-                </df>
-              </df>
-            </df>
-          </df>
           <df name="java.base">
             <df name="linux">
               <df name="native">
@@ -21533,89 +21487,6 @@
           </incDir>
         </ccTool>
       </item>
-      <item path="../../jdk/src/demo/share/jvmti/agent_util/agent_util.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/gctest/gctest.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/heapTracker/heapTracker.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/heapViewer/heapViewer.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/minst/minst.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/mtrace/mtrace.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/versionCheck/versionCheck.c"
-            ex="false"
-            tool="0"
-            flavor2="3">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Agent.cpp"
-            ex="false"
-            tool="1"
-            flavor2="4">
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Monitor.cpp"
-            ex="false"
-            tool="1"
-            flavor2="4">
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Thread.cpp"
-            ex="false"
-            tool="1"
-            flavor2="4">
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/waiters.cpp"
-            ex="false"
-            tool="1"
-            flavor2="4">
-      </item>
       <item path="../../jdk/src/java.base/macosx/native/libjava/HostLocaleProviderAdapter_md.c"
             ex="false"
             tool="0"
@@ -30509,113 +30380,6 @@
           </incDir>
         </cTool>
       </folder>
-      <folder path="0/jdk/src/demo">
-        <cTool>
-          <preprocessorList>
-            <Elem>DEBUG</Elem>
-          </preprocessorList>
-        </cTool>
-        <ccTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/waiters</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>DEBUG</Elem>
-          </preprocessorList>
-        </ccTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/agent_util">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/compiledMethodLoad">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/compiledMethodLoad</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/gctest">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/gctest</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/heapTracker">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/heapTracker</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/heapViewer">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/heapViewer</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/java_crw_demo">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/minst">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/minst</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/mtrace">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/mtrace</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/versionCheck">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/versionCheck</pElem>
-            <pElem>../../jdk/src/java.base/macosx/native/include</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
       <folder path="0/jdk/src/java.base">
         <cTool>
           <incDir>
@@ -36906,106 +36670,6 @@
         <cTool flags="3">
         </cTool>
       </item>
-      <item path="../../jdk/src/demo/share/jvmti/agent_util/agent_util.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/gctest/gctest.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/heapTracker/heapTracker.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/heapViewer/heapViewer.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/minst/minst.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/mtrace/mtrace.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/versionCheck/versionCheck.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="5">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Agent.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="2">
-        </ccTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Monitor.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="2">
-          <preprocessorList>
-            <Elem>THIS_FILE="Monitor.cpp"</Elem>
-          </preprocessorList>
-        </ccTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Thread.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="2">
-          <preprocessorList>
-            <Elem>THIS_FILE="Thread.cpp"</Elem>
-          </preprocessorList>
-        </ccTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/waiters.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="2">
-          <preprocessorList>
-            <Elem>THIS_FILE="waiters.cpp"</Elem>
-          </preprocessorList>
-        </ccTool>
-      </item>
       <item path="../../jdk/src/java.base/linux/native/libjava/ProcessHandleImpl_linux.c"
             ex="false"
             tool="0"
@@ -46197,183 +45861,6 @@
           </preprocessorList>
         </cTool>
       </folder>
-      <folder path="0/jdk/src/demo">
-        <cTool>
-          <preprocessorList>
-            <Elem>DEBUG</Elem>
-          </preprocessorList>
-        </cTool>
-        <ccTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/waiters</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>DEBUG</Elem>
-          </preprocessorList>
-        </ccTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/agent_util">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapTracker</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/compiledMethodLoad">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/compiledMethodLoad</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="compiledMethodLoad.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/gctest">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/gctest</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="gctest.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/heapTracker">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapTracker</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="heapTracker.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/heapViewer">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapViewer</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="heapViewer.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/java_crw_demo">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapTracker</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="java_crw_demo.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/minst">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/minst</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="minst.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/mtrace">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/mtrace</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="mtrace.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/versionCheck">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/versionCheck</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/linux/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="versionCheck.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
       <folder path="0/jdk/src/java.base">
         <cTool>
           <preprocessorList>
@@ -55235,113 +54722,6 @@
         <ccTool flags="0">
         </ccTool>
       </item>
-      <item path="../../jdk/src/demo/share/jvmti/agent_util/agent_util.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/gctest/gctest.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/heapTracker/heapTracker.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/heapViewer/heapViewer.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/minst/minst.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/mtrace/mtrace.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/versionCheck/versionCheck.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="3">
-        </cTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Agent.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="0">
-        </ccTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Monitor.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="0">
-          <preprocessorList>
-            <Elem>THIS_FILE="Monitor.cpp"</Elem>
-          </preprocessorList>
-        </ccTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/Thread.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="0">
-          <preprocessorList>
-            <Elem>THIS_FILE="Thread.cpp"</Elem>
-          </preprocessorList>
-        </ccTool>
-      </item>
-      <item path="../../jdk/src/demo/share/jvmti/waiters/waiters.cpp"
-            ex="false"
-            tool="1"
-            flavor2="0">
-        <ccTool flags="0">
-          <preprocessorList>
-            <Elem>THIS_FILE="waiters.cpp"</Elem>
-          </preprocessorList>
-        </ccTool>
-      </item>
-      <item path="../../jdk/src/demo/solaris/jni/Poller/Poller.c"
-            ex="false"
-            tool="0"
-            flavor2="0">
-        <cTool flags="2">
-        </cTool>
-      </item>
       <item path="../../jdk/src/java.base/share/native/launcher/main.c"
             ex="false"
             tool="0"
@@ -64674,8 +64054,6 @@
         </cTool>
         <ccTool>
           <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/waiters</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
             <pElem>../../jdk/src/java.base/share/native/include</pElem>
             <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
             <pElem>../../jdk/src/java.base/unix/native/include</pElem>
@@ -64699,189 +64077,6 @@
           </preprocessorList>
         </ccTool>
       </folder>
-      <folder path="0/jdk/src/demo">
-        <cTool>
-          <preprocessorList>
-            <Elem>DEBUG</Elem>
-          </preprocessorList>
-        </cTool>
-        <ccTool>
-          <preprocessorList>
-            <Elem>DEBUG</Elem>
-          </preprocessorList>
-        </ccTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/agent_util">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapTracker</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/compiledMethodLoad">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/compiledMethodLoad</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="compiledMethodLoad.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/gctest">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/gctest</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="gctest.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/heapTracker">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapTracker</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="heapTracker.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/heapViewer">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapViewer</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="heapViewer.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/java_crw_demo">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/heapTracker</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="java_crw_demo.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/minst">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/minst</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="minst.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/mtrace">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/mtrace</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/java_crw_demo</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="mtrace.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/share/jvmti/versionCheck">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/demo/share/jvmti/versionCheck</pElem>
-            <pElem>../../jdk/src/demo/share/jvmti/agent_util</pElem>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="versionCheck.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
-      <folder path="0/jdk/src/demo/solaris">
-        <cTool>
-          <incDir>
-            <pElem>../../jdk/src/java.base/share/native/include</pElem>
-            <pElem>../../jdk/src/java.base/solaris/native/include</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/include</pElem>
-            <pElem>../../jdk/src/java.base/share/native/libjava</pElem>
-            <pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
-            <pElem>../../build/support/demos/classes/jni/Poller</pElem>
-            <pElem>../../jdk/make</pElem>
-          </incDir>
-          <preprocessorList>
-            <Elem>THIS_FILE="Poller.c"</Elem>
-          </preprocessorList>
-        </cTool>
-      </folder>
       <folder path="0/jdk/src/java.base">
         <cTool>
           <incDir>
--- a/hotspot/.hgtags	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/.hgtags	Wed Jul 05 23:21:47 2017 +0200
@@ -560,6 +560,7 @@
 a9fdfd55835ef9dccb7f317b07249bd66653b874 jdk-9+154
 f3b3d77a1751897413aae43ac340a130b6fa2ae1 jdk-9+155
 43139c588ea48b6504e52b6c3dec530b17b1fdb4 jdk-9+156
+1ea217626ba0995dd03127f8322ba3687926a085 jdk-10+1
 b2d0a906afd73dcf27f572217eb1be0f196ec16c jdk-9+157
 4e78f30935229f13ce7c43089621cf7169f5abac jdk-9+158
 9211c2e89c1cd11ec2d5752b0f97131a7d7525c7 jdk-9+159
@@ -570,3 +571,10 @@
 0af429be8bbaeaaf0cb838e9af28c953dda6a9c8 jdk-9+164
 c92c6416ca03b1464d5ed99cf6201e52b5ba0a70 jdk-9+165
 560d7aa083a24b6a56443feb8de0f40435d33aa9 jdk-9+166
+48809c513ed5ebb4d4dbf2f454afcce2780db6db jdk-10+2
+6c3b6b3438c4a63e619f00bd5732d1260ffd5600 jdk-10+3
+8295ca08f5cb09c090eb048bbdd338d7e270c8bf jdk-10+4
+7b5ca2ff1f78873ca3ee99b6589d3cb4dde2e454 jdk-10+5
+762465099d938fd96cd1efda193bc1fa23d070d3 jdk-10+6
+1ca7ed1b17b5776930d641d1379834f3140a74e4 jdk-9+167
+fbb9c802649585d19f6d7e81b4a519d44806225a jdk-9+168
--- a/hotspot/.mx.jvmci/.pydevproject	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/.mx.jvmci/.pydevproject	Wed Jul 05 23:21:47 2017 +0200
@@ -3,7 +3,7 @@
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/.mx.jvmci</path>
+<path>/mx.jvmci</path>
 </pydev_pathproperty>
 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
 <path>/mx</path>
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1221,12 +1221,19 @@
   obj.load_item();
 
   // info for exceptions
-  CodeEmitInfo* info_for_exception = state_for(x);
+  CodeEmitInfo* info_for_exception =
+      (x->needs_exception_state() ? state_for(x) :
+                                    state_for(x, x->state_before(), true /*ignore_xhandler*/));
 
   CodeStub* stub;
   if (x->is_incompatible_class_change_check()) {
     assert(patching_info == NULL, "can't patch this");
     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
+  } else if (x->is_invokespecial_receiver_check()) {
+    assert(patching_info == NULL, "can't patch this");
+    stub = new DeoptimizeStub(info_for_exception,
+                              Deoptimization::Reason_class_check,
+                              Deoptimization::Action_none);
   } else {
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
   }
--- a/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -34,10 +34,6 @@
 
 #define SUPPORTS_NATIVE_CX8
 
-// The maximum B/BL offset range on AArch64 is 128MB.
-#undef CODE_CACHE_DEFAULT_LIMIT
-#define CODE_CACHE_DEFAULT_LIMIT (128*M)
-
 // According to the ARMv8 ARM, "Concurrent modification and execution
 // of instructions can lead to the resulting instruction performing
 // any behavior that can be achieved by executing any sequence of
--- a/hotspot/src/cpu/arm/vm/c1_LIRAssembler_arm.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/arm/vm/c1_LIRAssembler_arm.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1453,10 +1453,11 @@
       ciKlass* k = op->klass();
       assert_different_registers(res, k_RInfo, klass_RInfo, Rtemp);
 
+      if (stub->is_simple_exception_stub()) {
       // TODO: ARM - Late binding is used to prevent confusion of register allocator
       assert(stub->is_exception_throw_stub(), "must be");
       ((SimpleExceptionStub*)stub)->set_obj(op->result_opr());
-
+      }
       ciMethodData* md;
       ciProfileData* data;
       int mdo_offset_bias = 0;
--- a/hotspot/src/cpu/arm/vm/c1_LIRGenerator_arm.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/arm/vm/c1_LIRGenerator_arm.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1412,12 +1412,20 @@
 
   obj.load_item();
 
-  CodeEmitInfo* info_for_exception = state_for(x);
+  CodeEmitInfo* info_for_exception =
+    (x->needs_exception_state() ? state_for(x) :
+                                  state_for(x, x->state_before(), true /*ignore_xhandler*/));
+
   CodeStub* stub;
   if (x->is_incompatible_class_change_check()) {
     assert(patching_info == NULL, "can't patch this");
     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id,
                                    LIR_OprFact::illegalOpr, info_for_exception);
+  } else if (x->is_invokespecial_receiver_check()) {
+    assert(patching_info == NULL, "can't patch this");
+    stub = new DeoptimizeStub(info_for_exception,
+                              Deoptimization::Reason_class_check,
+                              Deoptimization::Action_none);
   } else {
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id,
                                    LIR_OprFact::illegalOpr, info_for_exception);
--- a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1131,12 +1131,19 @@
   obj.load_item();
   LIR_Opr out_reg = rlock_result(x);
   CodeStub* stub;
-  CodeEmitInfo* info_for_exception = state_for(x);
+  CodeEmitInfo* info_for_exception =
+      (x->needs_exception_state() ? state_for(x) :
+                                    state_for(x, x->state_before(), true /*ignore_xhandler*/));
 
   if (x->is_incompatible_class_change_check()) {
     assert(patching_info == NULL, "can't patch this");
     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id,
                                    LIR_OprFact::illegalOpr, info_for_exception);
+  } else if (x->is_invokespecial_receiver_check()) {
+    assert(patching_info == NULL, "can't patch this");
+    stub = new DeoptimizeStub(info_for_exception,
+                              Deoptimization::Reason_class_check,
+                              Deoptimization::Action_none);
   } else {
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
   }
--- a/hotspot/src/cpu/s390/vm/c1_LIRGenerator_s390.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/s390/vm/c1_LIRGenerator_s390.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -993,12 +993,19 @@
   obj.load_item();
 
   // info for exceptions
-  CodeEmitInfo* info_for_exception = state_for (x);
+  CodeEmitInfo* info_for_exception =
+      (x->needs_exception_state() ? state_for(x) :
+                                    state_for(x, x->state_before(), true /*ignore_xhandler*/));
 
   CodeStub* stub;
   if (x->is_incompatible_class_change_check()) {
     assert(patching_info == NULL, "can't patch this");
     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
+  } else if (x->is_invokespecial_receiver_check()) {
+    assert(patching_info == NULL, "can't patch this");
+    stub = new DeoptimizeStub(info_for_exception,
+                              Deoptimization::Reason_class_check,
+                              Deoptimization::Action_none);
   } else {
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
   }
--- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1196,11 +1196,18 @@
   obj.load_item();
   LIR_Opr out_reg = rlock_result(x);
   CodeStub* stub;
-  CodeEmitInfo* info_for_exception = state_for(x);
+  CodeEmitInfo* info_for_exception =
+      (x->needs_exception_state() ? state_for(x) :
+                                    state_for(x, x->state_before(), true /*ignore_xhandler*/));
 
   if (x->is_incompatible_class_change_check()) {
     assert(patching_info == NULL, "can't patch this");
     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
+  } else if (x->is_invokespecial_receiver_check()) {
+    assert(patching_info == NULL, "can't patch this");
+    stub = new DeoptimizeStub(info_for_exception,
+                              Deoptimization::Reason_class_check,
+                              Deoptimization::Action_none);
   } else {
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
   }
--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1429,12 +1429,17 @@
   obj.load_item();
 
   // info for exceptions
-  CodeEmitInfo* info_for_exception = state_for(x);
+  CodeEmitInfo* info_for_exception =
+      (x->needs_exception_state() ? state_for(x) :
+                                    state_for(x, x->state_before(), true /*ignore_xhandler*/));
 
   CodeStub* stub;
   if (x->is_incompatible_class_change_check()) {
     assert(patching_info == NULL, "can't patch this");
     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
+  } else if (x->is_invokespecial_receiver_check()) {
+    assert(patching_info == NULL, "can't patch this");
+    stub = new DeoptimizeStub(info_for_exception, Deoptimization::Reason_class_check, Deoptimization::Action_none);
   } else {
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
   }
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -763,12 +763,11 @@
     FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
   }
 
-  if (supports_sse4_2()) {
+  if (supports_sse4_2() && supports_clmul()) {
     if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) {
       UseCRC32CIntrinsics = true;
     }
-  }
-  else if (UseCRC32CIntrinsics) {
+  } else if (UseCRC32CIntrinsics) {
     if (!FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) {
       warning("CRC32C intrinsics are not available on this CPU");
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AltHashing.java	Wed Jul 05 23:21:47 2017 +0200
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.memory;
+
+public class AltHashing {
+    public static long murmur3_32(long seed, byte[] data) {
+      long h1 = seed;
+      int len = data.length;
+      int count = len;
+
+      int offset = 0;
+
+      // body
+      while (count >= 4) {
+          long k1 = (data[offset] & 0x0FF)
+              | (data[offset + 1] & 0x0FF) << 8
+              | (data[offset + 2] & 0x0FF) << 16
+              | data[offset + 3] << 24;
+
+          count -= 4;
+          offset += 4;
+
+          k1 *= 0xcc9e2d51;
+          k1 = Integer.rotateLeft((int)k1, 15);
+          k1 *= 0x1b873593;
+          k1 &= 0xFFFFFFFFL;
+
+          h1 ^= k1;
+          h1 = Integer.rotateLeft((int)h1, 13);
+          h1 = h1 * 5 + 0xe6546b64;
+          h1 &= 0xFFFFFFFFL;
+      }
+
+      //tail
+      if (count > 0) {
+          long k1 = 0;
+
+          switch (count) {
+              case 3:
+                  k1 ^= (data[offset + 2] & 0xff) << 16;
+                  // fall through
+              case 2:
+                  k1 ^= (data[offset + 1] & 0xff) << 8;
+                  // fall through
+              case 1:
+                  k1 ^= (data[offset] & 0xff);
+                  // fall through
+              default:
+                  k1 *= 0xcc9e2d51;
+                  k1 = Integer.rotateLeft((int)k1, 15);
+                  k1 *= 0x1b873593;
+                  k1 &= 0xFFFFFFFFL;
+                  h1 ^= k1;
+                  h1 &= 0xFFFFFFFFL;
+          }
+      }
+
+      // finalization
+      h1 ^= len;
+
+      // finalization mix force all bits of a hash block to avalanche
+      h1 ^= h1 >> 16;
+      h1 *= 0x85ebca6b;
+      h1 &= 0xFFFFFFFFL;
+      h1 ^= h1 >> 13;
+      h1 *= 0xc2b2ae35;
+      h1 &= 0xFFFFFFFFL;
+      h1 ^= h1 >> 16;
+
+      return h1 & 0xFFFFFFFFL;
+  }
+}
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,11 +45,14 @@
     Type type = db.lookupType("SymbolTable");
     theTableField  = type.getAddressField("_the_table");
     sharedTableField = type.getAddressField("_shared_table");
+    type = db.lookupType("RehashableSymbolHashtable");
+    seedField = type.getCIntegerField("_seed");
   }
 
   // Fields
   private static AddressField theTableField;
   private static AddressField sharedTableField;
+  private static CIntegerField seedField;
 
   private CompactHashTable sharedTable;
 
@@ -62,6 +65,17 @@
     return table;
   }
 
+  public static long getSeed() {
+      return (long) seedField.getValue();
+  }
+
+  public static boolean useAlternateHashcode() {
+      if (getSeed() != 0) {
+          return true;
+      }
+      return false;
+  }
+
   public SymbolTable(Address addr) {
     super(addr);
   }
@@ -86,11 +100,17 @@
   public Symbol probe(byte[] name) {
     long hashValue = hashSymbol(name);
 
+    // shared table does not use alternate hashing algorithm,
+    // it always uses the same original hash code.
     Symbol s = sharedTable.probe(name, hashValue);
     if (s != null) {
       return s;
     }
 
+    if (useAlternateHashcode()) {
+        hashValue = AltHashing.murmur3_32(getSeed(), name);
+    }
+
     for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) {
       if (e.hash() == hashValue) {
          Symbol sym = Symbol.create(e.literalValue());
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java	Wed Jul 05 23:21:47 2017 +0200
@@ -24,7 +24,6 @@
 
 import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilationEvent;
 import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilerFailureEvent;
-import jdk.vm.ci.services.JVMCIPermission;
 
 /**
  * Service-provider class for logging compiler related events.
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,9 +28,9 @@
 import jdk.vm.ci.runtime.JVMCICompiler;
 import jdk.vm.ci.runtime.JVMCICompilerFactory;
 import jdk.vm.ci.runtime.JVMCIRuntime;
+import jdk.vm.ci.services.JVMCIPermission;
 import jdk.vm.ci.services.JVMCIServiceLocator;
-import jdk.vm.ci.services.JVMCIPermission;
-import jdk.vm.ci.services.Services;
+import jdk.vm.ci.services.internal.ReflectionAccessJDK;
 
 final class HotSpotJVMCICompilerConfig {
 
@@ -47,7 +47,7 @@
 
         @Override
         public String getCompilerName() {
-            return "<none>";
+            return "null";
         }
 
         @Override
@@ -73,19 +73,23 @@
             JVMCICompilerFactory factory = null;
             String compilerName = Option.Compiler.getString();
             if (compilerName != null) {
-                for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
-                    if (f.getCompilerName().equals(compilerName)) {
-                        factory = f;
+                if (compilerName.isEmpty() || compilerName.equals("null")) {
+                    factory = new DummyCompilerFactory();
+                } else {
+                    for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
+                        if (f.getCompilerName().equals(compilerName)) {
+                            factory = f;
+                        }
                     }
-                }
-                if (factory == null) {
-                    throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
+                    if (factory == null) {
+                        throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
+                    }
                 }
             } else {
                 // Auto select a single available compiler
                 for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
                     if (factory == null) {
-                        Services.exportJVMCITo(f.getClass());
+                        ReflectionAccessJDK.openJVMCITo(f.getClass());
                         factory = f;
                     } else {
                         // Multiple factories seen - cancel auto selection
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java	Wed Jul 05 23:21:47 2017 +0200
@@ -32,6 +32,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.ServiceLoader;
 import java.util.TreeMap;
 
 import jdk.internal.misc.VM;
@@ -50,7 +51,6 @@
 import jdk.vm.ci.runtime.JVMCICompiler;
 import jdk.vm.ci.runtime.JVMCICompilerFactory;
 import jdk.vm.ci.services.JVMCIServiceLocator;
-import jdk.vm.ci.services.Services;
 
 /**
  * HotSpot implementation of a JVMCI runtime.
@@ -88,7 +88,10 @@
      */
     public enum Option {
         // @formatter:off
-        Compiler(String.class, null, "Selects the system compiler."),
+        Compiler(String.class, null, "Selects the system compiler. This must match the getCompilerName() value returned " +
+                                     "by a jdk.vm.ci.runtime.JVMCICompilerFactory provider. " +
+                                     "An empty string or the value \"null\" selects a compiler " +
+                                     "that will raise an exception upon receiving a compilation request."),
         // Note: The following one is not used (see InitTimer.ENABLED). It is added here
         // so that -XX:+JVMCIPrintProperties shows the option.
         InitTimer(Boolean.class, false, "Specifies if initialization timing is enabled."),
@@ -208,7 +211,7 @@
     }
 
     public static HotSpotJVMCIBackendFactory findFactory(String architecture) {
-        for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) {
+        for (HotSpotJVMCIBackendFactory factory : ServiceLoader.load(HotSpotJVMCIBackendFactory.class, ClassLoader.getSystemClassLoader())) {
             if (factory.getArchitecture().equalsIgnoreCase(architecture)) {
                 return factory;
             }
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java	Wed Jul 05 23:21:47 2017 +0200
@@ -98,7 +98,7 @@
             boolean aligned = ((displacement - headerSize) % sizeOfElement) == 0;
             if (displacement < 0 || displacement > (arrayEnd - sizeOfElement) || (kind == JavaKind.Object && !aligned)) {
                 int index = (int) ((displacement - headerSize) / sizeOfElement);
-                throw new AssertionError("Unsafe array access: reading element of kind " + kind +
+                throw new IllegalArgumentException("Unsafe array access: reading element of kind " + kind +
                                 " at offset " + displacement + " (index ~ " + index + ") in " +
                                 type.toJavaName() + " object of length " + length);
             }
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java	Wed Jul 05 23:21:47 2017 +0200
@@ -801,8 +801,7 @@
         }
         if (elementType.getName().startsWith("Ljava/")) {
             // Classes in a java.* package can only be defined by the
-            // boot class loader. This is enforced by ClassLoader.preDefineClass()
-            assert mirror().getClassLoader() == null;
+            // boot or platform class loader.
             return true;
         }
         ClassLoader thisCl = mirror().getClassLoader();
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java	Wed Jul 05 23:21:47 2017 +0200
@@ -24,12 +24,15 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.ServiceLoader;
+
+import jdk.vm.ci.services.internal.ReflectionAccessJDK;
 
 /**
  * Service-provider class for the runtime to locate providers of JVMCI services where the latter are
- * not in packages exported by the JVMCI module. As part of instantiating
- * {@link JVMCIServiceLocator}, all JVMCI packages will be {@linkplain Services#exportJVMCITo(Class)
- * exported} to the module defining the class of the instantiated object.
+ * not in packages exported by the JVMCI module. As part of instantiating a
+ * {@link JVMCIServiceLocator}, all JVMCI packages will be opened to the module defining the class
+ * of the instantiated object.
  *
  * While the {@link #getProvider(Class)} method can be used directly, it's usually easier to use
  * {@link #getProviders(Class)}.
@@ -49,30 +52,39 @@
     }
 
     /**
-     * Creates a capability for accessing JVMCI. Once successfully instantiated, JVMCI exports all
-     * its packages to the module defining the type of this object.
+     * Creates a capability for accessing JVMCI. Once successfully instantiated, JVMCI opens all its
+     * packages to the module defining the type of this object.
      *
      * @throws SecurityException if a security manager has been installed and it denies
      *             {@link JVMCIPermission}
      */
     protected JVMCIServiceLocator() {
         this(checkPermission());
-        Services.exportJVMCITo(getClass());
+        Services.checkJVMCIEnabled();
+        ReflectionAccessJDK.openJVMCITo(getClass());
     }
 
     /**
      * Gets the provider of the service defined by {@code service} or {@code null} if this object
      * does not have a provider for {@code service}.
      */
-    public abstract <S> S getProvider(Class<S> service);
+    protected abstract <S> S getProvider(Class<S> service);
 
     /**
-     * Gets the providers of the service defined by {@code service} by querying the
-     * {@link JVMCIServiceLocator} providers obtained by {@link Services#load(Class)}.
+     * Gets the providers of the service defined by {@code service} by querying the available
+     * {@link JVMCIServiceLocator} providers.
+     *
+     * @throws SecurityException if a security manager is present and it denies
+     *             {@link JVMCIPermission}
      */
     public static <S> List<S> getProviders(Class<S> service) {
+        Services.checkJVMCIEnabled();
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new JVMCIPermission());
+        }
         List<S> providers = new ArrayList<>();
-        for (JVMCIServiceLocator access : Services.load(JVMCIServiceLocator.class)) {
+        for (JVMCIServiceLocator access : ServiceLoader.load(JVMCIServiceLocator.class, ClassLoader.getSystemClassLoader())) {
             S provider = access.getProvider(service);
             if (provider != null) {
                 providers.add(provider);
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java	Wed Jul 05 23:21:47 2017 +0200
@@ -22,167 +22,64 @@
  */
 package jdk.vm.ci.services;
 
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.util.Formatter;
-import java.util.Iterator;
-import java.util.ServiceConfigurationError;
-import java.util.ServiceLoader;
-import java.util.Set;
+import java.util.Map;
 
 /**
- * A mechanism for accessing service providers via JVMCI.
+ * Provides utilities needed by JVMCI clients.
  */
 public final class Services {
 
+    // This class must be compilable and executable on JDK 8 since it's used in annotation
+    // processors while building JDK 9 so use of API added in JDK 9 is made via reflection.
+
     private Services() {
     }
 
-    private static int getJavaSpecificationVersion() {
-        String value = System.getProperty("java.specification.version");
-        if (value.startsWith("1.")) {
-            value = value.substring(2);
-        }
-        return Integer.parseInt(value);
-    }
-
-    /**
-     * The integer value corresponding to the value of the {@code java.specification.version} system
-     * property after any leading {@code "1."} has been stripped.
-     */
-    public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
-
-    // Use reflection so that this compiles on Java 8
-    private static final Method getModule;
-    private static final Method getPackages;
-    private static final Method addUses;
-    private static final Method isExported;
-    private static final Method addExports;
-
-    static {
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            try {
-                getModule = Class.class.getMethod("getModule");
-                Class<?> moduleClass = getModule.getReturnType();
-                getPackages = moduleClass.getMethod("getPackages");
-                addUses = moduleClass.getMethod("addUses", Class.class);
-                isExported = moduleClass.getMethod("isExported", String.class, moduleClass);
-                addExports = moduleClass.getMethod("addExports", String.class, moduleClass);
-            } catch (NoSuchMethodException | SecurityException e) {
-                throw new InternalError(e);
-            }
-        } else {
-            getModule = null;
-            getPackages = null;
-            addUses = null;
-            isExported = null;
-            addExports = null;
+    @SuppressWarnings("unchecked")
+    private static Map<String, String> initSavedProperties() throws InternalError {
+        try {
+            Class<?> vmClass = Class.forName("jdk.internal.misc.VM");
+            Method m = vmClass.getMethod("getSavedProperties");
+            return (Map<String, String>) m.invoke(null);
+        } catch (Exception e) {
+            throw new InternalError(e);
         }
     }
 
-    @SuppressWarnings("unchecked")
-    static <T> T invoke(Method method, Object receiver, Object... args) {
-        try {
-            return (T) method.invoke(receiver, args);
-        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
-            throw new InternalError(e);
+    static final Map<String, String> SAVED_PROPERTIES = initSavedProperties();
+    static final boolean JVMCI_ENABLED = Boolean.parseBoolean(SAVED_PROPERTIES.get("jdk.internal.vm.ci.enabled"));
+
+    /**
+     * Checks that JVMCI is enabled in the VM and throws an error if it isn't.
+     */
+    static void checkJVMCIEnabled() {
+        if (!JVMCI_ENABLED) {
+            throw new Error("The EnableJVMCI VM option must be true (i.e., -XX:+EnableJVMCI) to use JVMCI");
         }
     }
 
     /**
-     * Performs any required security checks and dynamic reconfiguration to allow the module of a
-     * given class to access the classes in the JVMCI module.
-     *
-     * Note: This API uses {@link Class} instead of {@code Module} to provide backwards
-     * compatibility for JVMCI clients compiled against a JDK release earlier than 9.
-     *
-     * @param requestor a class requesting access to the JVMCI module for its module
-     * @throws SecurityException if a security manager is present and it denies
-     *             {@link JVMCIPermission}
+     * Gets an unmodifiable copy of the system properties saved when {@link System} is initialized.
      */
-    public static void exportJVMCITo(Class<?> requestor) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new JVMCIPermission());
-        }
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            Object jvmci = invoke(getModule, Services.class);
-            Object requestorModule = invoke(getModule, requestor);
-            if (jvmci != requestorModule) {
-                Set<String> packages = invoke(getPackages, jvmci);
-                for (String pkg : packages) {
-                    // Export all JVMCI packages dynamically instead
-                    // of requiring a long list of --add-exports
-                    // options on the JVM command line.
-                    boolean exported = invoke(isExported, jvmci, pkg, requestorModule);
-                    if (!exported) {
-                        invoke(addExports, jvmci, pkg, requestorModule);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Gets an {@link Iterable} of the JVMCI providers available for a given service.
-     *
-     * @throws SecurityException if a security manager is present and it denies
-     *             {@link JVMCIPermission}
-     */
-    public static <S> Iterable<S> load(Class<S> service) {
+    public static Map<String, String> getSavedProperties() {
+        checkJVMCIEnabled();
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             sm.checkPermission(new JVMCIPermission());
         }
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            Object jvmci = invoke(getModule, Services.class);
-            invoke(addUses, jvmci, service);
-        }
-
-        // Restrict JVMCI clients to be on the class path or module path
-        return ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
+        return SAVED_PROPERTIES;
     }
 
     /**
-     * Gets the JVMCI provider for a given service for which at most one provider must be available.
-     *
-     * @param service the service whose provider is being requested
-     * @param required specifies if an {@link InternalError} should be thrown if no provider of
-     *            {@code service} is available
-     * @throws SecurityException if a security manager is present and it denies
-     *             {@link JVMCIPermission}
+     * Causes the JVMCI subsystem to be initialized if it isn't already initialized.
      */
-    public static <S> S loadSingle(Class<S> service, boolean required) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new JVMCIPermission());
-        }
-        if (JAVA_SPECIFICATION_VERSION >= 9) {
-            Object jvmci = invoke(getModule, Services.class);
-            invoke(addUses, jvmci, service);
+    public static void initializeJVMCI() {
+        checkJVMCIEnabled();
+        try {
+            Class.forName("jdk.vm.ci.runtime.JVMCI");
+        } catch (ClassNotFoundException e) {
+            throw new InternalError(e);
         }
-        // Restrict JVMCI clients to be on the class path or module path
-        Iterable<S> providers = ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
-        S singleProvider = null;
-        try {
-            for (Iterator<S> it = providers.iterator(); it.hasNext();) {
-                singleProvider = it.next();
-                if (it.hasNext()) {
-                    throw new InternalError(String.format("Multiple %s providers found", service.getName()));
-                }
-            }
-        } catch (ServiceConfigurationError e) {
-            // If the service is required we will bail out below.
-        }
-        if (singleProvider == null && required) {
-            String javaHome = System.getProperty("java.home");
-            String vmName = System.getProperty("java.vm.name");
-            Formatter errorMessage = new Formatter();
-            errorMessage.format("The VM does not expose required service %s.%n", service.getName());
-            errorMessage.format("Currently used Java home directory is %s.%n", javaHome);
-            errorMessage.format("Currently used VM configuration is: %s", vmName);
-            throw new UnsupportedOperationException(errorMessage.toString());
-        }
-        return singleProvider;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/internal/ReflectionAccessJDK.java	Wed Jul 05 23:21:47 2017 +0200
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.vm.ci.services.internal;
+
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import jdk.vm.ci.services.Services;
+
+/**
+ * Reflection based access to API introduced in JDK 9. This allows the API to be used in code that
+ * must be compiled (but not executed) on JDK 8.
+ */
+public final class ReflectionAccessJDK {
+
+    /**
+     * {@code Class.getModule()}.
+     */
+    private static final Method getModule;
+
+    /**
+     * {@code java.lang.Module.addOpens(String, Module)}.
+     */
+    private static final Method addOpens;
+
+    /**
+     * {@code java.lang.Module.getPackages(Module, String, Module)}.
+     */
+    private static final Method getPackages;
+
+    /**
+     * {@code java.lang.Module.isOpen(String, Module)}.
+     */
+    private static final Method isOpenTo;
+
+    /**
+     * Opens all JVMCI packages to the module of a given class.
+     *
+     * @param other all JVMCI packages will be opened to the module of this class
+     */
+    @SuppressWarnings("unchecked")
+    public static void openJVMCITo(Class<?> other) {
+        try {
+            Object jvmci = getModule.invoke(Services.class);
+            Object otherModule = getModule.invoke(other);
+            if (jvmci != otherModule) {
+                Set<String> packages = (Set<String>) getPackages.invoke(jvmci);
+                for (String pkg : packages) {
+                    boolean opened = (Boolean) isOpenTo.invoke(jvmci, pkg, otherModule);
+                    if (!opened) {
+                        addOpens.invoke(jvmci, pkg, otherModule);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            throw new InternalError(e);
+        }
+    }
+
+    static {
+        try {
+            getModule = Class.class.getMethod("getModule");
+            Class<?> moduleClass = getModule.getReturnType();
+            getPackages = moduleClass.getMethod("getPackages");
+            isOpenTo = moduleClass.getMethod("isOpen", String.class, moduleClass);
+            addOpens = moduleClass.getDeclaredMethod("addOpens", String.class, moduleClass);
+        } catch (NoSuchMethodException | SecurityException e) {
+            throw new InternalError(e);
+        }
+    }
+}
--- a/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java	Wed Jul 05 23:21:47 2017 +0200
@@ -33,37 +33,4 @@
         jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory,
         jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory,
         jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory;
-
-    exports jdk.vm.ci.aarch64 to
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.amd64 to
-        jdk.aot,
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.code to
-        jdk.aot,
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.code.site to
-        jdk.aot,
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.code.stack to
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.common to
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.hotspot to
-        jdk.aot,
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.hotspot.aarch64 to
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.hotspot.amd64 to
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.hotspot.sparc to
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.meta to
-        jdk.aot,
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.runtime to
-        jdk.aot,
-        jdk.internal.vm.compiler;
-    exports jdk.vm.ci.sparc to
-        jdk.internal.vm.compiler;
 }
--- a/hotspot/src/jdk.internal.vm.compiler/.mx.graal/.pydevproject	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/.pydevproject	Wed Jul 05 23:21:47 2017 +0200
@@ -3,9 +3,9 @@
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/mx.graal</path>
-<path>/mx.graal</path>
-<path>/mx.graal</path>
+<path>/.mx.graal</path>
+<path>/.mx.graal</path>
+<path>/.mx.graal</path>
 </pydev_pathproperty>
 
 </pydev_project>
--- a/hotspot/src/jdk.internal.vm.compiler/.mx.graal/suite.py	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/suite.py	Wed Jul 05 23:21:47 2017 +0200
@@ -8,6 +8,36 @@
   # (e.g., macosx-x86_64-normal-server-release).
   "outputRoot" : "../../../build/mx/hotspot",
 
+  "jdklibraries" : {
+    "JVMCI_SERVICES" : {
+      "path" : "lib/jvmci-services.jar",
+      "sourcePath" : "lib/jvmci-services.src.zip",
+      "optional" : False,
+      "jdkStandardizedSince" : "9",
+      "module" : "jdk.internal.vm.ci"
+    },
+    "JVMCI_API" : {
+      "path" : "lib/jvmci/jvmci-api.jar",
+      "sourcePath" : "lib/jvmci/jvmci-api.src.zip",
+      "dependencies" : [
+        "JVMCI_SERVICES",
+      ],
+      "optional" : False,
+      "jdkStandardizedSince" : "9",
+      "module" : "jdk.internal.vm.ci"
+    },
+    "JVMCI_HOTSPOT" : {
+      "path" : "lib/jvmci/jvmci-hotspot.jar",
+      "sourcePath" : "lib/jvmci/jvmci-hotspot.src.zip",
+      "dependencies" : [
+        "JVMCI_API",
+      ],
+      "optional" : False,
+      "jdkStandardizedSince" : "9",
+      "module" : "jdk.internal.vm.ci"
+    },
+  },
+
   "libraries" : {
 
     # ------------- Libraries -------------
@@ -17,6 +47,16 @@
       "sha1" : "476d9a44cd19d6b55f81571077dfa972a4f8a083",
       "bootClassPathAgent" : "true",
     },
+    "ASM5" : {
+      "sha1" : "0da08b8cce7bbf903602a25a3a163ae252435795",
+      "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-5.0.4.jar"],
+    },
+
+    "ASM_TREE5" : {
+      "sha1" : "396ce0c07ba2b481f25a70195c7c94922f0d1b0b",
+      "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-tree-5.0.4.jar"],
+      "dependencies" : ["ASM5"],
+    },
   },
 
   "projects" : {
@@ -32,6 +72,7 @@
 
     "org.graalvm.compiler.serviceprovider" : {
       "subDir" : "share/classes",
+      "dependencies" : ["JVMCI_SERVICES"],
       "sourceDirs" : ["src"],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
@@ -49,6 +90,7 @@
 
     "org.graalvm.compiler.options" : {
       "subDir" : "share/classes",
+      "dependencies" : ["JVMCI_SERVICES", "JVMCI_API"],
       "sourceDirs" : ["src"],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
@@ -83,6 +125,7 @@
       "sourceDirs" : ["src"],
       "checkstyle" : "org.graalvm.compiler.graph",
       "dependencies" : [
+        "JVMCI_API",
         "org.graalvm.compiler.serviceprovider",
         "org.graalvm.compiler.options"
       ],
@@ -137,6 +180,7 @@
       "sourceDirs" : ["src"],
       "checkstyle" : "org.graalvm.compiler.graph",
       "dependencies" : [
+        "JVMCI_HOTSPOT",
         "org.graalvm.compiler.core.test",
       ],
       "javaCompliance" : "1.8",
@@ -146,6 +190,9 @@
     "org.graalvm.compiler.api.runtime" : {
       "subDir" : "share/classes",
       "sourceDirs" : ["src"],
+      "dependencies" : [
+        "JVMCI_API",
+      ],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
       "workingSets" : "API,Graal",
@@ -156,6 +203,7 @@
       "sourceDirs" : ["src"],
       "dependencies" : [
         "mx:JUNIT",
+        "JVMCI_SERVICES",
         "org.graalvm.compiler.api.runtime",
       ],
       "checkstyle" : "org.graalvm.compiler.graph",
@@ -166,6 +214,7 @@
     "org.graalvm.compiler.api.replacements" : {
       "subDir" : "share/classes",
       "sourceDirs" : ["src"],
+      "dependencies" : ["JVMCI_API"],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
       "workingSets" : "API,Graal,Replacements",
@@ -175,6 +224,7 @@
       "subDir" : "share/classes",
       "sourceDirs" : ["src"],
       "dependencies" : [
+        "JVMCI_HOTSPOT",
         "org.graalvm.compiler.api.runtime",
         "org.graalvm.compiler.replacements",
         "org.graalvm.compiler.runtime",
@@ -261,6 +311,8 @@
         "org.graalvm.compiler.hotspot",
         "org.graalvm.compiler.lir.jtt",
         "org.graalvm.compiler.lir.test",
+        "JVMCI_API",
+        "JVMCI_HOTSPOT",
       ],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
@@ -347,6 +399,9 @@
     "org.graalvm.compiler.asm" : {
       "subDir" : "share/classes",
       "sourceDirs" : ["src"],
+      "dependencies" : [
+        "JVMCI_API",
+      ],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
       "workingSets" : "Graal,Assembler",
@@ -403,6 +458,7 @@
     "org.graalvm.compiler.bytecode" : {
       "subDir" : "share/classes",
       "sourceDirs" : ["src"],
+      "dependencies" : ["JVMCI_API"],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
       "workingSets" : "Graal,Java",
@@ -774,6 +830,7 @@
       "dependencies" : [
         "org.graalvm.compiler.lir.jtt",
         "org.graalvm.compiler.lir.aarch64",
+        "JVMCI_HOTSPOT"
       ],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
@@ -803,6 +860,7 @@
       "dependencies" : [
         "org.graalvm.compiler.lir.jtt",
         "org.graalvm.compiler.lir.amd64",
+        "JVMCI_HOTSPOT"
       ],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
@@ -831,6 +889,7 @@
       "sourceDirs" : ["src"],
       "dependencies" : [
         "org.graalvm.compiler.lir.jtt",
+        "JVMCI_HOTSPOT"
       ],
       "checkstyle" : "org.graalvm.compiler.graph",
       "javaCompliance" : "1.8",
@@ -908,6 +967,7 @@
         "org.graalvm.compiler.graph.test",
         "org.graalvm.compiler.printer",
         "JAVA_ALLOCATION_INSTRUMENTER",
+        "ASM_TREE5",
       ],
       "annotationProcessors" : ["GRAAL_NODEINFO_PROCESSOR"],
       "checkstyle" : "org.graalvm.compiler.graph",
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,7 +40,7 @@
     private static final GraalRuntime runtime = initializeRuntime();
 
     private static GraalRuntime initializeRuntime() {
-        Services.exportJVMCITo(Graal.class);
+        Services.initializeJVMCI();
         JVMCICompiler compiler = JVMCI.getRuntime().getCompiler();
         if (compiler instanceof GraalJVMCICompiler) {
             GraalJVMCICompiler graal = (GraalJVMCICompiler) compiler;
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java	Wed Jul 05 23:21:47 2017 +0200
@@ -53,11 +53,6 @@
     public static final ModuleAPI getModule;
 
     /**
-     * {@code jdk.internal.module.Modules.addExports(Module, String, Module)}.
-     */
-    public static final ModuleAPI addExports;
-
-    /**
      * {@code java.lang.Module.getResourceAsStream(String)}.
      */
     public static final ModuleAPI getResourceAsStream;
@@ -116,13 +111,11 @@
             try {
                 getModule = new ModuleAPI(Class.class.getMethod("getModule"));
                 Class<?> moduleClass = getModule.method.getReturnType();
-                Class<?> modulesClass = Class.forName("jdk.internal.module.Modules");
                 getResourceAsStream = new ModuleAPI(moduleClass.getMethod("getResourceAsStream", String.class));
                 canRead = new ModuleAPI(moduleClass.getMethod("canRead", moduleClass));
                 isExported = new ModuleAPI(moduleClass.getMethod("isExported", String.class));
                 isExportedTo = new ModuleAPI(moduleClass.getMethod("isExported", String.class, moduleClass));
-                addExports = new ModuleAPI(modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass));
-            } catch (NoSuchMethodException | SecurityException | ClassNotFoundException e) {
+            } catch (NoSuchMethodException | SecurityException e) {
                 throw new InternalError(e);
             }
         } else {
@@ -132,8 +125,6 @@
             canRead = unavailable;
             isExported = unavailable;
             isExportedTo = unavailable;
-            addExports = unavailable;
         }
-
     }
 }
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java	Wed Jul 05 23:21:47 2017 +0200
@@ -127,7 +127,7 @@
         MetaAccessProvider metaAccess = providers.getMetaAccess();
 
         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
-        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
+        Plugins plugins = new Plugins(new InvocationPlugins());
         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -26,15 +26,14 @@
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 
-import org.junit.Test;
-
 import org.graalvm.compiler.code.CompilationResult;
 import org.graalvm.compiler.test.ExportingClassLoader;
+import org.junit.Test;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
 import jdk.vm.ci.code.InstalledCode;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -44,19 +44,17 @@
 import java.util.ServiceLoader;
 import java.util.Set;
 
-import org.junit.Test;
-
 import org.graalvm.compiler.options.OptionDescriptor;
 import org.graalvm.compiler.options.OptionDescriptors;
 import org.graalvm.compiler.options.OptionValue;
 import org.graalvm.compiler.test.GraalTest;
-
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.Type;
+import org.junit.Test;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
 
 /**
  * Verifies a class declaring one or more {@linkplain OptionValue options} has a class initializer
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -83,7 +83,7 @@
         MetaAccessProvider metaAccess = providers.getMetaAccess();
 
         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
-        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
+        Plugins plugins = new Plugins(new InvocationPlugins());
         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -24,10 +24,10 @@
 
 import jdk.vm.ci.code.BailoutException;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 
 import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID;
 
@@ -86,7 +86,7 @@
         ResolvedJavaMethod method = getResolvedJavaMethod(LOADER.findClass(INNER_CLASS_NAME), name);
         try {
             StructuredGraph graph = new StructuredGraph(method, AllowAssumptions.NO, INVALID_COMPILATION_ID);
-            Plugins plugins = new Plugins(new InvocationPlugins(getMetaAccess()));
+            Plugins plugins = new Plugins(new InvocationPlugins());
             GraphBuilderConfiguration graphBuilderConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
             OptimisticOptimizations optimisticOpts = OptimisticOptimizations.NONE;
 
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -122,7 +122,7 @@
         Providers providers = rt.getHostBackend().getProviders();
         MetaAccessProvider metaAccess = providers.getMetaAccess();
         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
-        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
+        Plugins plugins = new Plugins(new InvocationPlugins());
         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -300,7 +300,7 @@
         Providers providers = rt.getHostBackend().getProviders();
         MetaAccessProvider metaAccess = providers.getMetaAccess();
         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
-        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
+        Plugins plugins = new Plugins(new InvocationPlugins());
         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -267,7 +267,7 @@
         Providers providers = rt.getHostBackend().getProviders();
         MetaAccessProvider metaAccess = providers.getMetaAccess();
         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
-        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
+        Plugins plugins = new Plugins(new InvocationPlugins());
         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -249,7 +249,7 @@
         Providers providers = rt.getHostBackend().getProviders();
         MetaAccessProvider metaAccess = providers.getMetaAccess();
         PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
-        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
+        Plugins plugins = new Plugins(new InvocationPlugins());
         GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
         graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
         HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java	Wed Jul 05 23:21:47 2017 +0200
@@ -253,7 +253,7 @@
                      * the code before static analysis, the classes would otherwise be not loaded
                      * yet and the bytecode parser would only create a graph.
                      */
-                    Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
+                    Plugins plugins = new Plugins(new InvocationPlugins());
                     GraphBuilderConfiguration graphBuilderConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
                     /*
                      * For simplicity, we ignore all exception handling during the static analysis.
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java	Wed Jul 05 23:21:47 2017 +0200
@@ -29,15 +29,12 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.stream.Collectors;
 
-import org.junit.Test;
-
 import org.graalvm.compiler.api.test.Graal;
 import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
@@ -45,12 +42,15 @@
 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
+import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Binding;
 import org.graalvm.compiler.runtime.RuntimeProvider;
 import org.graalvm.compiler.test.GraalTest;
+import org.junit.Test;
 
 import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
 import jdk.vm.ci.hotspot.VMIntrinsicMethod;
 import jdk.vm.ci.meta.MetaAccessProvider;
+import jdk.vm.ci.meta.MetaUtil;
 import jdk.vm.ci.meta.MethodHandleAccessProvider.IntrinsicMethod;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
@@ -63,11 +63,10 @@
  */
 public class CheckGraalIntrinsics extends GraalTest {
 
-    public static boolean match(ResolvedJavaMethod method, VMIntrinsicMethod intrinsic) {
-        if (intrinsic.name.equals(method.getName())) {
-            if (intrinsic.descriptor.equals(method.getSignature().toMethodDescriptor())) {
-                String declaringClass = method.getDeclaringClass().toClassName().replace('.', '/');
-                if (declaringClass.equals(intrinsic.declaringClass)) {
+    public static boolean match(String type, Binding binding, VMIntrinsicMethod intrinsic) {
+        if (intrinsic.name.equals(binding.name)) {
+            if (intrinsic.descriptor.startsWith(binding.argumentsDescriptor)) {
+                if (type.equals(intrinsic.declaringClass)) {
                     return true;
                 }
             }
@@ -75,16 +74,20 @@
         return false;
     }
 
-    private static ResolvedJavaMethod findMethod(Set<ResolvedJavaMethod> methods, VMIntrinsicMethod intrinsic) {
-        for (ResolvedJavaMethod method : methods) {
-            if (match(method, intrinsic)) {
-                return method;
+    public static InvocationPlugin findPlugin(Map<String, List<Binding>> bindings, VMIntrinsicMethod intrinsic) {
+        for (Map.Entry<String, List<Binding>> e : bindings.entrySet()) {
+            // Match format of VMIntrinsicMethod.declaringClass
+            String type = MetaUtil.internalNameToJava(e.getKey(), true, false).replace('.', '/');
+            for (Binding binding : e.getValue()) {
+                if (match(type, binding, intrinsic)) {
+                    return binding.plugin;
+                }
             }
         }
         return null;
     }
 
-    private static ResolvedJavaMethod resolveIntrinsic(MetaAccessProvider metaAccess, VMIntrinsicMethod intrinsic) throws ClassNotFoundException {
+    public static ResolvedJavaMethod resolveIntrinsic(MetaAccessProvider metaAccess, VMIntrinsicMethod intrinsic) throws ClassNotFoundException {
         Class<?> c = Class.forName(intrinsic.declaringClass.replace('/', '.'), false, CheckGraalIntrinsics.class.getClassLoader());
         for (Method javaMethod : c.getDeclaredMethods()) {
             if (javaMethod.getName().equals(intrinsic.name)) {
@@ -425,28 +428,20 @@
     public void test() throws ClassNotFoundException {
         HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
         HotSpotProviders providers = rt.getHostBackend().getProviders();
-        Map<ResolvedJavaMethod, Object> impl = new HashMap<>();
         Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
         InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
-        for (ResolvedJavaMethod method : invocationPlugins.getMethods()) {
-            InvocationPlugin plugin = invocationPlugins.lookupInvocation(method);
-            assert plugin != null;
-            impl.put(method, plugin);
-        }
 
-        Set<ResolvedJavaMethod> methods = invocationPlugins.getMethods();
         HotSpotVMConfigStore store = rt.getVMConfig().getStore();
         List<VMIntrinsicMethod> intrinsics = store.getIntrinsics();
 
         List<String> missing = new ArrayList<>();
+        Map<String, List<Binding>> bindings = invocationPlugins.getBindings(true);
         for (VMIntrinsicMethod intrinsic : intrinsics) {
-            ResolvedJavaMethod method = findMethod(methods, intrinsic);
-            if (method == null) {
-                method = resolveIntrinsic(providers.getMetaAccess(), intrinsic);
-
-                IntrinsicMethod intrinsicMethod = null;
+            InvocationPlugin plugin = findPlugin(bindings, intrinsic);
+            if (plugin == null) {
+                ResolvedJavaMethod method = resolveIntrinsic(providers.getMetaAccess(), intrinsic);
                 if (method != null) {
-                    intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
+                    IntrinsicMethod intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
                     if (intrinsicMethod != null) {
                         continue;
                     }
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java	Wed Jul 05 23:21:47 2017 +0200
@@ -39,9 +39,9 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
 public class ConstantPoolSubstitutionsTests extends GraalCompilerTest implements Opcodes {
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java	Wed Jul 05 23:21:47 2017 +0200
@@ -22,13 +22,12 @@
  */
 package org.graalvm.compiler.hotspot.test;
 
+import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID;
+
 import java.util.List;
-import java.util.Set;
-
-import org.junit.Test;
+import java.util.Map;
 
 import org.graalvm.compiler.api.test.Graal;
-import org.graalvm.compiler.core.common.CompilationIdentifier;
 import org.graalvm.compiler.core.test.GraalCompilerTest;
 import org.graalvm.compiler.hotspot.HotSpotGraalCompiler;
 import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
@@ -37,8 +36,10 @@
 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
+import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Binding;
 import org.graalvm.compiler.nodes.graphbuilderconf.MethodSubstitutionPlugin;
 import org.graalvm.compiler.runtime.RuntimeProvider;
+import org.junit.Test;
 
 import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
 import jdk.vm.ci.hotspot.VMIntrinsicMethod;
@@ -50,46 +51,27 @@
  */
 public class TestIntrinsicCompiles extends GraalCompilerTest {
 
-    private static boolean match(ResolvedJavaMethod method, VMIntrinsicMethod intrinsic) {
-        if (intrinsic.name.equals(method.getName())) {
-            if (intrinsic.descriptor.equals(method.getSignature().toMethodDescriptor())) {
-                String declaringClass = method.getDeclaringClass().toClassName().replace('.', '/');
-                if (declaringClass.equals(intrinsic.declaringClass)) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    private static ResolvedJavaMethod findMethod(Set<ResolvedJavaMethod> methods, VMIntrinsicMethod intrinsic) {
-        for (ResolvedJavaMethod method : methods) {
-            if (match(method, intrinsic)) {
-                return method;
-            }
-        }
-        return null;
-    }
-
     @Test
     @SuppressWarnings("try")
-    public void test() {
+    public void test() throws ClassNotFoundException {
         HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) JVMCI.getRuntime().getCompiler();
         HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
         HotSpotProviders providers = rt.getHostBackend().getProviders();
         Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
         InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
 
-        Set<ResolvedJavaMethod> pluginMethods = invocationPlugins.getMethods();
+        Map<String, List<Binding>> bindings = invocationPlugins.getBindings(true);
         HotSpotVMConfigStore store = rt.getVMConfig().getStore();
         List<VMIntrinsicMethod> intrinsics = store.getIntrinsics();
         for (VMIntrinsicMethod intrinsic : intrinsics) {
-            ResolvedJavaMethod method = findMethod(pluginMethods, intrinsic);
-            if (method != null) {
-                InvocationPlugin plugin = invocationPlugins.lookupInvocation(method);
-                if (plugin instanceof MethodSubstitutionPlugin && !method.isNative()) {
-                    StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, CompilationIdentifier.INVALID_COMPILATION_ID);
-                    getCode(method, graph);
+            InvocationPlugin plugin = CheckGraalIntrinsics.findPlugin(bindings, intrinsic);
+            if (plugin != null) {
+                if (plugin instanceof MethodSubstitutionPlugin) {
+                    ResolvedJavaMethod method = CheckGraalIntrinsics.resolveIntrinsic(getMetaAccess(), intrinsic);
+                    if (!method.isNative()) {
+                        StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, INVALID_COMPILATION_ID);
+                        getCode(method, graph);
+                    }
                 }
             }
         }
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java	Wed Jul 05 23:21:47 2017 +0200
@@ -102,7 +102,6 @@
 import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.runtime.JVMCI;
 import jdk.vm.ci.runtime.JVMCICompiler;
-import jdk.vm.ci.services.Services;
 
 /**
  * This class implements compile-the-world functionality with JVMCI.
@@ -785,7 +784,6 @@
     }
 
     public static void main(String[] args) throws Throwable {
-        Services.exportJVMCITo(CompileTheWorld.class);
         HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) HotSpotJVMCIRuntime.runtime().getCompiler();
         compiler.compileTheWorld();
     }
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java	Wed Jul 05 23:21:47 2017 +0200
@@ -22,21 +22,19 @@
  */
 package org.graalvm.compiler.hotspot;
 
-import static org.graalvm.compiler.core.common.util.Util.Java8OrEarlier;
+import static jdk.vm.ci.common.InitTimer.timer;
 import static org.graalvm.compiler.options.OptionValue.PROFILE_OPTIONVALUE_PROPERTY_NAME;
-import static jdk.vm.ci.common.InitTimer.timer;
 
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.PrintStream;
-import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.ServiceLoader;
 
-import org.graalvm.compiler.debug.GraalError;
 import org.graalvm.compiler.debug.MethodFilter;
 import org.graalvm.compiler.options.Option;
 import org.graalvm.compiler.options.OptionDescriptors;
@@ -46,10 +44,11 @@
 import org.graalvm.compiler.phases.tiers.CompilerConfiguration;
 
 import jdk.vm.ci.common.InitTimer;
+import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory;
 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
 import jdk.vm.ci.hotspot.HotSpotSignature;
-import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory;
 import jdk.vm.ci.runtime.JVMCIRuntime;
+import jdk.vm.ci.services.Services;
 
 public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFactory {
 
@@ -135,8 +134,8 @@
         if (allOptionsSettings == null) {
             try (InitTimer t = timer("InitializeOptions")) {
                 ServiceLoader<OptionDescriptors> loader = ServiceLoader.load(OptionDescriptors.class, OptionDescriptors.class.getClassLoader());
-                Properties savedProps = getSavedProperties(Java8OrEarlier);
-                String optionsFile = savedProps.getProperty(GRAAL_OPTIONS_FILE_PROPERTY_NAME);
+                Map<String, String> savedProps = Services.getSavedProperties();
+                String optionsFile = savedProps.get(GRAAL_OPTIONS_FILE_PROPERTY_NAME);
 
                 if (optionsFile != null) {
                     File graalOptions = new File(optionsFile);
@@ -165,15 +164,15 @@
                 }
 
                 Map<String, String> optionSettings = new HashMap<>();
-                for (Map.Entry<Object, Object> e : savedProps.entrySet()) {
-                    String name = (String) e.getKey();
+                for (Entry<String, String> e : savedProps.entrySet()) {
+                    String name = e.getKey();
                     if (name.startsWith(GRAAL_OPTION_PROPERTY_PREFIX)) {
                         if (name.equals("graal.PrintFlags") || name.equals("graal.ShowFlags")) {
                             System.err.println("The " + name + " option has been removed and will be ignored. Use -XX:+JVMCIPrintProperties instead.");
                         } else if (name.equals(GRAAL_OPTIONS_FILE_PROPERTY_NAME) || name.equals(GRAAL_VERSION_PROPERTY_NAME) || name.equals(PROFILE_OPTIONVALUE_PROPERTY_NAME)) {
                             // Ignore well known properties that do not denote an option
                         } else {
-                            String value = (String) e.getValue();
+                            String value = e.getValue();
                             optionSettings.put(name.substring(GRAAL_OPTION_PROPERTY_PREFIX.length()), value);
                         }
                     }
@@ -206,18 +205,6 @@
         }
     }
 
-    private static Properties getSavedProperties(boolean jdk8OrEarlier) {
-        try {
-            String vmClassName = jdk8OrEarlier ? "sun.misc.VM" : "jdk.internal.misc.VM";
-            Class<?> vmClass = Class.forName(vmClassName);
-            Field savedPropsField = vmClass.getDeclaredField("savedProps");
-            savedPropsField.setAccessible(true);
-            return (Properties) savedPropsField.get(null);
-        } catch (Exception e) {
-            throw new GraalError(e);
-        }
-    }
-
     @Override
     public HotSpotGraalCompiler createCompiler(JVMCIRuntime runtime) {
         HotSpotGraalCompiler compiler = createCompiler(runtime, CompilerConfigurationFactory.selectFactory(null));
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java	Wed Jul 05 23:21:47 2017 +0200
@@ -22,10 +22,6 @@
  */
 package org.graalvm.compiler.hotspot;
 
-import static org.graalvm.compiler.core.common.util.ModuleAPI.addExports;
-import static org.graalvm.compiler.core.common.util.ModuleAPI.getModule;
-import static org.graalvm.compiler.core.common.util.Util.JAVA_SPECIFICATION_VERSION;
-
 import org.graalvm.compiler.serviceprovider.ServiceProvider;
 
 import jdk.vm.ci.hotspot.HotSpotVMEventListener;
@@ -35,43 +31,45 @@
 @ServiceProvider(JVMCIServiceLocator.class)
 public final class HotSpotGraalJVMCIServiceLocator extends JVMCIServiceLocator {
 
-    private boolean exportsAdded;
-
     /**
-     * Dynamically exports various internal JDK packages to the Graal module. This requires only
-     * {@code --add-exports=java.base/jdk.internal.module=org.graalvm.compiler.graal_core} on the VM
-     * command line instead of a {@code --add-exports} instance for each JDK internal package used
-     * by Graal.
+     * Holds the state shared between all {@link HotSpotGraalJVMCIServiceLocator} instances. This is
+     * necessary as a service provider instance is created each time the service is loaded.
      */
-    private void addExports() {
-        if (JAVA_SPECIFICATION_VERSION >= 9 && !exportsAdded) {
-            Object javaBaseModule = getModule.invoke(String.class);
-            Object graalModule = getModule.invoke(getClass());
-            addExports.invokeStatic(javaBaseModule, "jdk.internal.misc", graalModule);
-            addExports.invokeStatic(javaBaseModule, "jdk.internal.jimage", graalModule);
-            addExports.invokeStatic(javaBaseModule, "com.sun.crypto.provider", graalModule);
-            exportsAdded = true;
+    private static final class Shared {
+        static final Shared SINGLETON = new Shared();
+
+        <T> T getProvider(Class<T> service, HotSpotGraalJVMCIServiceLocator locator) {
+            if (service == JVMCICompilerFactory.class) {
+                return service.cast(new HotSpotGraalCompilerFactory(locator));
+            } else if (service == HotSpotVMEventListener.class) {
+                if (graalRuntime != null) {
+                    return service.cast(new HotSpotGraalVMEventListener(graalRuntime));
+                }
+            }
+            return null;
+        }
+
+        private HotSpotGraalRuntime graalRuntime;
+
+        /**
+         * Notifies this object of the compiler created via {@link HotSpotGraalJVMCIServiceLocator}.
+         */
+        void onCompilerCreation(HotSpotGraalCompiler compiler) {
+            assert this.graalRuntime == null : "only expect a single JVMCICompiler to be created";
+            this.graalRuntime = (HotSpotGraalRuntime) compiler.getGraalRuntime();
         }
     }
 
-    private HotSpotGraalRuntime graalRuntime;
-
     @Override
     public <T> T getProvider(Class<T> service) {
-        if (service == JVMCICompilerFactory.class) {
-            addExports();
-            return service.cast(new HotSpotGraalCompilerFactory(this));
-        } else if (service == HotSpotVMEventListener.class) {
-            if (graalRuntime != null) {
-                addExports();
-                return service.cast(new HotSpotGraalVMEventListener(graalRuntime));
-            }
-        }
-        return null;
+        return Shared.SINGLETON.getProvider(service, this);
     }
 
-    public void onCompilerCreation(HotSpotGraalCompiler compiler) {
-        assert this.graalRuntime == null : "only expect a single JVMCICompiler to be created";
-        this.graalRuntime = (HotSpotGraalRuntime) compiler.getGraalRuntime();
+    /**
+     * Notifies this object of the compiler created via {@link HotSpotGraalJVMCIServiceLocator}.
+     */
+    @SuppressWarnings("static-method")
+    void onCompilerCreation(HotSpotGraalCompiler compiler) {
+        Shared.SINGLETON.onCompilerCreation(compiler);
     }
 }
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java	Wed Jul 05 23:21:47 2017 +0200
@@ -128,7 +128,7 @@
      */
     public static Plugins create(GraalHotSpotVMConfig config, HotSpotWordTypes wordTypes, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection,
                     SnippetReflectionProvider snippetReflection, ForeignCallsProvider foreignCalls, StampProvider stampProvider, ReplacementsImpl replacements) {
-        InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config, metaAccess);
+        InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config);
 
         Plugins plugins = new Plugins(invocationPlugins);
         NodeIntrinsificationProvider nodeIntrinsificationProvider = new NodeIntrinsificationProvider(metaAccess, snippetReflection, foreignCalls, wordTypes);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java	Wed Jul 05 23:21:47 2017 +0200
@@ -38,7 +38,6 @@
 import org.graalvm.compiler.replacements.nodes.MacroNode;
 
 import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.ResolvedJavaType;
 
 /**
@@ -47,8 +46,7 @@
 final class HotSpotInvocationPlugins extends InvocationPlugins {
     final GraalHotSpotVMConfig config;
 
-    HotSpotInvocationPlugins(GraalHotSpotVMConfig config, MetaAccessProvider metaAccess) {
-        super(metaAccess);
+    HotSpotInvocationPlugins(GraalHotSpotVMConfig config) {
         this.config = config;
     }
 
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java	Wed Jul 05 23:21:47 2017 +0200
@@ -29,8 +29,6 @@
 import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.probability;
 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset;
 
-import java.lang.reflect.Field;
-
 import org.graalvm.compiler.api.replacements.ClassSubstitution;
 import org.graalvm.compiler.api.replacements.MethodSubstitution;
 import org.graalvm.compiler.core.common.LocationIdentity;
@@ -61,7 +59,7 @@
     static final long kOffset;
     static final long lastKeyOffset;
     static final Class<?> AESCryptClass;
-    static final int AES_BLOCK_SIZE;
+    static final int AES_BLOCK_SIZE_IN_BYTES;
 
     static {
         try {
@@ -72,9 +70,9 @@
             AESCryptClass = Class.forName("com.sun.crypto.provider.AESCrypt", true, cl);
             kOffset = UnsafeAccess.UNSAFE.objectFieldOffset(AESCryptClass.getDeclaredField("K"));
             lastKeyOffset = UnsafeAccess.UNSAFE.objectFieldOffset(AESCryptClass.getDeclaredField("lastKey"));
-            Field aesBlockSizeField = Class.forName("com.sun.crypto.provider.AESConstants", true, cl).getDeclaredField("AES_BLOCK_SIZE");
-            aesBlockSizeField.setAccessible(true);
-            AES_BLOCK_SIZE = aesBlockSizeField.getInt(null);
+            // Thankfully the AES block size is a constant (128 bits) and so we don't need to
+            // reflect on com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE.
+            AES_BLOCK_SIZE_IN_BYTES = 16;
         } catch (Exception ex) {
             throw new GraalError(ex);
         }
@@ -141,7 +139,7 @@
      * Perform null and array bounds checks for arguments to a cipher operation.
      */
     static void checkArgs(byte[] in, int inOffset, byte[] out, int outOffset) {
-        if (probability(VERY_SLOW_PATH_PROBABILITY, inOffset < 0 || in.length - AES_BLOCK_SIZE < inOffset || outOffset < 0 || out.length - AES_BLOCK_SIZE < outOffset)) {
+        if (probability(VERY_SLOW_PATH_PROBABILITY, inOffset < 0 || in.length - AES_BLOCK_SIZE_IN_BYTES < inOffset || outOffset < 0 || out.length - AES_BLOCK_SIZE_IN_BYTES < outOffset)) {
             DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
         }
     }
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java	Wed Jul 05 23:21:47 2017 +0200
@@ -57,7 +57,7 @@
         return config.crcTableAddress;
     }
 
-    @MethodSubstitution
+    @MethodSubstitution(optional = true)
     static int update(int crc, int b) {
         final long crcTableRawAddress = GraalHotSpotVMConfigNode.crcTableAddress();
 
@@ -69,7 +69,7 @@
         return ~result;
     }
 
-    @MethodSubstitution
+    @MethodSubstitution(optional = true)
     static int updateBytes(int crc, byte[] buf, int off, int len) {
         Word bufAddr = Word.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off));
         return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
@@ -84,7 +84,7 @@
         return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
     }
 
-    @MethodSubstitution
+    @MethodSubstitution(optional = true)
     static int updateByteBuffer(int crc, long addr, int off, int len) {
         Word bufAddr = Word.unsigned(addr).add(off);
         return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java	Wed Jul 05 23:21:47 2017 +0200
@@ -45,7 +45,7 @@
 @ClassSubstitution(Thread.class)
 public class ThreadSubstitutions {
 
-    @MethodSubstitution(isStatic = false)
+    @MethodSubstitution(isStatic = false, optional = true)
     public static boolean isInterrupted(final Thread thisObject, boolean clearInterrupted) {
         Word javaThread = CurrentJavaThreadNode.get();
         Object thread = javaThread.readObject(threadObjectOffset(INJECTED_VMCONFIG), JAVA_THREAD_THREAD_OBJECT_LOCATION);
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,8 +40,7 @@
 
     /**
      * The receiver in a non-static method. The class literal for this interface must be used with
-     * {@link InvocationPlugins#put(InvocationPlugin, boolean, boolean, boolean, Class, String, Class...)}
-     * to denote the receiver argument for such a non-static method.
+     * {@link InvocationPlugins#put} to denote the receiver argument for such a non-static method.
      */
     public interface Receiver {
         /**
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java	Wed Jul 05 23:21:47 2017 +0200
@@ -23,8 +23,9 @@
 package org.graalvm.compiler.nodes.graphbuilderconf;
 
 import static java.lang.String.format;
+import static org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.LateClassPlugins.CLOSED_LATE_CLASS_PLUGIN;
 
-import java.lang.reflect.Executable;
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
@@ -32,10 +33,8 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.graalvm.compiler.api.replacements.MethodSubstitution;
 import org.graalvm.compiler.api.replacements.MethodSubstitutionRegistry;
@@ -46,12 +45,24 @@
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver;
 
-import jdk.vm.ci.meta.MetaAccessProvider;
 import jdk.vm.ci.meta.MetaUtil;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.meta.Signature;
 
 /**
  * Manages a set of {@link InvocationPlugin}s.
+ *
+ * Most plugins are registered during initialization (i.e., before
+ * {@link #lookupInvocation(ResolvedJavaMethod)} or {@link #getBindings} is called). These
+ * registrations can be made with {@link Registration},
+ * {@link #register(InvocationPlugin, String, String, Type...)},
+ * {@link #register(InvocationPlugin, Type, String, Type...)} or
+ * {@link #registerOptional(InvocationPlugin, Type, String, Type...)}. Initialization is not
+ * thread-safe and so must only be performed by a single thread.
+ *
+ * Plugins that are not guaranteed to be made during initialization must use
+ * {@link LateRegistration}.
  */
 public class InvocationPlugins {
 
@@ -260,6 +271,26 @@
         }
 
         /**
+         * Registers a plugin for a method with 6 arguments.
+         *
+         * @param name the name of the method
+         * @param plugin the plugin to be registered
+         */
+        public void register6(String name, Type arg1, Type arg2, Type arg3, Type arg4, Type arg5, Type arg6, InvocationPlugin plugin) {
+            plugins.register(plugin, false, allowOverwrite, declaringType, name, arg1, arg2, arg3, arg4, arg5, arg6);
+        }
+
+        /**
+         * Registers a plugin for a method with 7 arguments.
+         *
+         * @param name the name of the method
+         * @param plugin the plugin to be registered
+         */
+        public void register7(String name, Type arg1, Type arg2, Type arg3, Type arg4, Type arg5, Type arg6, Type arg7, InvocationPlugin plugin) {
+            plugins.register(plugin, false, allowOverwrite, declaringType, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+        }
+
+        /**
          * Registers a plugin for an optional method with no arguments.
          *
          * @param name the name of the method
@@ -337,168 +368,151 @@
          */
         @Override
         public void registerMethodSubstitution(Class<?> substituteDeclaringClass, String name, String substituteName, Type... argumentTypes) {
+            MethodSubstitutionPlugin plugin = createMethodSubstitution(substituteDeclaringClass, substituteName, argumentTypes);
+            plugins.register(plugin, false, allowOverwrite, declaringType, name, argumentTypes);
+        }
+
+        public MethodSubstitutionPlugin createMethodSubstitution(Class<?> substituteDeclaringClass, String substituteName, Type... argumentTypes) {
             assert methodSubstitutionBytecodeProvider != null : "Registration used for method substitutions requires a non-null methodSubstitutionBytecodeProvider";
             MethodSubstitutionPlugin plugin = new MethodSubstitutionPlugin(methodSubstitutionBytecodeProvider, substituteDeclaringClass, substituteName, argumentTypes);
-            plugins.register(plugin, false, allowOverwrite, declaringType, name, argumentTypes);
+            return plugin;
         }
+
     }
 
     /**
-     * Key for a {@linkplain ClassPlugins#entries resolved} plugin registration. Due to the
-     * possibility of class redefinition, we cannot directly use {@link ResolvedJavaMethod}s as
-     * keys. A {@link ResolvedJavaMethod} implementation might implement {@code equals()} and
-     * {@code hashCode()} based on internal representation subject to change by class redefinition.
+     * Utility for registering plugins after Graal may have been initialized. Registrations made via
+     * this class are not finalized until {@link #close} is called.
      */
-    static final class ResolvedJavaMethodKey {
-        private final ResolvedJavaMethod method;
+    public static class LateRegistration implements AutoCloseable {
+
+        private InvocationPlugins plugins;
+        private final List<Binding> bindings = new ArrayList<>();
+        private final Type declaringType;
+
+        /**
+         * Creates an object for registering {@link InvocationPlugin}s for methods declared by a
+         * given class.
+         *
+         * @param plugins where to register the plugins
+         * @param declaringType the class declaring the methods for which plugins will be registered
+         *            via this object
+         */
+        public LateRegistration(InvocationPlugins plugins, Type declaringType) {
+            this.plugins = plugins;
+            this.declaringType = declaringType;
+        }
 
-        ResolvedJavaMethodKey(ResolvedJavaMethod method) {
-            this.method = method;
+        /**
+         * Registers an invocation plugin for a given method. There must be no plugin currently
+         * registered for {@code method}.
+         *
+         * @param argumentTypes the argument types of the method. Element 0 of this array must be
+         *            the {@link Class} value for {@link InvocationPlugin.Receiver} iff the method
+         *            is non-static. Upon returning, element 0 will have been rewritten to
+         *            {@code declaringClass}
+         */
+        public void register(InvocationPlugin plugin, String name, Type... argumentTypes) {
+            boolean isStatic = argumentTypes.length == 0 || argumentTypes[0] != InvocationPlugin.Receiver.class;
+            if (!isStatic) {
+                argumentTypes[0] = declaringType;
+            }
+
+            assert isStatic || argumentTypes[0] == declaringType;
+            Binding binding = new Binding(plugin, isStatic, name, argumentTypes);
+            bindings.add(binding);
+
+            assert Checks.check(this.plugins, declaringType, binding);
+            assert Checks.checkResolvable(false, declaringType, binding);
         }
 
         @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof ResolvedJavaMethodKey) {
-                ResolvedJavaMethodKey that = (ResolvedJavaMethodKey) obj;
-                if (this.method.isStatic() == that.method.isStatic()) {
-                    if (this.method.getDeclaringClass().equals(that.method.getDeclaringClass())) {
-                        if (this.method.getName().equals(that.method.getName())) {
-                            if (this.method.getSignature().equals(that.method.getSignature())) {
-                                return true;
-                            }
-                        }
-                    }
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public int hashCode() {
-            return this.method.getName().hashCode();
-        }
-
-        @Override
-        public String toString() {
-            return "ResolvedJavaMethodKey<" + method + ">";
+        public void close() {
+            assert plugins != null : String.format("Late registrations of invocation plugins for %s is already closed", declaringType);
+            plugins.registerLate(declaringType, bindings);
+            plugins = null;
         }
     }
 
     /**
-     * Key for {@linkplain ClassPlugins#registrations registering} an {@link InvocationPlugin} for a
-     * specific method.
+     * Associates an {@link InvocationPlugin} with the details of a method it substitutes.
      */
-    static class MethodKey {
-        final boolean isStatic;
+    public static class Binding {
+        /**
+         * The plugin this binding is for.
+         */
+        public final InvocationPlugin plugin;
 
         /**
-         * This method is optional. This is used for new API methods not present in previous JDK
-         * versions.
+         * Specifies if the associated method is static.
          */
-        final boolean isOptional;
+        public final boolean isStatic;
 
-        final String name;
-        final Type[] argumentTypes;
-        final InvocationPlugin value;
+        /**
+         * The name of the associated method.
+         */
+        public final String name;
 
         /**
-         * Used to lazily initialize {@link #resolved}.
+         * A partial
+         * <a href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">method
+         * descriptor</a> for the associated method. The descriptor includes enclosing {@code '('}
+         * and {@code ')'} characters but omits the return type suffix.
          */
-        private final MetaAccessProvider metaAccess;
-
-        private volatile ResolvedJavaMethod resolved;
+        public final String argumentsDescriptor;
 
-        MethodKey(MetaAccessProvider metaAccess, InvocationPlugin data, boolean isStatic, boolean isOptional, String name, Type... argumentTypes) {
-            this.metaAccess = metaAccess;
-            this.value = data;
+        /**
+         * Link in a list of bindings.
+         */
+        private Binding next;
+
+        Binding(InvocationPlugin data, boolean isStatic, String name, Type... argumentTypes) {
+            this.plugin = data;
             this.isStatic = isStatic;
-            this.isOptional = isOptional;
             this.name = name;
-            this.argumentTypes = argumentTypes;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof MethodKey) {
-                MethodKey that = (MethodKey) obj;
-                boolean res = this.name.equals(that.name) && areEqual(this.argumentTypes, that.argumentTypes);
-                assert !res || this.isStatic == that.isStatic;
-                return res;
+            StringBuilder buf = new StringBuilder();
+            buf.append('(');
+            for (int i = isStatic ? 0 : 1; i < argumentTypes.length; i++) {
+                buf.append(MetaUtil.toInternalName(argumentTypes[i].getTypeName()));
             }
-            return false;
+            buf.append(')');
+            this.argumentsDescriptor = buf.toString();
+            assert !name.equals("<init>") || !isStatic : this;
         }
 
-        private static boolean areEqual(Type[] args1, Type[] args2) {
-            if (args1.length == args2.length) {
-                for (int i = 0; i < args1.length; i++) {
-                    if (!args1[i].getTypeName().equals(args2[i].getTypeName())) {
-                        return false;
-                    }
-                }
-                return true;
-            }
-            return false;
-        }
-
-        public int getDeclaredParameterCount() {
-            return isStatic ? argumentTypes.length : argumentTypes.length - 1;
-        }
-
-        @Override
-        public int hashCode() {
-            return name.hashCode();
-        }
-
-        private ResolvedJavaMethod resolve(Class<?> declaringClass) {
-            if (resolved == null) {
-                Executable method = resolveJava(declaringClass);
-                if (method == null) {
-                    return null;
-                }
-                resolved = metaAccess.lookupJavaMethod(method);
-            }
-            return resolved;
-        }
-
-        private Executable resolveJava(Class<?> declaringClass) {
-            try {
-                Executable res;
-                Class<?>[] parameterTypes = resolveTypes(argumentTypes, isStatic ? 0 : 1, argumentTypes.length);
-                if (name.equals("<init>")) {
-                    res = declaringClass.getDeclaredConstructor(parameterTypes);
-                } else {
-                    res = declaringClass.getDeclaredMethod(name, parameterTypes);
-                }
-                assert Modifier.isStatic(res.getModifiers()) == isStatic : res;
-                return res;
-            } catch (NoSuchMethodException | SecurityException e) {
-                if (isOptional) {
-                    return null;
-                }
-                throw new InternalError(e);
-            }
+        Binding(ResolvedJavaMethod resolved, InvocationPlugin data) {
+            this.plugin = data;
+            this.isStatic = resolved.isStatic();
+            this.name = resolved.getName();
+            Signature sig = resolved.getSignature();
+            String desc = sig.toMethodDescriptor();
+            assert desc.indexOf(')') != -1 : desc;
+            this.argumentsDescriptor = desc.substring(0, desc.indexOf(')') + 1);
+            assert !name.equals("<init>") || !isStatic : this;
         }
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder(name).append('(');
-            for (Type p : argumentTypes) {
-                if (sb.charAt(sb.length() - 1) != '(') {
-                    sb.append(", ");
-                }
-                sb.append(p.getTypeName());
-            }
-            return sb.append(')').toString();
+            return name + argumentsDescriptor;
         }
     }
 
-    private final MetaAccessProvider metaAccess;
-
-    private final Map<String, ClassPlugins> registrations = new HashMap<>();
+    /**
+     * Plugin registrations for already resolved methods. If non-null, then {@link #registrations}
+     * is null and no further registrations can be made.
+     */
+    private final Map<ResolvedJavaMethod, InvocationPlugin> resolvedRegistrations;
 
     /**
-     * Deferred registrations as well as guard for initialization. The guard uses double-checked
-     * locking which is why this field is {@code volatile}.
+     * Map from class names in {@linkplain MetaUtil#toInternalName(String) internal} form to the
+     * invocation plugin bindings for the class. Tf non-null, then {@link #resolvedRegistrations}
+     * will be null.
+     */
+    private final Map<String, ClassPlugins> registrations;
+
+    /**
+     * Deferred registrations as well as the guard for delimiting the initial registration phase.
+     * The guard uses double-checked locking which is why this field is {@code volatile}.
      */
     private volatile List<Runnable> deferredRegistrations = new ArrayList<>();
 
@@ -512,119 +526,159 @@
     }
 
     /**
-     * Per-class invocation plugins.
+     * Support for registering plugins once this object may be accessed by multiple threads.
+     */
+    private volatile LateClassPlugins lateRegistrations;
+
+    /**
+     * Per-class bindings.
      */
-    protected static class ClassPlugins {
-        private final Type declaringType;
+    static class ClassPlugins {
+
+        /**
+         * Maps method names to binding lists.
+         */
+        private final Map<String, Binding> bindings = new HashMap<>();
 
-        private final List<MethodKey> registrations = new ArrayList<>();
+        /**
+         * Gets the invocation plugin for a given method.
+         *
+         * @return the invocation plugin for {@code method} or {@code null}
+         */
+        InvocationPlugin get(ResolvedJavaMethod method) {
+            assert !method.isBridge();
+            Binding binding = bindings.get(method.getName());
+            while (binding != null) {
+                if (method.isStatic() == binding.isStatic) {
+                    if (method.getSignature().toMethodDescriptor().startsWith(binding.argumentsDescriptor)) {
+                        return binding.plugin;
+                    }
+                }
+                binding = binding.next;
+            }
+            return null;
+        }
 
-        public ClassPlugins(Type declaringClass) {
-            this.declaringType = declaringClass;
+        public void register(Binding binding, boolean allowOverwrite) {
+            if (allowOverwrite) {
+                if (lookup(binding) != null) {
+                    register(binding);
+                    return;
+                }
+            } else {
+                assert lookup(binding) == null : "a value is already registered for " + binding;
+            }
+            register(binding);
+        }
+
+        InvocationPlugin lookup(Binding binding) {
+            Binding b = bindings.get(binding.name);
+            while (b != null) {
+                if (b.isStatic == binding.isStatic && b.argumentsDescriptor.equals(binding.argumentsDescriptor)) {
+                    return b.plugin;
+                }
+                b = b.next;
+            }
+            return null;
         }
 
         /**
-         * Entry map that is initialized upon first call to {@link #get(ResolvedJavaMethod)}.
-         *
-         * Note: this must be volatile as threads may race to initialize it.
+         * Registers {@code binding}.
          */
-        private volatile Map<ResolvedJavaMethodKey, InvocationPlugin> entries;
+        void register(Binding binding) {
+            Binding head = bindings.get(binding.name);
+            assert binding.next == null;
+            binding.next = head;
+            bindings.put(binding.name, binding);
+        }
+    }
 
-        void initializeMap() {
-            if (!isClosed()) {
-                if (registrations.isEmpty()) {
-                    entries = Collections.emptyMap();
-                } else {
-                    Class<?> declaringClass = resolveType(declaringType, true);
-                    if (declaringClass == null) {
-                        // An optional type that could not be resolved
-                        entries = Collections.emptyMap();
-                    } else {
-                        Map<ResolvedJavaMethodKey, InvocationPlugin> newEntries = new HashMap<>();
-                        for (MethodKey methodKey : registrations) {
-                            ResolvedJavaMethod m = methodKey.resolve(declaringClass);
-                            if (m != null) {
-                                newEntries.put(new ResolvedJavaMethodKey(m), methodKey.value);
-                                if (entries != null) {
-                                    // Another thread finished initializing entries first
-                                    return;
-                                }
-                            }
-                        }
-                        entries = newEntries;
-                    }
-                }
-            }
-        }
+    static class LateClassPlugins extends ClassPlugins {
+        static final String CLOSED_LATE_CLASS_PLUGIN = "-----";
+        private final String className;
+        private final LateClassPlugins next;
 
-        public InvocationPlugin get(ResolvedJavaMethod method) {
-            if (!isClosed()) {
-                initializeMap();
-            }
-            return entries.get(new ResolvedJavaMethodKey(method));
-        }
-
-        public void register(MethodKey methodKey, boolean allowOverwrite) {
-            assert !isClosed() : "registration is closed: " + methodKey + " " + Arrays.toString(entries.keySet().toArray());
-            if (allowOverwrite) {
-                int index = registrations.indexOf(methodKey);
-                if (index >= 0) {
-                    registrations.set(index, methodKey);
-                    return;
-                }
-            } else {
-                assert !registrations.contains(methodKey) : "a value is already registered for " + declaringType + "." + methodKey;
-            }
-            registrations.add(methodKey);
-        }
-
-        public boolean isClosed() {
-            return entries != null;
+        LateClassPlugins(LateClassPlugins next, String className) {
+            assert next == null || next.className != CLOSED_LATE_CLASS_PLUGIN : "Late registration of invocation plugins is closed";
+            this.next = next;
+            this.className = className;
         }
     }
 
     /**
-     * Adds an entry to this map for a specified method.
+     * Registers a binding of a method to an invocation plugin.
      *
-     * @param value value to be associated with the specified method
+     * @param plugin invocation plugin to be associated with the specified method
      * @param isStatic specifies if the method is static
-     * @param isOptional specifies if the method is optional
      * @param declaringClass the class declaring the method
      * @param name the name of the method
      * @param argumentTypes the argument types of the method. Element 0 of this array must be
      *            {@code declaringClass} iff the method is non-static.
      * @return an object representing the method
      */
-    MethodKey put(InvocationPlugin value, boolean isStatic, boolean isOptional, boolean allowOverwrite, Type declaringClass, String name, Type... argumentTypes) {
+    Binding put(InvocationPlugin plugin, boolean isStatic, boolean allowOverwrite, Type declaringClass, String name, Type... argumentTypes) {
+        assert resolvedRegistrations == null : "registration is closed";
+        String internalName = MetaUtil.toInternalName(declaringClass.getTypeName());
         assert isStatic || argumentTypes[0] == declaringClass;
+        assert deferredRegistrations != null : "initial registration is closed - use " + LateRegistration.class.getName() + " for late registrations";
 
-        String internalName = MetaUtil.toInternalName(declaringClass.getTypeName());
         ClassPlugins classPlugins = registrations.get(internalName);
         if (classPlugins == null) {
-            classPlugins = new ClassPlugins(declaringClass);
+            classPlugins = new ClassPlugins();
             registrations.put(internalName, classPlugins);
         }
-        assert isStatic || argumentTypes[0] == declaringClass;
-        MethodKey methodKey = new MethodKey(metaAccess, value, isStatic, isOptional, name, argumentTypes);
-        classPlugins.register(methodKey, allowOverwrite);
-        return methodKey;
+        Binding binding = new Binding(plugin, isStatic, name, argumentTypes);
+        classPlugins.register(binding, allowOverwrite);
+        return binding;
+    }
+
+    InvocationPlugin get(ResolvedJavaMethod method) {
+        if (resolvedRegistrations != null) {
+            return resolvedRegistrations.get(method);
+        } else {
+            if (!method.isBridge()) {
+                ResolvedJavaType declaringClass = method.getDeclaringClass();
+                flushDeferrables();
+                String internalName = declaringClass.getName();
+                ClassPlugins classPlugins = registrations.get(internalName);
+                InvocationPlugin res = null;
+                if (classPlugins != null) {
+                    res = classPlugins.get(method);
+                }
+                if (res == null) {
+                    LateClassPlugins lcp = findLateClassPlugins(internalName);
+                    if (lcp != null) {
+                        res = lcp.get(method);
+                    }
+                }
+                if (res != null) {
+                    if (canBeIntrinsified(declaringClass)) {
+                        return res;
+                    }
+                }
+            } else {
+                // Supporting plugins for bridge methods would require including
+                // the return type in the registered signature. Until needed,
+                // this extra complexity is best avoided.
+            }
+        }
+        return null;
     }
 
     /**
-     * Determines if a method denoted by a given {@link MethodKey} is in this map.
+     * Determines if methods in a given class can have invocation plugins.
+     *
+     * @param declaringClass the class to test
      */
-    boolean containsKey(Type declaringType, MethodKey key) {
-        String internalName = MetaUtil.toInternalName(declaringType.getTypeName());
-        ClassPlugins classPlugins = registrations.get(internalName);
-        return classPlugins != null && classPlugins.registrations.contains(key);
+    protected boolean canBeIntrinsified(ResolvedJavaType declaringClass) {
+        return true;
     }
 
-    InvocationPlugin get(ResolvedJavaMethod method) {
-        flushDeferrables();
-        String internalName = method.getDeclaringClass().getName();
-        ClassPlugins classPlugins = registrations.get(internalName);
-        if (classPlugins != null) {
-            return classPlugins.get(method);
+    LateClassPlugins findLateClassPlugins(String internalClassName) {
+        for (LateClassPlugins lcp = lateRegistrations; lcp != null; lcp = lcp.next) {
+            if (lcp.className.equals(internalClassName)) {
+                return lcp;
+            }
         }
         return null;
     }
@@ -639,25 +693,39 @@
                     deferredRegistrations = null;
                 }
             }
-            for (Map.Entry<String, ClassPlugins> e : registrations.entrySet()) {
-                e.getValue().initializeMap();
-            }
         }
     }
 
+    synchronized void registerLate(Type declaringType, List<Binding> bindings) {
+        String internalName = MetaUtil.toInternalName(declaringType.getTypeName());
+        assert findLateClassPlugins(internalName) == null : "Cannot have more than one late registration of invocation plugins for " + internalName;
+        LateClassPlugins lateClassPlugins = new LateClassPlugins(lateRegistrations, internalName);
+        for (Binding b : bindings) {
+            lateClassPlugins.register(b);
+        }
+        lateRegistrations = lateClassPlugins;
+    }
+
+    private synchronized boolean closeLateRegistrations() {
+        if (lateRegistrations == null || lateRegistrations.className != CLOSED_LATE_CLASS_PLUGIN) {
+            lateRegistrations = new LateClassPlugins(lateRegistrations, CLOSED_LATE_CLASS_PLUGIN);
+        }
+        return true;
+    }
+
     /**
-     * Disallows new registrations of new plugins, and creates the internal tables for method
-     * lookup.
+     * Processes deferred registrations and then closes this object for future registration.
      */
     public void closeRegistration() {
+        assert closeLateRegistrations();
         flushDeferrables();
-        for (Map.Entry<String, ClassPlugins> e : registrations.entrySet()) {
-            e.getValue().initializeMap();
-        }
     }
 
-    public int size() {
-        return registrations.size();
+    public boolean isEmpty() {
+        if (resolvedRegistrations != null) {
+            return resolvedRegistrations.isEmpty();
+        }
+        return registrations.size() == 0 && lateRegistrations == null;
     }
 
     /**
@@ -666,47 +734,39 @@
      */
     protected final InvocationPlugins parent;
 
-    private InvocationPlugins(InvocationPlugins parent, MetaAccessProvider metaAccess) {
-        this.metaAccess = metaAccess;
-        InvocationPlugins p = parent;
-        this.parent = p;
+    /**
+     * Creates a set of invocation plugins with no parent.
+     */
+    public InvocationPlugins() {
+        this(null);
     }
 
     /**
-     * Creates a set of invocation plugins with a non-null {@linkplain #getParent() parent}.
+     * Creates a set of invocation plugins.
+     *
+     * @param parent if non-null, this object will be searched first when looking up plugins
      */
     public InvocationPlugins(InvocationPlugins parent) {
-        this(parent, parent.getMetaAccess());
+        InvocationPlugins p = parent;
+        this.parent = p;
+        this.registrations = new HashMap<>();
+        this.resolvedRegistrations = null;
     }
 
-    public InvocationPlugins(Map<ResolvedJavaMethod, InvocationPlugin> plugins, InvocationPlugins parent, MetaAccessProvider metaAccess) {
-        this.metaAccess = metaAccess;
+    /**
+     * Creates a closed set of invocation plugins for a set of resolved methods. Such an object
+     * cannot have further plugins registered.
+     */
+    public InvocationPlugins(Map<ResolvedJavaMethod, InvocationPlugin> plugins, InvocationPlugins parent) {
         this.parent = parent;
-
+        this.registrations = null;
         this.deferredRegistrations = null;
+        Map<ResolvedJavaMethod, InvocationPlugin> map = new HashMap<>(plugins.size());
 
         for (Map.Entry<ResolvedJavaMethod, InvocationPlugin> entry : plugins.entrySet()) {
-            ResolvedJavaMethod method = entry.getKey();
-            InvocationPlugin plugin = entry.getValue();
-
-            String internalName = method.getDeclaringClass().getName();
-            ClassPlugins classPlugins = registrations.get(internalName);
-            if (classPlugins == null) {
-                classPlugins = new ClassPlugins(null);
-                registrations.put(internalName, classPlugins);
-                classPlugins.entries = new HashMap<>();
-            }
-
-            classPlugins.entries.put(new ResolvedJavaMethodKey(method), plugin);
+            map.put(entry.getKey(), entry.getValue());
         }
-    }
-
-    public MetaAccessProvider getMetaAccess() {
-        return metaAccess;
-    }
-
-    public InvocationPlugins(MetaAccessProvider metaAccess) {
-        this(null, metaAccess);
+        this.resolvedRegistrations = map;
     }
 
     protected void register(InvocationPlugin plugin, boolean isOptional, boolean allowOverwrite, Type declaringClass, String name, Type... argumentTypes) {
@@ -714,8 +774,9 @@
         if (!isStatic) {
             argumentTypes[0] = declaringClass;
         }
-        MethodKey methodKey = put(plugin, isStatic, isOptional, allowOverwrite, declaringClass, name, argumentTypes);
-        assert Checker.check(this, declaringClass, methodKey, plugin);
+        Binding binding = put(plugin, isStatic, allowOverwrite, declaringClass, name, argumentTypes);
+        assert Checks.check(this, declaringClass, binding);
+        assert Checks.checkResolvable(isOptional, declaringClass, binding);
     }
 
     /**
@@ -765,23 +826,56 @@
     }
 
     /**
-     * Gets the set of methods for which invocation plugins have been registered. Once this method
-     * is called, no further registrations can be made.
+     * Gets the set of registered invocation plugins.
+     *
+     * @return a map from class names in {@linkplain MetaUtil#toInternalName(String) internal} form
+     *         to the invocation plugin bindings for methods in the class
      */
-    public Set<ResolvedJavaMethod> getMethods() {
-        Set<ResolvedJavaMethod> res = new HashSet<>();
-        if (parent != null) {
-            res.addAll(parent.getMethods());
+    public Map<String, List<Binding>> getBindings(boolean includeParents) {
+        Map<String, List<Binding>> res = new HashMap<>();
+        if (parent != null && includeParents) {
+            res.putAll(parent.getBindings(true));
         }
-        flushDeferrables();
-        for (ClassPlugins cp : registrations.values()) {
-            for (ResolvedJavaMethodKey key : cp.entries.keySet()) {
-                res.add(key.method);
+        if (resolvedRegistrations != null) {
+            for (Map.Entry<ResolvedJavaMethod, InvocationPlugin> e : resolvedRegistrations.entrySet()) {
+                ResolvedJavaMethod method = e.getKey();
+                InvocationPlugin plugin = e.getValue();
+                String type = method.getDeclaringClass().getName();
+                List<Binding> bindings = res.get(type);
+                if (bindings == null) {
+                    bindings = new ArrayList<>();
+                    res.put(type, bindings);
+                }
+                bindings.add(new Binding(method, plugin));
+            }
+        } else {
+            flushDeferrables();
+            for (Map.Entry<String, ClassPlugins> e : registrations.entrySet()) {
+                String type = e.getKey();
+                ClassPlugins cp = e.getValue();
+                collectBindingsTo(res, type, cp);
+            }
+            for (LateClassPlugins lcp = lateRegistrations; lcp != null; lcp = lcp.next) {
+                String type = lcp.className;
+                collectBindingsTo(res, type, lcp);
             }
         }
         return res;
     }
 
+    private static void collectBindingsTo(Map<String, List<Binding>> res, String type, ClassPlugins cp) {
+        for (Map.Entry<String, Binding> e : cp.bindings.entrySet()) {
+            List<Binding> bindings = res.get(type);
+            if (bindings == null) {
+                bindings = new ArrayList<>();
+                res.put(type, bindings);
+            }
+            for (Binding b = e.getValue(); b != null; b = b.next) {
+                bindings.add(b);
+            }
+        }
+    }
+
     /**
      * Gets the invocation plugins {@linkplain #lookupInvocation(ResolvedJavaMethod) searched}
      * before searching in this object.
@@ -792,17 +886,36 @@
 
     @Override
     public String toString() {
+        List<String> all = new ArrayList<>();
+        for (Map.Entry<String, List<Binding>> e : getBindings(false).entrySet()) {
+            String c = MetaUtil.internalNameToJava(e.getKey(), true, false);
+            for (Binding b : e.getValue()) {
+                all.add(c + '.' + b);
+            }
+        }
+        Collections.sort(all);
         StringBuilder buf = new StringBuilder();
-        registrations.forEach((name, cp) -> buf.append(name).append('.').append(cp).append(", "));
-        String s = buf.toString();
-        if (buf.length() != 0) {
-            s = s.substring(buf.length() - ", ".length());
+        String nl = String.format("%n");
+        for (String s : all) {
+            if (buf.length() != 0) {
+                buf.append(nl);
+            }
+            buf.append(s);
         }
-        return s + " / parent: " + this.parent;
+        if (parent != null) {
+            if (buf.length() != 0) {
+                buf.append(nl);
+            }
+            buf.append("// parent").append(nl).append(parent);
+        }
+        return buf.toString();
     }
 
-    private static class Checker {
-        private static final int MAX_ARITY = 5;
+    /**
+     * Code only used in assertions. Putting this in a separate class reduces class load time.
+     */
+    private static class Checks {
+        private static final int MAX_ARITY = 7;
         /**
          * The set of all {@link InvocationPlugin#apply} method signatures.
          */
@@ -828,10 +941,17 @@
             SIGS = sigs.toArray(new Class<?>[sigs.size()][]);
         }
 
-        public static boolean check(InvocationPlugins plugins, Type declaringType, MethodKey method, InvocationPlugin plugin) {
+        static boolean containsBinding(InvocationPlugins p, Type declaringType, Binding key) {
+            String internalName = MetaUtil.toInternalName(declaringType.getTypeName());
+            ClassPlugins classPlugins = p.registrations.get(internalName);
+            return classPlugins != null && classPlugins.lookup(key) != null;
+        }
+
+        public static boolean check(InvocationPlugins plugins, Type declaringType, Binding binding) {
+            InvocationPlugin plugin = binding.plugin;
             InvocationPlugins p = plugins.parent;
             while (p != null) {
-                assert !p.containsKey(declaringType, method) : "a plugin is already registered for " + method;
+                assert !containsBinding(p, declaringType, binding) : "a plugin is already registered for " + binding;
                 p = p.parent;
             }
             if (plugin instanceof ForeignCallPlugin || plugin instanceof GeneratedInvocationPlugin) {
@@ -843,8 +963,8 @@
                 assert substitute.getAnnotation(MethodSubstitution.class) != null : format("Substitute method must be annotated with @%s: %s", MethodSubstitution.class.getSimpleName(), substitute);
                 return true;
             }
-            int arguments = method.getDeclaredParameterCount();
-            assert arguments < SIGS.length : format("need to extend %s to support method with %d arguments: %s", InvocationPlugin.class.getSimpleName(), arguments, method);
+            int arguments = parseParameters(binding.argumentsDescriptor).size();
+            assert arguments < SIGS.length : format("need to extend %s to support method with %d arguments: %s", InvocationPlugin.class.getSimpleName(), arguments, binding);
             for (Method m : plugin.getClass().getDeclaredMethods()) {
                 if (m.getName().equals("apply")) {
                     Class<?>[] parameterTypes = m.getParameterTypes();
@@ -853,7 +973,24 @@
                     }
                 }
             }
-            throw new AssertionError(format("graph builder plugin for %s not found", method));
+            throw new AssertionError(format("graph builder plugin for %s not found", binding));
+        }
+
+        static boolean checkResolvable(boolean isOptional, Type declaringType, Binding binding) {
+            Class<?> declaringClass = InvocationPlugins.resolveType(declaringType, isOptional);
+            if (declaringClass == null) {
+                return true;
+            }
+            if (binding.name.equals("<init>")) {
+                if (resolveConstructor(declaringClass, binding) == null && !isOptional) {
+                    throw new AssertionError(String.format("Constructor not found: %s%s", declaringClass.getName(), binding.argumentsDescriptor));
+                }
+            } else {
+                if (resolveMethod(declaringClass, binding) == null && !isOptional) {
+                    throw new AssertionError(String.format("Method not found: %s.%s%s", declaringClass.getName(), binding.name, binding.argumentsDescriptor));
+                }
+            }
+            return true;
         }
     }
 
@@ -904,31 +1041,119 @@
         if (type instanceof Class) {
             return (Class<?>) type;
         }
-        if (optional && type instanceof OptionalLazySymbol) {
+        if (type instanceof OptionalLazySymbol) {
             return ((OptionalLazySymbol) type).resolve();
         }
         return resolveClass(type.getTypeName(), optional);
     }
 
-    private static final Class<?>[] NO_CLASSES = {};
+    private static List<String> toInternalTypeNames(Class<?>[] types) {
+        String[] res = new String[types.length];
+        for (int i = 0; i < types.length; i++) {
+            res[i] = MetaUtil.toInternalName(types[i].getTypeName());
+        }
+        return Arrays.asList(res);
+    }
+
+    /**
+     * Resolves a given binding to a method in a given class. If more than one method with the
+     * parameter types matching {@code binding} is found and the return types of all the matching
+     * methods form an inheritance chain, the one with the most specific type is returned; otherwise
+     * {@link NoSuchMethodError} is thrown.
+     *
+     * @param declaringClass the class to search for a method matching {@code binding}
+     * @return the method (if any) in {@code declaringClass} matching binding
+     */
+    public static Method resolveMethod(Class<?> declaringClass, Binding binding) {
+        if (binding.name.equals("<init>")) {
+            return null;
+        }
+        Method[] methods = declaringClass.getDeclaredMethods();
+        List<String> parameterTypeNames = parseParameters(binding.argumentsDescriptor);
+        for (int i = 0; i < methods.length; ++i) {
+            Method m = methods[i];
+            if (binding.isStatic == Modifier.isStatic(m.getModifiers()) && m.getName().equals(binding.name)) {
+                if (parameterTypeNames.equals(toInternalTypeNames(m.getParameterTypes()))) {
+                    for (int j = i + 1; j < methods.length; ++j) {
+                        Method other = methods[j];
+                        if (binding.isStatic == Modifier.isStatic(other.getModifiers()) && other.getName().equals(binding.name)) {
+                            if (parameterTypeNames.equals(toInternalTypeNames(other.getParameterTypes()))) {
+                                if (m.getReturnType().isAssignableFrom(other.getReturnType())) {
+                                    // `other` has a more specific return type - choose it
+                                    // (m is most likely a bridge method)
+                                    m = other;
+                                } else {
+                                    if (!other.getReturnType().isAssignableFrom(m.getReturnType())) {
+                                        throw new NoSuchMethodError(String.format(
+                                                        "Found 2 methods with same name and parameter types but unrelated return types:%n %s%n %s", m, other));
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    return m;
+                }
+            }
+        }
+        return null;
+    }
 
     /**
-     * Resolves an array of {@link Type}s to an array of {@link Class}es.
+     * Resolves a given binding to a constructor in a given class.
      *
-     * @param types the types to resolve
-     * @param from the initial index of the range to be resolved, inclusive
-     * @param to the final index of the range to be resolved, exclusive
-     * @return the resolved class or null if resolution fails and {@code optional} is true
+     * @param declaringClass the class to search for a constructor matching {@code binding}
+     * @return the constructor (if any) in {@code declaringClass} matching binding
      */
-    public static Class<?>[] resolveTypes(Type[] types, int from, int to) {
-        int length = to - from;
-        if (length <= 0) {
-            return NO_CLASSES;
+    public static Constructor<?> resolveConstructor(Class<?> declaringClass, Binding binding) {
+        if (!binding.name.equals("<init>")) {
+            return null;
+        }
+        Constructor<?>[] constructors = declaringClass.getDeclaredConstructors();
+        List<String> parameterTypeNames = parseParameters(binding.argumentsDescriptor);
+        for (int i = 0; i < constructors.length; ++i) {
+            Constructor<?> c = constructors[i];
+            if (parameterTypeNames.equals(toInternalTypeNames(c.getParameterTypes()))) {
+                return c;
+            }
         }
-        Class<?>[] classes = new Class<?>[length];
-        for (int i = 0; i < length; i++) {
-            classes[i] = resolveType(types[i + from], false);
+        return null;
+    }
+
+    private static List<String> parseParameters(String argumentsDescriptor) {
+        assert argumentsDescriptor.startsWith("(") && argumentsDescriptor.endsWith(")") : argumentsDescriptor;
+        List<String> res = new ArrayList<>();
+        int cur = 1;
+        int end = argumentsDescriptor.length() - 1;
+        while (cur != end) {
+            char first;
+            int start = cur;
+            do {
+                first = argumentsDescriptor.charAt(cur++);
+            } while (first == '[');
+
+            switch (first) {
+                case 'L':
+                    int endObject = argumentsDescriptor.indexOf(';', cur);
+                    if (endObject == -1) {
+                        throw new GraalError("Invalid object type at index %d in signature: %s", cur, argumentsDescriptor);
+                    }
+                    cur = endObject + 1;
+                    break;
+                case 'V':
+                case 'I':
+                case 'B':
+                case 'C':
+                case 'D':
+                case 'F':
+                case 'J':
+                case 'S':
+                case 'Z':
+                    break;
+                default:
+                    throw new GraalError("Invalid character at index %d in signature: %s", cur, argumentsDescriptor);
+            }
+            res.add(argumentsDescriptor.substring(start, cur));
         }
-        return classes;
+        return res;
     }
 }
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java	Wed Jul 05 23:21:47 2017 +0200
@@ -69,8 +69,7 @@
     void close();
 
     /**
-     * A JVMCI package {@linkplain Services#exportJVMCITo(Class) dynamically exported} to trusted
-     * modules.
+     * A JVMCI package dynamically exported to trusted modules.
      */
     String JVMCI_RUNTIME_PACKAGE = JVMCI.class.getPackage().getName();
 
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -30,10 +30,10 @@
 import org.junit.Assert;
 import org.junit.Test;
 
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
 /**
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java	Wed Jul 05 23:21:47 2017 +0200
@@ -22,9 +22,17 @@
  */
 package org.graalvm.compiler.serviceprovider;
 
+import static org.graalvm.compiler.serviceprovider.JDK9Method.Java8OrEarlier;
+import static org.graalvm.compiler.serviceprovider.JDK9Method.addOpens;
+import static org.graalvm.compiler.serviceprovider.JDK9Method.getModule;
+import static org.graalvm.compiler.serviceprovider.JDK9Method.getPackages;
+import static org.graalvm.compiler.serviceprovider.JDK9Method.isOpenTo;
+
+import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.ServiceConfigurationError;
 import java.util.ServiceLoader;
+import java.util.Set;
 
 import jdk.vm.ci.services.JVMCIPermission;
 import jdk.vm.ci.services.Services;
@@ -32,14 +40,32 @@
 /**
  * A mechanism for accessing service providers that abstracts over whether Graal is running on
  * JVMCI-8 or JVMCI-9. In JVMCI-8, a JVMCI specific mechanism is used to lookup services via the
- * hidden JVMCI class loader. in JVMCI-9, the standard {@link ServiceLoader} mechanism is used.
+ * hidden JVMCI class loader. In JVMCI-9, the standard {@link ServiceLoader} mechanism is used.
  */
 public final class GraalServices {
 
     private GraalServices() {
     }
 
-    public static final boolean Java8OrEarlier = System.getProperty("java.specification.version").compareTo("1.9") < 0;
+    /**
+     * Opens all JVMCI packages to the module of a given class. This relies on JVMCI already having
+     * opened all its packages to the module defining {@link GraalServices}.
+     *
+     * @param other all JVMCI packages will be opened to the module defining this class
+     */
+    public static void openJVMCITo(Class<?> other) {
+        Object jvmci = getModule.invoke(Services.class);
+        Object otherModule = getModule.invoke(other);
+        if (jvmci != otherModule) {
+            Set<String> packages = getPackages.invoke(jvmci);
+            for (String pkg : packages) {
+                boolean opened = isOpenTo.invoke(jvmci, pkg, otherModule);
+                if (!opened) {
+                    addOpens.invoke(jvmci, pkg, otherModule);
+                }
+            }
+        }
+    }
 
     /**
      * Gets an {@link Iterable} of the providers available for a given service.
@@ -50,9 +76,9 @@
     public static <S> Iterable<S> load(Class<S> service) {
         assert !service.getName().startsWith("jdk.vm.ci") : "JVMCI services must be loaded via " + Services.class.getName();
         if (Java8OrEarlier) {
-            return Services.load(service);
+            return load8(service);
         }
-        ServiceLoader<S> iterable = ServiceLoader.load(service);
+        Iterable<S> iterable = ServiceLoader.load(service);
         return new Iterable<S>() {
             @Override
             public Iterator<S> iterator() {
@@ -66,8 +92,8 @@
                     @Override
                     public S next() {
                         S provider = iterator.next();
-                        // Allow Graal extensions to access JVMCI assuming they have JVMCIPermission
-                        Services.exportJVMCITo(provider.getClass());
+                        // Allow Graal extensions to access JVMCI
+                        openJVMCITo(provider.getClass());
                         return provider;
                     }
 
@@ -81,6 +107,23 @@
     }
 
     /**
+     * {@code Services.load(Class)} is only defined in JVMCI-8.
+     */
+    private static volatile Method loadMethod;
+
+    @SuppressWarnings("unchecked")
+    private static <S> Iterable<S> load8(Class<S> service) throws InternalError {
+        try {
+            if (loadMethod == null) {
+                loadMethod = Services.class.getMethod("load", Class.class);
+            }
+            return (Iterable<S>) loadMethod.invoke(null, service);
+        } catch (Exception e) {
+            throw new InternalError(e);
+        }
+    }
+
+    /**
      * Gets the provider for a given service for which at most one provider must be available.
      *
      * @param service the service whose provider is being requested
@@ -92,16 +135,14 @@
      */
     public static <S> S loadSingle(Class<S> service, boolean required) {
         assert !service.getName().startsWith("jdk.vm.ci") : "JVMCI services must be loaded via " + Services.class.getName();
-        if (Java8OrEarlier) {
-            return Services.loadSingle(service, required);
-        }
-        Iterable<S> providers = ServiceLoader.load(service);
+        Iterable<S> providers = load(service);
         S singleProvider = null;
         try {
             for (Iterator<S> it = providers.iterator(); it.hasNext();) {
                 singleProvider = it.next();
                 if (it.hasNext()) {
-                    throw new InternalError(String.format("Multiple %s providers found", service.getName()));
+                    S other = it.next();
+                    throw new InternalError(String.format("Multiple %s providers found: %s, %s", service.getName(), singleProvider.getClass().getName(), other.getClass().getName()));
                 }
             }
         } catch (ServiceConfigurationError e) {
@@ -111,9 +152,6 @@
             if (required) {
                 throw new InternalError(String.format("No provider for %s found", service.getName()));
             }
-        } else {
-            // Allow Graal extensions to access JVMCI assuming they have JVMCIPermission
-            Services.exportJVMCITo(singleProvider.getClass());
         }
         return singleProvider;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/JDK9Method.java	Wed Jul 05 23:21:47 2017 +0200
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.graalvm.compiler.serviceprovider;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+/**
+ * Reflection based access to API introduced by JDK 9. This allows the API to be used in code that
+ * must be compiled on a JDK prior to 9.
+ */
+public final class JDK9Method {
+
+    private static int getJavaSpecificationVersion() {
+        String value = System.getProperty("java.specification.version");
+        if (value.startsWith("1.")) {
+            value = value.substring(2);
+        }
+        return Integer.parseInt(value);
+    }
+
+    /**
+     * The integer value corresponding to the value of the {@code java.specification.version} system
+     * property after any leading {@code "1."} has been stripped.
+     */
+    public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
+
+    public JDK9Method(Class<?> declaringClass, String name, Class<?>... parameterTypes) {
+        try {
+            this.method = declaringClass.getMethod(name, parameterTypes);
+        } catch (Exception e) {
+            throw new InternalError(e);
+        }
+    }
+
+    /**
+     * Determines if the Java runtime is version 8 or earlier.
+     */
+    public static final boolean Java8OrEarlier = JAVA_SPECIFICATION_VERSION <= 8;
+
+    public final Method method;
+
+    public Class<?> getReturnType() {
+        return method.getReturnType();
+    }
+
+    /**
+     * {@code Class.getModule()}.
+     */
+    public static final JDK9Method getModule;
+
+    /**
+     * {@code java.lang.Module.getPackages()}.
+     */
+    public static final JDK9Method getPackages;
+
+    /**
+     * {@code java.lang.Module.getResourceAsStream(String)}.
+     */
+    public static final JDK9Method getResourceAsStream;
+
+    /**
+     * {@code java.lang.Module.addOpens(String, Module)}.
+     */
+    public static final JDK9Method addOpens;
+
+    /**
+     * {@code java.lang.Module.isOpen(String, Module)}.
+     */
+    public static final JDK9Method isOpenTo;
+
+    /**
+     * Invokes the static Module API method represented by this object.
+     */
+    @SuppressWarnings("unchecked")
+    public <T> T invokeStatic(Object... args) {
+        checkAvailability();
+        assert Modifier.isStatic(method.getModifiers());
+        try {
+            return (T) method.invoke(null, args);
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            throw new InternalError(e);
+        }
+    }
+
+    /**
+     * Invokes the non-static Module API method represented by this object.
+     */
+    @SuppressWarnings("unchecked")
+    public <T> T invoke(Object receiver, Object... args) {
+        checkAvailability();
+        assert !Modifier.isStatic(method.getModifiers());
+        try {
+            return (T) method.invoke(receiver, args);
+        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+            throw new InternalError(e);
+        }
+    }
+
+    private void checkAvailability() throws InternalError {
+        if (method == null) {
+            throw new InternalError("Cannot use Module API on JDK " + JAVA_SPECIFICATION_VERSION);
+        }
+    }
+
+    static {
+        if (JAVA_SPECIFICATION_VERSION >= 9) {
+            getModule = new JDK9Method(Class.class, "getModule");
+            Class<?> moduleClass = getModule.getReturnType();
+            getPackages = new JDK9Method(moduleClass, "getPackages");
+            addOpens = new JDK9Method(moduleClass, "addOpens", String.class, moduleClass);
+            getResourceAsStream = new JDK9Method(moduleClass, "getResourceAsStream", String.class);
+            isOpenTo = new JDK9Method(moduleClass, "isOpen", String.class, moduleClass);
+        } else {
+            JDK9Method unavailable = new JDK9Method();
+            getModule = unavailable;
+            getPackages = unavailable;
+            addOpens = unavailable;
+            getResourceAsStream = unavailable;
+            isOpenTo = unavailable;
+        }
+    }
+
+    private JDK9Method() {
+        method = null;
+    }
+}
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java	Wed Jul 05 23:21:47 2017 +0200
@@ -96,6 +96,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     public Set<String> getPackages() {
         try {
             return (Set<String>) getPackagesMethod.invoke(realModule);
--- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -58,6 +58,7 @@
   virtual bool is_exception_throw_stub() const   { return false; }
   virtual bool is_range_check_stub() const       { return false; }
   virtual bool is_divbyzero_stub() const         { return false; }
+  virtual bool is_simple_exception_stub() const  { return false; }
 #ifndef PRODUCT
   virtual void print_name(outputStream* out) const = 0;
 #endif
@@ -483,6 +484,7 @@
   virtual void emit_code(LIR_Assembler* e);
   virtual CodeEmitInfo* info() const             { return _info; }
   virtual bool is_exception_throw_stub() const   { return true; }
+  virtual bool is_simple_exception_stub() const  { return true; }
   virtual void visit(LIR_OpVisitState* visitor) {
     if (_obj->is_valid()) visitor->do_input(_obj);
     visitor->do_slow_case(_info);
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1829,6 +1829,20 @@
                 log->identify(target),
                 Bytecodes::name(code));
 
+  // invoke-special-super
+  if (bc_raw == Bytecodes::_invokespecial && !target->is_object_initializer()) {
+    ciInstanceKlass* sender_klass =
+          calling_klass->is_anonymous() ? calling_klass->host_klass() :
+                                          calling_klass;
+    if (sender_klass->is_interface()) {
+      int index = state()->stack_size() - (target->arg_size_no_receiver() + 1);
+      Value receiver = state()->stack_at(index);
+      CheckCast* c = new CheckCast(sender_klass, receiver, copy_state_before());
+      c->set_invokespecial_receiver_check();
+      state()->stack_at_put(index, append_split(c));
+    }
+  }
+
   // Some methods are obviously bindable without any type checks so
   // convert them directly to an invokespecial or invokestatic.
   if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) {
--- a/hotspot/src/share/vm/c1/c1_Instruction.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -372,6 +372,7 @@
     UnorderedIsTrueFlag,
     NeedsPatchingFlag,
     ThrowIncompatibleClassChangeErrorFlag,
+    InvokeSpecialReceiverCheckFlag,
     ProfileMDOFlag,
     IsLinkedInBlockFlag,
     NeedsRangeCheckFlag,
@@ -1454,6 +1455,16 @@
   bool is_incompatible_class_change_check() const {
     return check_flag(ThrowIncompatibleClassChangeErrorFlag);
   }
+  void set_invokespecial_receiver_check() {
+    set_flag(InvokeSpecialReceiverCheckFlag, true);
+  }
+  bool is_invokespecial_receiver_check() const {
+    return check_flag(InvokeSpecialReceiverCheckFlag);
+  }
+
+  virtual bool needs_exception_state() const {
+    return !is_invokespecial_receiver_check();
+  }
 
   ciType* declared_type() const;
 };
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -595,6 +595,16 @@
   return impl;
 }
 
+ciInstanceKlass* ciInstanceKlass::host_klass() {
+  assert(is_loaded(), "must be loaded");
+  if (is_anonymous()) {
+    VM_ENTRY_MARK
+    Klass* host_klass = get_instanceKlass()->host_klass();
+    return CURRENT_ENV->get_instance_klass(host_klass);
+  }
+  return NULL;
+}
+
 // Utility class for printing of the contents of the static fields for
 // use by compilation replay.  It only prints out the information that
 // could be consumed by the compiler, so for primitive types it prints
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -260,6 +260,8 @@
     return NULL;
   }
 
+  ciInstanceKlass* host_klass();
+
   bool can_be_instantiated() {
     assert(is_loaded(), "must be loaded");
     return !is_interface() && !is_abstract();
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -952,6 +952,13 @@
 }
 
 // ------------------------------------------------------------------
+// ciMethod::is_object_initializer
+//
+bool ciMethod::is_object_initializer() const {
+   return name() == ciSymbol::object_initializer_name();
+}
+
+// ------------------------------------------------------------------
 // ciMethod::has_member_arg
 //
 // Return true if the method is a linker intrinsic like _linkToVirtual.
--- a/hotspot/src/share/vm/ci/ciMethod.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/ci/ciMethod.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -337,6 +337,7 @@
   bool has_reserved_stack_access() const         { return _has_reserved_stack_access; }
   bool is_boxing_method() const;
   bool is_unboxing_method() const;
+  bool is_object_initializer() const;
 
   // Replay data methods
   void dump_name_as_ascii(outputStream* st);
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -720,7 +720,8 @@
   Thread* THREAD = thread;
   // extract receiver from the outgoing argument list if necessary
   Handle receiver(thread, NULL);
-  if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface) {
+  if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface ||
+      bytecode == Bytecodes::_invokespecial) {
     ResourceMark rm(thread);
     methodHandle m (thread, method(thread));
     Bytecode_invoke call(m, bci(thread));
@@ -783,16 +784,25 @@
       int index = info.resolved_method()->itable_index();
       assert(info.itable_index() == index, "");
     }
+  } else if (bytecode == Bytecodes::_invokespecial) {
+    assert(info.call_kind() == CallInfo::direct_call, "must be direct call");
   } else {
     assert(info.call_kind() == CallInfo::direct_call ||
            info.call_kind() == CallInfo::vtable_call, "");
   }
 #endif
+  // Get sender or sender's host_klass, and only set cpCache entry to resolved if
+  // it is not an interface.  The receiver for invokespecial calls within interface
+  // methods must be checked for every call.
+  InstanceKlass* sender = pool->pool_holder();
+  sender = sender->is_anonymous() ? sender->host_klass() : sender;
+
   switch (info.call_kind()) {
   case CallInfo::direct_call:
     cp_cache_entry->set_direct_call(
       bytecode,
-      info.resolved_method());
+      info.resolved_method(),
+      sender->is_interface());
     break;
   case CallInfo::vtable_call:
     cp_cache_entry->set_vtable_call(
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1057,12 +1057,14 @@
 
 
 void LinkResolver::resolve_special_call(CallInfo& result,
+                                        Handle recv,
                                         const LinkInfo& link_info,
                                         TRAPS) {
   methodHandle resolved_method = linktime_resolve_special_method(link_info, CHECK);
   runtime_resolve_special_method(result, resolved_method,
                                  link_info.resolved_klass(),
                                  link_info.current_klass(),
+                                 recv,
                                  link_info.check_access(), CHECK);
 }
 
@@ -1149,6 +1151,7 @@
                                                   const methodHandle& resolved_method,
                                                   KlassHandle resolved_klass,
                                                   KlassHandle current_klass,
+                                                  Handle recv,
                                                   bool check_access, TRAPS) {
 
   // resolved method is selected method unless we have an old-style lookup
@@ -1157,21 +1160,19 @@
   // no checks for shadowing
   methodHandle sel_method(THREAD, resolved_method());
 
-  // check if this is an old-style super call and do a new lookup if so
-  { KlassHandle method_klass  = KlassHandle(THREAD,
-                                            resolved_method->method_holder());
+  if (check_access &&
+      // check if the method is not <init>
+      resolved_method->name() != vmSymbols::object_initializer_name()) {
 
-    if (check_access &&
+  // check if this is an old-style super call and do a new lookup if so
         // a) check if ACC_SUPER flag is set for the current class
-        (current_klass->is_super() || !AllowNonVirtualCalls) &&
+    if ((current_klass->is_super() || !AllowNonVirtualCalls) &&
         // b) check if the class of the resolved_klass is a superclass
         // (not supertype in order to exclude interface classes) of the current class.
         // This check is not performed for super.invoke for interface methods
         // in super interfaces.
         current_klass->is_subclass_of(resolved_klass()) &&
-        current_klass() != resolved_klass() &&
-        // c) check if the method is not <init>
-        resolved_method->name() != vmSymbols::object_initializer_name()) {
+        current_klass() != resolved_klass()) {
       // Lookup super method
       KlassHandle super_klass(THREAD, current_klass->super());
       sel_method = lookup_instance_method_in_klasses(super_klass,
@@ -1186,6 +1187,27 @@
                                             resolved_method->signature()));
       }
     }
+
+    // Check that the class of objectref (the receiver) is the current class or interface,
+    // or a subtype of the current class or interface (the sender), otherwise invokespecial
+    // throws IllegalAccessError.
+    // The verifier checks that the sender is a subtype of the class in the I/MR operand.
+    // The verifier also checks that the receiver is a subtype of the sender, if the sender is
+    // a class.  If the sender is an interface, the check has to be performed at runtime.
+    InstanceKlass* sender = InstanceKlass::cast(current_klass());
+    sender = sender->is_anonymous() ? sender->host_klass() : sender;
+    if (sender->is_interface() && recv.not_null()) {
+      Klass* receiver_klass = recv->klass();
+      if (!receiver_klass->is_subtype_of(sender)) {
+        ResourceMark rm(THREAD);
+        char buf[500];
+        jio_snprintf(buf, sizeof(buf),
+                     "Receiver class %s must be the current class or a subtype of interface %s",
+                     receiver_klass->name()->as_C_string(),
+                     sender->name()->as_C_string());
+        THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), buf);
+      }
+    }
   }
 
   // check if not static
@@ -1518,7 +1540,7 @@
 methodHandle LinkResolver::resolve_special_call_or_null(const LinkInfo& link_info) {
   EXCEPTION_MARK;
   CallInfo info;
-  resolve_special_call(info, link_info, THREAD);
+  resolve_special_call(info, Handle(), link_info, THREAD);
   if (HAS_PENDING_EXCEPTION) {
     CLEAR_PENDING_EXCEPTION;
     return methodHandle();
@@ -1534,7 +1556,7 @@
 void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS) {
   switch (byte) {
     case Bytecodes::_invokestatic   : resolve_invokestatic   (result,       pool, index, CHECK); break;
-    case Bytecodes::_invokespecial  : resolve_invokespecial  (result,       pool, index, CHECK); break;
+    case Bytecodes::_invokespecial  : resolve_invokespecial  (result, recv, pool, index, CHECK); break;
     case Bytecodes::_invokevirtual  : resolve_invokevirtual  (result, recv, pool, index, CHECK); break;
     case Bytecodes::_invokehandle   : resolve_invokehandle   (result,       pool, index, CHECK); break;
     case Bytecodes::_invokedynamic  : resolve_invokedynamic  (result,       pool, index, CHECK); break;
@@ -1563,7 +1585,7 @@
       resolve_static_call(result, link_info, /*initialize_class=*/false, CHECK);
       break;
     case Bytecodes::_invokespecial:
-      resolve_special_call(result, link_info, CHECK);
+      resolve_special_call(result, recv, link_info, CHECK);
       break;
     default:
       fatal("bad call: %s", Bytecodes::name(byte));
@@ -1576,9 +1598,10 @@
 }
 
 
-void LinkResolver::resolve_invokespecial(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) {
+void LinkResolver::resolve_invokespecial(CallInfo& result, Handle recv,
+                                         const constantPoolHandle& pool, int index, TRAPS) {
   LinkInfo link_info(pool, index, CHECK);
-  resolve_special_call(result, link_info, CHECK);
+  resolve_special_call(result, recv, link_info, CHECK);
 }
 
 
--- a/hotspot/src/share/vm/interpreter/linkResolver.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -230,6 +230,7 @@
                                                  const methodHandle& resolved_method,
                                                  KlassHandle resolved_klass,
                                                  KlassHandle current_klass,
+                                                 Handle recv,
                                                  bool check_access, TRAPS);
   static void runtime_resolve_virtual_method    (CallInfo& result,
                                                  const methodHandle& resolved_method,
@@ -256,7 +257,7 @@
   // runtime resolving from constant pool
   static void resolve_invokestatic   (CallInfo& result,
                                       const constantPoolHandle& pool, int index, TRAPS);
-  static void resolve_invokespecial  (CallInfo& result,
+  static void resolve_invokespecial  (CallInfo& result, Handle recv,
                                       const constantPoolHandle& pool, int index, TRAPS);
   static void resolve_invokevirtual  (CallInfo& result, Handle recv,
                                       const constantPoolHandle& pool, int index, TRAPS);
@@ -289,6 +290,7 @@
                                      const LinkInfo& link_info,
                                      bool initialize_klass, TRAPS);
   static void resolve_special_call  (CallInfo& result,
+                                     Handle recv,
                                      const LinkInfo& link_info,
                                      TRAPS);
   static void resolve_virtual_call  (CallInfo& result, Handle recv, KlassHandle recv_klass,
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -140,7 +140,8 @@
 
 void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_code,
                                                        methodHandle method,
-                                                       int vtable_index) {
+                                                       int vtable_index,
+                                                       bool sender_is_interface) {
   bool is_vtable_call = (vtable_index >= 0);  // FIXME: split this method on this boolean
   assert(method->interpreter_entry() != NULL, "should have been set at this point");
   assert(!method->is_obsolete(),  "attempt to write obsolete method to cpCache");
@@ -204,7 +205,13 @@
   if (byte_no == 1) {
     assert(invoke_code != Bytecodes::_invokevirtual &&
            invoke_code != Bytecodes::_invokeinterface, "");
+    // Don't mark invokespecial to method as resolved if sender is an interface.  The receiver
+    // has to be checked that it is a subclass of the current class every time this bytecode
+    // is executed.
+    if (invoke_code != Bytecodes::_invokespecial || !sender_is_interface ||
+        method->name() == vmSymbols::object_initializer_name()) {
     set_bytecode_1(invoke_code);
+    }
   } else if (byte_no == 2)  {
     if (change_to_virtual) {
       assert(invoke_code == Bytecodes::_invokeinterface, "");
@@ -234,17 +241,18 @@
   NOT_PRODUCT(verify(tty));
 }
 
-void ConstantPoolCacheEntry::set_direct_call(Bytecodes::Code invoke_code, methodHandle method) {
+void ConstantPoolCacheEntry::set_direct_call(Bytecodes::Code invoke_code, methodHandle method,
+                                             bool sender_is_interface) {
   int index = Method::nonvirtual_vtable_index;
   // index < 0; FIXME: inline and customize set_direct_or_vtable_call
-  set_direct_or_vtable_call(invoke_code, method, index);
+  set_direct_or_vtable_call(invoke_code, method, index, sender_is_interface);
 }
 
 void ConstantPoolCacheEntry::set_vtable_call(Bytecodes::Code invoke_code, methodHandle method, int index) {
   // either the method is a miranda or its holder should accept the given index
   assert(method->method_holder()->is_interface() || method->method_holder()->verify_vtable_index(index), "");
   // index >= 0; FIXME: inline and customize set_direct_or_vtable_call
-  set_direct_or_vtable_call(invoke_code, method, index);
+  set_direct_or_vtable_call(invoke_code, method, index, false);
 }
 
 void ConstantPoolCacheEntry::set_itable_call(Bytecodes::Code invoke_code, const methodHandle& method, int index) {
--- a/hotspot/src/share/vm/oops/cpCache.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/oops/cpCache.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -230,13 +230,15 @@
   void set_direct_or_vtable_call(
     Bytecodes::Code invoke_code,                 // the bytecode used for invoking the method
     methodHandle    method,                      // the method/prototype if any (NULL, otherwise)
-    int             vtable_index                 // the vtable index if any, else negative
+    int             vtable_index,                // the vtable index if any, else negative
+    bool            sender_is_interface
   );
 
  public:
   void set_direct_call(                          // sets entry to exact concrete method entry
     Bytecodes::Code invoke_code,                 // the bytecode used for invoking the method
-    methodHandle    method                       // the method to call
+    methodHandle    method,                      // the method to call
+    bool            sender_is_interface
   );
 
   void set_vtable_call(                          // sets entry to vtable index
--- a/hotspot/src/share/vm/opto/doCall.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/opto/doCall.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -505,6 +505,30 @@
     speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL;
   }
 
+  // invoke-super-special
+  if (iter().cur_bc_raw() == Bytecodes::_invokespecial && !orig_callee->is_object_initializer()) {
+    ciInstanceKlass* calling_klass = method()->holder();
+    ciInstanceKlass* sender_klass =
+        calling_klass->is_anonymous() ? calling_klass->host_klass() :
+                                        calling_klass;
+    if (sender_klass->is_interface()) {
+      Node* receiver_node = stack(sp() - nargs);
+      Node* cls_node = makecon(TypeKlassPtr::make(sender_klass));
+      Node* bad_type_ctrl = NULL;
+      Node* casted_receiver = gen_checkcast(receiver_node, cls_node, &bad_type_ctrl);
+      if (bad_type_ctrl != NULL) {
+        PreserveJVMState pjvms(this);
+        set_control(bad_type_ctrl);
+        uncommon_trap(Deoptimization::Reason_class_check,
+                      Deoptimization::Action_none);
+      }
+      if (stopped()) {
+        return; // MUST uncommon-trap?
+      }
+      set_stack(sp() - nargs, casted_receiver);
+    }
+  }
+
   // Note:  It's OK to try to inline a virtual call.
   // The call generator will not attempt to inline a polymorphic call
   // unless it knows how to optimize the receiver dispatch.
--- a/hotspot/src/share/vm/opto/memnode.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -61,6 +61,15 @@
   return calculate_adr_type(adr->bottom_type(), cross_check);
 }
 
+bool MemNode::check_if_adr_maybe_raw(Node* adr) {
+  if (adr != NULL) {
+    if (adr->bottom_type()->base() == Type::RawPtr || adr->bottom_type()->base() == Type::AnyPtr) {
+      return true;
+    }
+  }
+  return false;
+}
+
 #ifndef PRODUCT
 void MemNode::dump_spec(outputStream *st) const {
   if (in(Address) == NULL)  return; // node is dead
@@ -560,6 +569,7 @@
   if (offset == Type::OffsetBot)
     return NULL;            // cannot unalias unless there are precise offsets
 
+  const bool adr_maybe_raw = check_if_adr_maybe_raw(adr);
   const TypeOopPtr *addr_t = adr->bottom_type()->isa_oopptr();
 
   intptr_t size_in_bytes = memory_size();
@@ -577,6 +587,13 @@
       Node* st_base = AddPNode::Ideal_base_and_offset(st_adr, phase, st_offset);
       if (st_base == NULL)
         break;              // inscrutable pointer
+
+      // For raw accesses it's not enough to prove that constant offsets don't intersect.
+      // We need the bases to be the equal in order for the offset check to make sense.
+      if ((adr_maybe_raw || check_if_adr_maybe_raw(st_adr)) && st_base != base) {
+        break;
+      }
+
       if (st_offset != offset && st_offset != Type::OffsetBot) {
         const int MAX_STORE = BytesPerLong;
         if (st_offset >= offset + size_in_bytes ||
--- a/hotspot/src/share/vm/opto/memnode.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/opto/memnode.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -78,6 +78,7 @@
   }
 
   virtual Node* find_previous_arraycopy(PhaseTransform* phase, Node* ld_alloc, Node*& mem, bool can_see_stored_value) const { return NULL; }
+  static bool check_if_adr_maybe_raw(Node* adr);
 
 public:
   // Helpers for the optimizer.  Documented in memnode.cpp.
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -727,7 +727,7 @@
           assert(!is_signature_polymorphic_static(mh_invoke_id), "");
           LinkResolver::resolve_handle_call(result, link_info, THREAD);
         } else if (ref_kind == JVM_REF_invokeSpecial) {
-          LinkResolver::resolve_special_call(result,
+          LinkResolver::resolve_special_call(result, Handle(),
                         link_info, THREAD);
         } else if (ref_kind == JVM_REF_invokeVirtual) {
           LinkResolver::resolve_virtual_call(result, Handle(), defc,
@@ -755,7 +755,7 @@
       {
         assert(!HAS_PENDING_EXCEPTION, "");
         if (name == vmSymbols::object_initializer_name()) {
-          LinkResolver::resolve_special_call(result, link_info, THREAD);
+          LinkResolver::resolve_special_call(result, Handle(), link_info, THREAD);
         } else {
           break;                // will throw after end of switch
         }
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -375,6 +375,7 @@
   // -------------- Deprecated Flags --------------
   // --- Non-alias flags - sorted by obsolete_in then expired_in:
   { "MaxGCMinorPauseMillis",        JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
+  { "UseConcMarkSweepGC",           JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
 
   // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
   { "DefaultMaxRAMFraction",        JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
@@ -2240,8 +2241,6 @@
   if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) {
     return JNI_EINVAL;
   }
-  FLAG_SET_DEFAULT(ParallelGCThreads,
-          Abstract_VM_Version::parallel_worker_threads());
 
   // Encourage steady state memory management
   if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) {
@@ -2440,6 +2439,9 @@
   status = status && check_jvmci_args_consistency();
 
   if (EnableJVMCI) {
+    PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
+        AddProperty, UnwriteableProperty, InternalProperty);
+
     if (!ScavengeRootsInCode) {
       warning("forcing ScavengeRootsInCode non-zero because JVMCI is enabled");
       ScavengeRootsInCode = 1;
--- a/hotspot/src/share/vm/runtime/javaCalls.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/runtime/javaCalls.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -221,7 +221,7 @@
 void JavaCalls::call_special(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
   CallInfo callinfo;
   LinkInfo link_info(klass, name, signature);
-  LinkResolver::resolve_special_call(callinfo, link_info, CHECK);
+  LinkResolver::resolve_special_call(callinfo, args->receiver(), link_info, CHECK);
   methodHandle method = callinfo.selected_method();
   assert(method.not_null(), "should have thrown exception");
 
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Jul 05 23:21:47 2017 +0200
@@ -199,6 +199,7 @@
 typedef HashtableEntry<Klass*, mtClass>       KlassHashtableEntry;
 typedef TwoOopHashtable<Symbol*, mtClass>     SymbolTwoOopHashtable;
 typedef CompactHashtable<Symbol*, char>       SymbolCompactHashTable;
+typedef RehashableHashtable<Symbol*, mtSymbol>   RehashableSymbolHashtable;
 
 //--------------------------------------------------------------------------------
 // VM_STRUCTS
@@ -584,6 +585,7 @@
                                                                                                                                      \
      static_field(SymbolTable,                 _the_table,                                    SymbolTable*)                          \
      static_field(SymbolTable,                 _shared_table,                                 SymbolCompactHashTable)                \
+     static_field(RehashableSymbolHashtable,   _seed,                                         juint)                                 \
                                                                                                                                      \
   /***************/                                                                                                                  \
   /* StringTable */                                                                                                                  \
@@ -1602,6 +1604,8 @@
                                                                           \
   declare_toplevel_type(BasicHashtable<mtInternal>)                       \
     declare_type(IntptrHashtable, BasicHashtable<mtInternal>)             \
+  declare_toplevel_type(BasicHashtable<mtSymbol>)                         \
+    declare_type(RehashableSymbolHashtable, BasicHashtable<mtSymbol>)     \
   declare_type(SymbolTable, SymbolHashtable)                              \
   declare_type(StringTable, StringHashtable)                              \
     declare_type(LoaderConstraintTable, KlassHashtable)                   \
--- a/hotspot/src/share/vm/utilities/hashtable.hpp	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/src/share/vm/utilities/hashtable.hpp	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -294,6 +294,7 @@
 };
 
 template <class T, MEMFLAGS F> class RehashableHashtable : public Hashtable<T, F> {
+ friend class VMStructs;
  protected:
 
   enum {
--- a/hotspot/test/TEST.ROOT	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/TEST.ROOT	Wed Jul 05 23:21:47 2017 +0200
@@ -59,3 +59,6 @@
 
 # Use new module options
 useNewOptions=true
+
+# Use --patch-module instead of -Xmodule:
+useNewPatchModule=true
--- a/hotspot/test/compiler/intrinsics/zip/TestCRC32.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/intrinsics/zip/TestCRC32.java	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,22 @@
 import java.util.zip.Checksum;
 
 public class TestCRC32 {
-    public static void main(String[] args) {
+    // standard CRC32 polynomial
+    // coefficients in different forms
+    // normal:              polyBits = 0x04c11db7   = 0b0000 0100 1100 0001 0001 1101 1011 0111
+    // reversed:            polybits = 0xedb88320   = 0b1110 1101 1011 1000 1000 0011 0010 0000
+    // reversed reciprocal  polybits = 0x82608edb   = 0b1000 0010 0110 0000 1000 1110 1101 1011
+    //
+    //                                                  0      5    9    13   17   21   25   29
+    //                                                  |      |    |    |    |    |    |    |
+    // reversed shiftL 1    polyBits = 0x1db710641L = 0b1 1101 1011 0111 0001 0000 0110 0100 0001
+    final static long polyBits = (1L<<(32-32)) + (1L<<(32-26)) + (1L<<(32-23)) + (1L<<(32-22))
+                               + (1L<<(32-16)) + (1L<<(32-12)) + (1L<<(32-11)) + (1L<<(32-10))
+                               + (1L<<(32-8))  + (1L<<(32-7))  + (1L<<(32-5))  + (1L<<(32-4))
+                               + (1L<<(32-2))  + (1L<<(32-1))  + (1L<<(32-0));
+    final static long polyBitsShifted = polyBits>>1;
+
+    public static void main(String[] args) throws Exception {
         int offset = Integer.getInteger("offset", 0);
         int msgSize = Integer.getInteger("msgSize", 512);
         boolean multi = false;
@@ -65,11 +80,14 @@
 
         byte[] b = initializedBytes(msgSize, offset);
 
+        final long crcReference = update_byteLoop(0, b, offset);
+
         CRC32 crc0 = new CRC32();
         CRC32 crc1 = new CRC32();
         CRC32 crc2 = new CRC32();
 
         crc0.update(b, offset, msgSize);
+        check(crc0, crcReference);
 
         System.out.println("-------------------------------------------------------");
 
@@ -77,27 +95,35 @@
         for (int i = 0; i < warmupIters; i++) {
             crc1.reset();
             crc1.update(b, offset, msgSize);
+            check(crc1, crcReference);
         }
 
-        /* measure performance */
+        /* check correctness
+         * Do that before measuring performance
+         * to even better heat up involved methods.
+         */
+        for (int i = 0; i < iters; i++) {
+            crc1.reset();
+            crc1.update(b, offset, msgSize);
+            check(crc1, crcReference);
+        }
+        report("CRCs", crc1, crcReference);
+
+        /* measure performance
+         * Don't spoil times with error checking.
+         */
         long start = System.nanoTime();
         for (int i = 0; i < iters; i++) {
             crc1.reset();
             crc1.update(b, offset, msgSize);
         }
         long end = System.nanoTime();
+
         double total = (double)(end - start)/1e9;         // in seconds
         double thruput = (double)msgSize*iters/1e6/total; // in MB/s
         System.out.println("CRC32.update(byte[]) runtime = " + total + " seconds");
         System.out.println("CRC32.update(byte[]) throughput = " + thruput + " MB/s");
-
-        /* check correctness */
-        for (int i = 0; i < iters; i++) {
-            crc1.reset();
-            crc1.update(b, offset, msgSize);
-            if (!check(crc0, crc1)) break;
-        }
-        report("CRCs", crc0, crc1);
+        report("CRCs", crc1, crcReference);
 
         System.out.println("-------------------------------------------------------");
 
@@ -110,9 +136,24 @@
             crc2.reset();
             crc2.update(buf);
             buf.rewind();
+            check(crc2, crcReference);
         }
 
-        /* measure performance */
+        /* check correctness
+         * Do that before measuring performance
+         * to even better heat up involved methods.
+         */
+        for (int i = 0; i < iters; i++) {
+            crc2.reset();
+            crc2.update(buf);
+            buf.rewind();
+            check(crc2, crcReference);
+        }
+        report("CRCs", crc2, crcReference);
+
+        /* measure performance
+         * Don't spoil times with error checking.
+         */
         start = System.nanoTime();
         for (int i = 0; i < iters; i++) {
             crc2.reset();
@@ -124,31 +165,57 @@
         thruput = (double)msgSize*iters/1e6/total; // in MB/s
         System.out.println("CRC32.update(ByteBuffer) runtime = " + total + " seconds");
         System.out.println("CRC32.update(ByteBuffer) throughput = " + thruput + " MB/s");
-
-        /* check correctness */
-        for (int i = 0; i < iters; i++) {
-            crc2.reset();
-            crc2.update(buf);
-            buf.rewind();
-            if (!check(crc0, crc2)) break;
-        }
-        report("CRCs", crc0, crc2);
+        report("CRCs", crc2, crcReference);
 
         System.out.println("-------------------------------------------------------");
     }
 
-    private static void report(String s, Checksum crc0, Checksum crc1) {
-        System.out.printf("%s: crc0 = %08x, crc1 = %08x\n",
-                          s, crc0.getValue(), crc1.getValue());
+    // Just a loop over a byte array, updating the CRC byte by byte.
+    public static long update_byteLoop(long crc, byte[] buf, int offset) {
+        return update_byteLoop(crc, buf, offset, buf.length-offset);
+    }
+
+    // Just a loop over a byte array, with given length, updating the CRC byte by byte.
+    public static long update_byteLoop(long crc, byte[] buf, int offset, int length) {
+        int end = length+offset;
+        for (int i = offset; i < end; i++) {
+            crc = update_singlebyte(crc, polyBitsShifted, buf[i]);
+        }
+        return crc;
     }
 
-    private static boolean check(Checksum crc0, Checksum crc1) {
-        if (crc0.getValue() != crc1.getValue()) {
-            System.err.printf("ERROR: crc0 = %08x, crc1 = %08x\n",
-                              crc0.getValue(), crc1.getValue());
-            return false;
+    // Straight-forward implementation of CRC update by one byte.
+    // We use this very basic implementation to calculate reference
+    // results. It is necessary to have full control over how the
+    // reference results are calculated. It is not sufficient to rely
+    // on the interpreter (or c1, or c2) to do the right thing.
+    public static long update_singlebyte(long crc, long polynomial, int val) {
+        crc = (crc ^ -1L) & 0x00000000ffffffffL;  // use 1's complement of crc
+        crc =  crc ^ (val&0xff);                  // XOR in next byte from stream
+        for (int i = 0; i <  8; i++) {
+            boolean bitset = (crc & 0x01L) != 0;
+
+            crc = crc>>1;
+            if (bitset) {
+                crc = crc ^ polynomial;
+                crc = crc & 0x00000000ffffffffL;
+            }
         }
-        return true;
+        crc = (crc ^ -1L) & 0x00000000ffffffffL;  // revert taking 1's complement
+        return crc;
+    }
+
+    private static void report(String s, Checksum crc, long crcReference) {
+        System.out.printf("%s: crc = %08x, crcReference = %08x\n",
+                          s, crc.getValue(), crcReference);
+    }
+
+    private static void check(Checksum crc, long crcReference) throws Exception {
+        if (crc.getValue() != crcReference) {
+            System.err.printf("ERROR: crc = %08x, crcReference = %08x\n",
+                              crc.getValue(), crcReference);
+            throw new Exception("TestCRC32 Error");
+        }
     }
 
     private static byte[] initializedBytes(int M, int offset) {
@@ -162,7 +229,7 @@
         return bytes;
     }
 
-    private static void test_multi(int iters) {
+    private static void test_multi(int iters) throws Exception {
         int len1 = 8;    // the  8B/iteration loop
         int len2 = 32;   // the 32B/iteration loop
         int len3 = 4096; // the 4KB/iteration loop
@@ -185,37 +252,31 @@
                         (len1+len2+len3)*2+5, (len1+len2+len3)*2+7,
                         (len1+len2+len3)*3, (len1+len2+len3)*3-1, (len1+len2+len3)*3-3,
                         (len1+len2+len3)*3-5, (len1+len2+len3)*3-7 };
-        CRC32[] crc0 = new CRC32[offsets.length*sizes.length];
         CRC32[] crc1 = new CRC32[offsets.length*sizes.length];
+        long[] crcReference = new long[offsets.length*sizes.length];
         int i, j, k;
 
         System.out.printf("testing %d cases ...\n", offsets.length*sizes.length);
 
-        /* set the result from interpreter as reference */
+        // Initialize CRC32 result arrays, CRC32 reference array.
+        // Reference is calculated using a very basic Java implementation.
         for (i = 0; i < offsets.length; i++) {
             for (j = 0; j < sizes.length; j++) {
-                crc0[i*sizes.length + j] = new CRC32();
                 crc1[i*sizes.length + j] = new CRC32();
-                crc0[i*sizes.length + j].update(b, offsets[i], sizes[j]);
+                crcReference[i*sizes.length + j] = update_byteLoop(0, b, offsets[i], sizes[j]);
             }
         }
 
-        /* warm up the JIT compiler and get result */
+        // Warm up the JIT compiler. Over time, all methods involved will
+        // be executed by the interpreter, then get compiled by c1 and
+        // finally by c2. Each calculated CRC value must, in each iteration,
+        // be equal to the precalculated reference value for the test to pass.
         for (k = 0; k < iters; k++) {
             for (i = 0; i < offsets.length; i++) {
                 for (j = 0; j < sizes.length; j++) {
                     crc1[i*sizes.length + j].reset();
                     crc1[i*sizes.length + j].update(b, offsets[i], sizes[j]);
-                }
-            }
-        }
-
-        /* check correctness */
-        for (i = 0; i < offsets.length; i++) {
-            for (j = 0; j < sizes.length; j++) {
-                if (!check(crc0[i*sizes.length + j], crc1[i*sizes.length + j])) {
-                    System.out.printf("offsets[%d] = %d", i, offsets[i]);
-                    System.out.printf("\tsizes[%d] = %d\n", j, sizes[j]);
+                    check(crc1[i*sizes.length + j], crcReference[i*sizes.length + j]);
                 }
             }
         }
--- a/hotspot/test/compiler/intrinsics/zip/TestCRC32C.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/intrinsics/zip/TestCRC32C.java	Wed Jul 05 23:21:47 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,23 @@
 import java.util.zip.Checksum;
 
 public class TestCRC32C {
-    public static void main(String[] args) {
+    // CRC32C (Castagnoli) polynomial
+    // coefficients in different forms
+    // normal:              polyBits = 0x1edc6f41   = 0b0001 1110 1101 1100 0110 1111 0100 0001
+    // reversed:            polybits = 0x82f63b78   = 0b1000 0010 1111 0110 0011 1011 0111 1000
+    // reversed reciprocal  polybits = 0x8f6e37a0   = 0b1000 1111 0110 1110 0011 0111 1010 0000
+    //
+    //                                                  0      5    9    13   17   21   25   29
+    //                                                  |      |    |    |    |    |    |    |
+    // reversed shiftL 1    polyBits = 0x105ec76f1L = 0b1 0000 0101 1110 1100 0111 0110 1111 0001
+    final static long polyBits = (1L<<(32-32)) + (1L<<(32-28)) + (1L<<(32-27))
+                               + (1L<<(32-26)) + (1L<<(32-25)) + (1L<<(32-23)) + (1L<<(32-22))
+                               + (1L<<(32-20)) + (1L<<(32-19)) + (1L<<(32-18)) + (1L<<(32-14))
+                               + (1L<<(32-13)) + (1L<<(32-11)) + (1L<<(32-10)) + (1L<<(32-9))
+                               + (1L<<(32-8))  + (1L<<(32-6))  + (1L<<(32-0));
+    final static long polyBitsShifted = polyBits>>1;
+
+    public static void main(String[] args) throws Exception {
         int offset = Integer.getInteger("offset", 0);
         int msgSize = Integer.getInteger("msgSize", 512);
         boolean multi = false;
@@ -65,11 +81,14 @@
 
         byte[] b = initializedBytes(msgSize, offset);
 
+        final long crcReference = update_byteLoop(0, b, offset);
+
         CRC32C crc0 = new CRC32C();
         CRC32C crc1 = new CRC32C();
         CRC32C crc2 = new CRC32C();
 
         crc0.update(b, offset, msgSize);
+        check(crc0, crcReference);
 
         System.out.println("-------------------------------------------------------");
 
@@ -77,27 +96,35 @@
         for (int i = 0; i < warmupIters; i++) {
             crc1.reset();
             crc1.update(b, offset, msgSize);
+            check(crc1, crcReference);
         }
 
-        /* measure performance */
+        /* check correctness
+         * Do that before measuring performance
+         * to even better heat up involved methods.
+         */
+        for (int i = 0; i < iters; i++) {
+            crc1.reset();
+            crc1.update(b, offset, msgSize);
+            check(crc1, crcReference);
+        }
+        report("CRCs", crc1, crcReference);
+
+        /* measure performance
+         * Don't spoil times with error checking.
+         */
         long start = System.nanoTime();
         for (int i = 0; i < iters; i++) {
             crc1.reset();
             crc1.update(b, offset, msgSize);
         }
         long end = System.nanoTime();
+
         double total = (double)(end - start)/1e9;         // in seconds
         double thruput = (double)msgSize*iters/1e6/total; // in MB/s
         System.out.println("CRC32C.update(byte[]) runtime = " + total + " seconds");
         System.out.println("CRC32C.update(byte[]) throughput = " + thruput + " MB/s");
-
-        /* check correctness */
-        for (int i = 0; i < iters; i++) {
-            crc1.reset();
-            crc1.update(b, offset, msgSize);
-            if (!check(crc0, crc1)) break;
-        }
-        report("CRCs", crc0, crc1);
+        report("CRCs", crc1, crcReference);
 
         System.out.println("-------------------------------------------------------");
 
@@ -110,9 +137,24 @@
             crc2.reset();
             crc2.update(buf);
             buf.rewind();
+            check(crc2, crcReference);
         }
 
-        /* measure performance */
+        /* check correctness
+         * Do that before measuring performance
+         * to even better heat up involved methods.
+         */
+        for (int i = 0; i < iters; i++) {
+            crc2.reset();
+            crc2.update(buf);
+            buf.rewind();
+            check(crc2, crcReference);
+        }
+        report("CRCs", crc2, crcReference);
+
+        /* measure performance
+         * Don't spoil times with error checking.
+         */
         start = System.nanoTime();
         for (int i = 0; i < iters; i++) {
             crc2.reset();
@@ -124,31 +166,57 @@
         thruput = (double)msgSize*iters/1e6/total; // in MB/s
         System.out.println("CRC32C.update(ByteBuffer) runtime = " + total + " seconds");
         System.out.println("CRC32C.update(ByteBuffer) throughput = " + thruput + " MB/s");
-
-        /* check correctness */
-        for (int i = 0; i < iters; i++) {
-            crc2.reset();
-            crc2.update(buf);
-            buf.rewind();
-            if (!check(crc0, crc2)) break;
-        }
-        report("CRCs", crc0, crc2);
+        report("CRCs", crc2, crcReference);
 
         System.out.println("-------------------------------------------------------");
     }
 
-    private static void report(String s, Checksum crc0, Checksum crc1) {
-        System.out.printf("%s: crc0 = %08x, crc1 = %08x\n",
-                          s, crc0.getValue(), crc1.getValue());
+    // Just a loop over a byte array, updating the CRC byte by byte.
+    public static long update_byteLoop(long crc, byte[] buf, int offset) {
+        return update_byteLoop(crc, buf, offset, buf.length-offset);
+    }
+
+    // Just a loop over a byte array, with given length, updating the CRC byte by byte.
+    public static long update_byteLoop(long crc, byte[] buf, int offset, int length) {
+        int end = length+offset;
+        for (int i = offset; i < end; i++) {
+            crc = update_singlebyte(crc, polyBitsShifted, buf[i]);
+        }
+        return crc;
     }
 
-    private static boolean check(Checksum crc0, Checksum crc1) {
-        if (crc0.getValue() != crc1.getValue()) {
-            System.err.printf("ERROR: crc0 = %08x, crc1 = %08x\n",
-                              crc0.getValue(), crc1.getValue());
-            return false;
+    // Straight-forward implementation of CRC update by one byte.
+    // We use this very basic implementation to calculate reference
+    // results. It is necessary to have full control over how the
+    // reference results are calculated. It is not sufficient to rely
+    // on the interpreter (or c1, or c2) to do the right thing.
+    public static long update_singlebyte(long crc, long polynomial, int val) {
+        crc = (crc ^ -1L) & 0x00000000ffffffffL;  // use 1's complement of crc
+        crc =  crc ^ (val&0xff);                  // XOR in next byte from stream
+        for (int i = 0; i <  8; i++) {
+            boolean bitset = (crc & 0x01L) != 0;
+
+            crc = crc>>1;
+            if (bitset) {
+                crc = crc ^ polynomial;
+                crc = crc & 0x00000000ffffffffL;
+            }
         }
-        return true;
+        crc = (crc ^ -1L) & 0x00000000ffffffffL;  // revert taking 1's complement
+        return crc;
+    }
+
+    private static void report(String s, Checksum crc, long crcReference) {
+        System.out.printf("%s: crc = %08x, crcReference = %08x\n",
+                          s, crc.getValue(), crcReference);
+    }
+
+    private static void check(Checksum crc, long crcReference) throws Exception {
+        if (crc.getValue() != crcReference) {
+            System.err.printf("ERROR: crc = %08x, crcReference = %08x\n",
+                              crc.getValue(), crcReference);
+            throw new Exception("TestCRC32C Error");
+        }
     }
 
     private static byte[] initializedBytes(int M, int offset) {
@@ -162,7 +230,7 @@
         return bytes;
     }
 
-    private static void test_multi(int iters) {
+    private static void test_multi(int iters) throws Exception {
         int len1 = 8;    // the  8B/iteration loop
         int len2 = 32;   // the 32B/iteration loop
         int len3 = 4096; // the 4KB/iteration loop
@@ -185,37 +253,31 @@
                         (len1+len2+len3)*2+5, (len1+len2+len3)*2+7,
                         (len1+len2+len3)*3, (len1+len2+len3)*3-1, (len1+len2+len3)*3-3,
                         (len1+len2+len3)*3-5, (len1+len2+len3)*3-7 };
-        CRC32C[] crc0 = new CRC32C[offsets.length*sizes.length];
         CRC32C[] crc1 = new CRC32C[offsets.length*sizes.length];
+        long[] crcReference = new long[offsets.length*sizes.length];
         int i, j, k;
 
         System.out.printf("testing %d cases ...\n", offsets.length*sizes.length);
 
-        /* set the result from interpreter as reference */
+        // Initialize CRC32C result arrays, CRC32C reference array.
+        // Reference is calculated using a very basic Java implementation.
         for (i = 0; i < offsets.length; i++) {
             for (j = 0; j < sizes.length; j++) {
-                crc0[i*sizes.length + j] = new CRC32C();
                 crc1[i*sizes.length + j] = new CRC32C();
-                crc0[i*sizes.length + j].update(b, offsets[i], sizes[j]);
+                crcReference[i*sizes.length + j] = update_byteLoop(0, b, offsets[i], sizes[j]);
             }
         }
 
-        /* warm up the JIT compiler and get result */
+        // Warm up the JIT compiler. Over time, all methods involved will
+        // be executed by the interpreter, then get compiled by c1 and
+        // finally by c2. Each calculated CRC value must, in each iteration,
+        // be equal to the precalculated reference value for the test to pass.
         for (k = 0; k < iters; k++) {
             for (i = 0; i < offsets.length; i++) {
                 for (j = 0; j < sizes.length; j++) {
                     crc1[i*sizes.length + j].reset();
                     crc1[i*sizes.length + j].update(b, offsets[i], sizes[j]);
-                }
-            }
-        }
-
-        /* check correctness */
-        for (i = 0; i < offsets.length; i++) {
-            for (j = 0; j < sizes.length; j++) {
-                if (!check(crc0[i*sizes.length + j], crc1[i*sizes.length + j])) {
-                    System.out.printf("offsets[%d] = %d", i, offsets[i]);
-                    System.out.printf("\tsizes[%d] = %d\n", j, sizes[j]);
+                    check(crc1[i*sizes.length + j], crcReference[i*sizes.length + j]);
                 }
             }
         }
--- a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -30,7 +30,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.runtime
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *      -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true
- *      -XX:+EnableJVMCI
+ *      -XX:+EnableJVMCI -Djvmci.Compiler=null
  *      compiler.jvmci.JVM_GetJVMCIRuntimeTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *      -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=false
@@ -39,7 +39,7 @@
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *      -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true
  *      -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.threaded=true
- *      -XX:+EnableJVMCI
+ *      -XX:+EnableJVMCI -Djvmci.Compiler=null
  *      compiler.jvmci.JVM_GetJVMCIRuntimeTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *      -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=false
--- a/hotspot/test/compiler/jvmci/TestJVMCIPrintProperties.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/TestJVMCIPrintProperties.java	Wed Jul 05 23:21:47 2017 +0200
@@ -36,11 +36,11 @@
     public static void main(String[] args) throws Exception {
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
             "-XX:+UnlockExperimentalVMOptions",
-            "-XX:+EnableJVMCI",
+            "-XX:+EnableJVMCI", "-Djvmci.Compiler=null",
             "-XX:+JVMCIPrintProperties");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         output.shouldContain("[JVMCI properties]"); // expected message
-        output.shouldContain("jvmci.Compiler = null"); // expected message
+        output.shouldContain("jvmci.Compiler := \"null\""); // expected message
         output.shouldContain("jvmci.InitTimer = false"); // expected message
         output.shouldContain("jvmci.PrintConfig = false"); // expected message
         output.shouldContain("jvmci.TraceMethodDataFilter = null"); // expected message
--- a/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,7 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  *          jdk.internal.vm.ci/jdk.vm.ci.meta
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.AsResolvedJavaMethodTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -39,6 +39,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.DoNotInlineOrCompileTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -36,6 +36,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,6 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetBytecodeTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -31,6 +31,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetClassInitializerTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -38,6 +38,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetConstantPoolTest
  */
 package compiler.jvmci.compilerToVM;
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,6 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetExceptionTableTest
  */
 
@@ -137,4 +138,3 @@
         }
     }
 }
-
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -31,6 +31,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetImplementorTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -35,6 +35,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetLineNumberTableTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -38,6 +38,7 @@
  * @compile -g DummyClass.java
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetLocalVariableTableTest
  * @clean compiler.jvmci.compilerToVM.*
  */
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -35,6 +35,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.meta
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetNextStackFrameTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -38,6 +38,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetResolvedJavaMethodTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -44,7 +44,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   -XX:-UseCompressedOops
+ *                   -XX:-UseCompressedOops -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetResolvedJavaTypeTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,6 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetStackTraceElementTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -35,6 +35,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.meta
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                  compiler.jvmci.compilerToVM.GetSymbolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,6 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -39,7 +39,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   -XX:-BackgroundCompilation
+ *                   -XX:-BackgroundCompilation -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -31,7 +31,8 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                  compiler.jvmci.compilerToVM.HasFinalizableSubclassTest
+ *                   -Djvmci.Compiler=null
+ *                   compiler.jvmci.compilerToVM.HasFinalizableSubclassTest
  */
 
 package compiler.jvmci.compilerToVM;
--- a/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -39,6 +39,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.HasNeverInlineDirectiveTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -42,6 +42,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.InvalidateInstalledCodeTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -39,10 +39,12 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.IsCompilableTest
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.IsCompilableTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -38,6 +38,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *     -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbatch
+ *     -Djvmci.Compiler=null
  *     compiler.jvmci.compilerToVM.IsMatureVsReprofileTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -42,6 +42,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.LookupKlassInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,6 +40,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.LookupKlassRefIndexInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,6 +40,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.LookupMethodInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,6 +40,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.LookupNameAndTypeRefIndexInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -41,6 +41,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.LookupNameInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -41,6 +41,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.LookupSignatureInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -31,6 +31,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.LookupTypeTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -49,6 +49,7 @@
  *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
  * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -60,6 +61,7 @@
  *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
  * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -71,6 +73,7 @@
  *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
  * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@@ -82,6 +85,7 @@
  *                   -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false
  *                   -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -35,6 +35,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -32,6 +32,7 @@
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @build compiler.jvmci.compilerToVM.ReadConfigurationTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ReadConfigurationTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,7 +40,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *                   -Xmixed -Xbatch
+ *                   -Xmixed -Xbatch -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ReprofileTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,6 +40,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ResolveConstantInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,6 +40,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ResolveFieldInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,6 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.code
  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ResolveMethodTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -40,6 +40,7 @@
  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ResolvePossiblyCachedConstantInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -41,6 +41,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ResolveTypeInPoolTest
  */
 
--- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -39,6 +39,7 @@
  * @run main/othervm -Xbootclasspath/a:.
  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null
  *                   compiler.jvmci.compilerToVM.ShouldInlineMethodTest
  */
 
--- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java	Wed Jul 05 23:21:47 2017 +0200
@@ -31,7 +31,8 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          jdk.internal.vm.ci/jdk.vm.ci.common
  * @compile CodeInstallerTest.java
- * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult
+ * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *                   -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidCompilationResult
  */
 
 package compiler.jvmci.errors;
--- a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java	Wed Jul 05 23:21:47 2017 +0200
@@ -31,7 +31,8 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          jdk.internal.vm.ci/jdk.vm.ci.common
  * @compile CodeInstallerTest.java
- * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidDebugInfo
+ * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *              -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidDebugInfo
  */
 
 package compiler.jvmci.errors;
--- a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java	Wed Jul 05 23:21:47 2017 +0200
@@ -31,7 +31,8 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          jdk.internal.vm.ci/jdk.vm.ci.common
  * @compile CodeInstallerTest.java
- * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidOopMap
+ * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
+ *             -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidOopMap
  */
 
 package compiler.jvmci.errors;
--- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -49,21 +49,14 @@
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
  *     -Xbootclasspath/a:. -Xmixed
  *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
- *     -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
- *     compiler.jvmci.events.JvmciNotifyInstallEventTest
- * @run main/othervm -XX:+UnlockExperimentalVMOptions
- *     -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
- *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
- *     -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
  * @run main/othervm -XX:+UnlockExperimentalVMOptions
- *     -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
- *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:JVMCINMethodSizeLimit=0
- *     -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
+ *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
+ *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
- * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-EnableJVMCI
- *     -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
- *     -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=true
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions
+ *     -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
+ *     -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:JVMCINMethodSizeLimit=0
  *     compiler.jvmci.events.JvmciNotifyInstallEventTest
  */
 
@@ -91,8 +84,6 @@
 
 public class JvmciNotifyInstallEventTest extends JVMCIServiceLocator implements HotSpotVMEventListener {
     private static final String METHOD_NAME = "testMethod";
-    private static final boolean FAIL_ON_INIT = !Boolean.getBoolean(
-            "compiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit");
     private static volatile int gotInstallNotification = 0;
 
     public static void main(String args[]) {
@@ -116,16 +107,9 @@
             codeCache = (HotSpotCodeCacheProvider) HotSpotJVMCIRuntime.runtime()
                     .getHostJVMCIBackend().getCodeCache();
         } catch (InternalError ie) {
-            if (FAIL_ON_INIT) {
-                throw new AssertionError(
-                        "Got unexpected InternalError trying to get code cache",
-                        ie);
-            }
             // passed
             return;
         }
-        Asserts.assertTrue(FAIL_ON_INIT,
-                    "Haven't caught InternalError in negative case");
         Method testMethod;
         try {
             testMethod = SimpleClass.class.getDeclaredMethod(METHOD_NAME);
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -33,7 +33,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.amd64
  *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.DataPatchTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.DataPatchTest
  */
 
 package jdk.vm.ci.code.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -33,7 +33,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.amd64
  *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.InterpreterFrameSizeTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.InterpreterFrameSizeTest
  */
 
 package jdk.vm.ci.code.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,7 +34,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.amd64
  *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.MaxOopMapStackOffsetTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.MaxOopMapStackOffsetTest
  */
 
 package jdk.vm.ci.code.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -33,7 +33,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.amd64
  *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleCodeInstallationTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.SimpleCodeInstallationTest
  */
 
 package jdk.vm.ci.code.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -33,7 +33,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.amd64
  *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleDebugInfoTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.SimpleDebugInfoTest
  */
 
 package jdk.vm.ci.code.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -33,7 +33,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.amd64
  *          jdk.internal.vm.ci/jdk.vm.ci.sparc
  * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.VirtualObjectDebugInfoTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.VirtualObjectDebugInfoTest
  */
 
 package jdk.vm.ci.code.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,7 +34,7 @@
  * @run driver ClassFileInstaller jdk.vm.ci.hotspot.test.DummyClass
  * @run testng/othervm/timeout=300 -Xbootclasspath/a:.
  *      -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *       jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest
+ *      -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest
  */
 
 package jdk.vm.ci.hotspot.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -37,7 +37,7 @@
  * @run testng/othervm -Xbootclasspath/a:.
  *      -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *      -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *      jdk.vm.ci.hotspot.test.MemoryAccessProviderTest
+ *      -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.MemoryAccessProviderTest
  */
 
 package jdk.vm.ci.hotspot.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -32,7 +32,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open
  * @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
- *      jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest
+ *      -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest
  */
 
 package jdk.vm.ci.hotspot.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ConstantTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ConstantTest
  */
 package jdk.vm.ci.runtime.test;
 
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -29,7 +29,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          jdk.attach
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.RedefineClassTest
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -26,7 +26,7 @@
  * @requires vm.jvmci
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -26,7 +26,7 @@
  * @requires vm.jvmci
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestConstantReflectionProvider
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestConstantReflectionProvider
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaField
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestJavaField
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaMethod
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestJavaMethod
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaType
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestJavaType
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestMetaAccessProvider
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestMetaAccessProvider
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaField
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestResolvedJavaField
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java	Wed Jul 05 23:21:47 2017 +0200
@@ -28,7 +28,7 @@
  * @modules jdk.internal.vm.ci/jdk.vm.ci.meta
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestResolvedJavaMethod
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java	Wed Jul 05 23:21:47 2017 +0200
@@ -30,7 +30,7 @@
  *          jdk.internal.vm.ci/jdk.vm.ci.runtime
  *          jdk.internal.vm.ci/jdk.vm.ci.common
  *          java.base/jdk.internal.misc
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaType
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestResolvedJavaType
  */
 
 package jdk.vm.ci.runtime.test;
--- a/hotspot/test/compiler/jvmci/meta/StableFieldTest.java	Fri May 05 04:50:17 2017 +0000
+++ b/hotspot/test/compiler/jvmci/meta/StableFieldTest.java	Wed Jul 05 23:21:47 2017 +0200
@@ -34,7 +34,7 @@
  *
  * @compile StableFieldTest.java
  * @run driver ClassFileInstaller compiler.