src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java
equal
deleted
inserted
replaced
85 import java.util.Enumeration; |
85 import java.util.Enumeration; |
86 import java.util.Formatter; |
86 import java.util.Formatter; |
87 import java.util.zip.ZipEntry; |
87 import java.util.zip.ZipEntry; |
88 import java.util.zip.ZipFile; |
88 import java.util.zip.ZipFile; |
89 |
89 |
90 import org.graalvm.compiler.test.ModuleSupport; |
|
91 import org.graalvm.compiler.test.SubprocessUtil; |
|
92 import org.junit.Assert; |
|
93 import org.junit.Assume; |
|
94 import org.junit.Before; |
|
95 import org.junit.Test; |
|
96 |
|
97 import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; |
90 import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; |
98 import org.graalvm.compiler.api.test.Graal; |
91 import org.graalvm.compiler.api.test.Graal; |
99 import org.graalvm.compiler.bytecode.Bytecode; |
92 import org.graalvm.compiler.bytecode.Bytecode; |
100 import org.graalvm.compiler.bytecode.BytecodeDisassembler; |
93 import org.graalvm.compiler.bytecode.BytecodeDisassembler; |
101 import org.graalvm.compiler.bytecode.BytecodeLookupSwitch; |
94 import org.graalvm.compiler.bytecode.BytecodeLookupSwitch; |
109 import org.graalvm.compiler.phases.util.Providers; |
102 import org.graalvm.compiler.phases.util.Providers; |
110 import org.graalvm.compiler.replacements.classfile.ClassfileBytecode; |
103 import org.graalvm.compiler.replacements.classfile.ClassfileBytecode; |
111 import org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider; |
104 import org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider; |
112 import org.graalvm.compiler.runtime.RuntimeProvider; |
105 import org.graalvm.compiler.runtime.RuntimeProvider; |
113 import org.graalvm.compiler.serviceprovider.JavaVersionUtil; |
106 import org.graalvm.compiler.serviceprovider.JavaVersionUtil; |
|
107 import org.graalvm.compiler.test.ModuleSupport; |
|
108 import org.graalvm.compiler.test.SubprocessUtil; |
|
109 import org.junit.Assert; |
|
110 import org.junit.Assume; |
|
111 import org.junit.Before; |
|
112 import org.junit.Test; |
114 |
113 |
115 import jdk.vm.ci.meta.ConstantPool; |
114 import jdk.vm.ci.meta.ConstantPool; |
116 import jdk.vm.ci.meta.JavaField; |
115 import jdk.vm.ci.meta.JavaField; |
117 import jdk.vm.ci.meta.JavaMethodProfile.ProfiledMethod; |
116 import jdk.vm.ci.meta.JavaMethodProfile.ProfiledMethod; |
118 import jdk.vm.ci.meta.JavaType; |
117 import jdk.vm.ci.meta.JavaType; |
207 /* uses old class format */ |
206 /* uses old class format */ |
208 continue; |
207 continue; |
209 } |
208 } |
210 try { |
209 try { |
211 checkClass(metaAccess, getSnippetReflection(), className); |
210 checkClass(metaAccess, getSnippetReflection(), className); |
|
211 } catch (UnsupportedClassVersionError e) { |
|
212 // graal-test.jar can contain classes compiled for different |
|
213 // Java versions |
|
214 } catch (NoClassDefFoundError e) { |
|
215 if (!e.getMessage().contains("Could not initialize class")) { |
|
216 throw e; |
|
217 } else { |
|
218 // A second or later attempt to initialize a class |
|
219 // results in this confusing error where the |
|
220 // original cause of initialization failure is lost |
|
221 } |
212 } catch (ClassNotFoundException e) { |
222 } catch (ClassNotFoundException e) { |
213 throw new AssertionError(e); |
223 throw new AssertionError(e); |
214 } |
224 } |
215 } |
225 } |
216 } |
226 } |