25 package compiler.jvmci.compilerToVM; |
25 package compiler.jvmci.compilerToVM; |
26 |
26 |
27 import java.util.HashMap; |
27 import java.util.HashMap; |
28 import java.util.Map; |
28 import java.util.Map; |
29 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; |
29 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; |
|
30 import jdk.vm.ci.meta.ResolvedJavaMethod; |
30 import sun.hotspot.WhiteBox; |
31 import sun.hotspot.WhiteBox; |
31 import jdk.internal.reflect.ConstantPool; |
32 import jdk.internal.reflect.ConstantPool; |
32 import jdk.internal.reflect.ConstantPool.Tag; |
33 import jdk.internal.reflect.ConstantPool.Tag; |
33 import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; |
34 import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; |
34 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; |
35 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; |
182 |
183 |
183 public static class TestedCPEntry { |
184 public static class TestedCPEntry { |
184 public final String klass; |
185 public final String klass; |
185 public final String name; |
186 public final String name; |
186 public final String type; |
187 public final String type; |
|
188 public final ResolvedJavaMethod[] methods; |
187 public final byte[] opcodes; |
189 public final byte[] opcodes; |
188 public final long accFlags; |
190 public final long accFlags; |
189 |
191 |
190 public TestedCPEntry(String klass, String name, String type, byte[] opcodes, long accFlags) { |
192 public TestedCPEntry(String klass, String name, String type, byte[] opcodes, long accFlags) { |
|
193 this(klass, name, type, null, opcodes, accFlags); |
|
194 } |
|
195 |
|
196 public TestedCPEntry(String klass, String name, String type, ResolvedJavaMethod[] methods, byte[] opcodes, long accFlags) { |
191 this.klass = klass; |
197 this.klass = klass; |
192 this.name = name; |
198 this.name = name; |
193 this.type = type; |
199 this.type = type; |
|
200 if (methods != null) { |
|
201 this.methods = new ResolvedJavaMethod[methods.length]; |
|
202 System.arraycopy(methods, 0, this.methods, 0, methods.length); |
|
203 } else { |
|
204 this.methods = null; |
|
205 } |
194 if (opcodes != null) { |
206 if (opcodes != null) { |
195 this.opcodes = new byte[opcodes.length]; |
207 this.opcodes = new byte[opcodes.length]; |
196 System.arraycopy(opcodes, 0, this.opcodes, 0, opcodes.length); |
208 System.arraycopy(opcodes, 0, this.opcodes, 0, opcodes.length); |
197 } else { |
209 } else { |
198 this.opcodes = null; |
210 this.opcodes = null; |