< prev index next >

test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 package compiler.jvmci.compilerToVM;
  25 
  26 import compiler.jvmci.common.testcases.MultipleAbstractImplementer;
  27 import compiler.jvmci.common.testcases.MultipleImplementer2;
  28 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
  29 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
  30 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;
  31 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
  32 import java.util.HashMap;
  33 import java.util.Map;


  34 import jdk.vm.ci.meta.MetaAccessProvider;
  35 import jdk.vm.ci.meta.ResolvedJavaMethod;
  36 import jdk.vm.ci.meta.ResolvedJavaType;
  37 import jdk.vm.ci.runtime.JVMCI;
  38 import jdk.internal.misc.SharedSecrets;
  39 import jdk.internal.org.objectweb.asm.Opcodes;
  40 import sun.hotspot.WhiteBox;
  41 import jdk.internal.reflect.ConstantPool;
  42 import jdk.internal.reflect.ConstantPool.Tag;










  43 
  44 /**
  45  * Class contains hard-coded constant pool tables for dummy classes used for
  46  * jdk.vm.ci.hotspot.CompilerToVM constant pool methods
  47  */
  48 public class ConstantPoolTestsHelper {
  49 
  50     public static final int NO_CP_CACHE_PRESENT = Integer.MAX_VALUE;
  51     private static final MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess();
  52 
  53     public enum DummyClasses {
  54         DUMMY_CLASS(MultipleImplementer2.class, CP_MAP_FOR_CLASS),
  55         DUMMY_ABS_CLASS(MultipleAbstractImplementer.class, CP_MAP_FOR_ABS_CLASS),
  56         DUMMY_INTERFACE(MultipleImplementersInterface.class, CP_MAP_FOR_INTERFACE);
  57 
  58         private static final WhiteBox WB = WhiteBox.getWhiteBox();
  59         public final Class<?> klass;
  60         public final ConstantPool constantPoolSS;
  61         public final Map<ConstantTypes, TestedCPEntry[]> testedCP;
  62 




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 package compiler.jvmci.compilerToVM;
  25 
  26 import compiler.jvmci.common.testcases.MultipleAbstractImplementer;
  27 import compiler.jvmci.common.testcases.MultipleImplementer2;
  28 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
  29 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;

  30 import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
  31 import jdk.internal.misc.SharedSecrets;
  32 import jdk.internal.org.objectweb.asm.Opcodes;
  33 import jdk.internal.reflect.ConstantPool;
  34 import jdk.internal.reflect.ConstantPool.Tag;
  35 import jdk.vm.ci.meta.MetaAccessProvider;
  36 import jdk.vm.ci.meta.ResolvedJavaMethod;
  37 import jdk.vm.ci.meta.ResolvedJavaType;
  38 import jdk.vm.ci.runtime.JVMCI;


  39 import sun.hotspot.WhiteBox;
  40 
  41 import java.util.HashMap;
  42 import java.util.Map;
  43 
  44 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS;
  45 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
  46 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
  47 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC;
  48 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE;
  49 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
  50 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE;
  51 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING;
  52 
  53 /**
  54  * Class contains hard-coded constant pool tables for dummy classes used for
  55  * jdk.vm.ci.hotspot.CompilerToVM constant pool methods
  56  */
  57 public class ConstantPoolTestsHelper {
  58 
  59     public static final int NO_CP_CACHE_PRESENT = Integer.MAX_VALUE;
  60     private static final MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess();
  61 
  62     public enum DummyClasses {
  63         DUMMY_CLASS(MultipleImplementer2.class, CP_MAP_FOR_CLASS),
  64         DUMMY_ABS_CLASS(MultipleAbstractImplementer.class, CP_MAP_FOR_ABS_CLASS),
  65         DUMMY_INTERFACE(MultipleImplementersInterface.class, CP_MAP_FOR_INTERFACE);
  66 
  67         private static final WhiteBox WB = WhiteBox.getWhiteBox();
  68         public final Class<?> klass;
  69         public final ConstantPool constantPoolSS;
  70         public final Map<ConstantTypes, TestedCPEntry[]> testedCP;
  71 


< prev index next >