src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java Fri Sep 14 13:18:52 2018 +0800
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java Thu Sep 13 22:45:12 2018 -0700
@@ -26,6 +26,7 @@
import static org.graalvm.compiler.bytecode.Bytecodes.AALOAD;
import static org.graalvm.compiler.bytecode.Bytecodes.AASTORE;
+import static org.graalvm.compiler.bytecode.Bytecodes.ANEWARRAY;
import static org.graalvm.compiler.bytecode.Bytecodes.ARETURN;
import static org.graalvm.compiler.bytecode.Bytecodes.ARRAYLENGTH;
import static org.graalvm.compiler.bytecode.Bytecodes.ATHROW;
@@ -78,6 +79,8 @@
import static org.graalvm.compiler.bytecode.Bytecodes.LOOKUPSWITCH;
import static org.graalvm.compiler.bytecode.Bytecodes.LREM;
import static org.graalvm.compiler.bytecode.Bytecodes.LRETURN;
+import static org.graalvm.compiler.bytecode.Bytecodes.MULTIANEWARRAY;
+import static org.graalvm.compiler.bytecode.Bytecodes.NEW;
import static org.graalvm.compiler.bytecode.Bytecodes.PUTFIELD;
import static org.graalvm.compiler.bytecode.Bytecodes.PUTSTATIC;
import static org.graalvm.compiler.bytecode.Bytecodes.RET;
@@ -679,10 +682,19 @@
case SALOAD:
case ARRAYLENGTH:
case CHECKCAST:
+ case NEW:
+ case ANEWARRAY:
+ case MULTIANEWARRAY:
case PUTSTATIC:
case GETSTATIC:
case PUTFIELD:
case GETFIELD: {
+ /*
+ * All bytecodes that can trigger lazy class initialization via a
+ * ClassInitializationPlugin (allocations, static field access) must be listed
+ * because the class initializer is allowed to throw an exception, which
+ * requires proper exception handling.
+ */
ExceptionDispatchBlock handler = handleExceptions(blockMap, bci);
if (handler != null) {
current = null;