< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java

Print this page

        

@@ -23,10 +23,11 @@
 
 
 package org.graalvm.compiler.replacements;
 
 import static java.util.FormattableFlags.ALTERNATE;
+import static jdk.vm.ci.services.Services.IS_IN_NATIVE_IMAGE;
 import static org.graalvm.compiler.debug.DebugContext.DEFAULT_LOG_STREAM;
 import static org.graalvm.compiler.debug.DebugContext.applyFormattingFlagsAndWidth;
 import static org.graalvm.compiler.debug.DebugOptions.DebugStubsAndSnippets;
 import static org.graalvm.compiler.graph.iterators.NodePredicates.isNotA;
 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED;

@@ -210,12 +211,13 @@
                     // Receiver must be constant.
                     assert !constantParameters[0];
                     constantParameters[0] = true;
                 }
 
-                // Retrieve the names only when assertions are turned on.
-                assert initNames(method, count);
+                // Retrieve the names only when assertions are turned on. Parameter annotations are
+                // unsupported in the native image.
+                assert IS_IN_NATIVE_IMAGE || initNames(method, count);
             }
 
             final boolean[] constantParameters;
             final boolean[] varargsParameters;
             final boolean[] nonNullParameters;
< prev index next >