< prev index next >

test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 
  25 package compiler.jvmci.compilerToVM;
  26 
  27 import java.util.HashMap;
  28 import java.util.Map;

  29 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
  30 import jdk.vm.ci.meta.ResolvedJavaMethod;
  31 import sun.hotspot.WhiteBox;
  32 import jdk.internal.reflect.ConstantPool;
  33 import jdk.internal.reflect.ConstantPool.Tag;
  34 import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
  35 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*;















  36 
  37 /**
  38  * Common class for jdk.vm.ci.hotspot.CompilerToVM constant pool tests
  39  */
  40 public class ConstantPoolTestCase {
  41 
  42     private static final Map<Tag, ConstantTypes> TAG_TO_TYPE_MAP;
  43     static {
  44         TAG_TO_TYPE_MAP = new HashMap<>();
  45         TAG_TO_TYPE_MAP.put(Tag.CLASS, CONSTANT_CLASS);
  46         TAG_TO_TYPE_MAP.put(Tag.FIELDREF, CONSTANT_FIELDREF);
  47         TAG_TO_TYPE_MAP.put(Tag.METHODREF, CONSTANT_METHODREF);
  48         TAG_TO_TYPE_MAP.put(Tag.INTERFACEMETHODREF, CONSTANT_INTERFACEMETHODREF);
  49         TAG_TO_TYPE_MAP.put(Tag.STRING, CONSTANT_STRING);
  50         TAG_TO_TYPE_MAP.put(Tag.INTEGER, CONSTANT_INTEGER);
  51         TAG_TO_TYPE_MAP.put(Tag.FLOAT, CONSTANT_FLOAT);
  52         TAG_TO_TYPE_MAP.put(Tag.LONG, CONSTANT_LONG);
  53         TAG_TO_TYPE_MAP.put(Tag.DOUBLE, CONSTANT_DOUBLE);
  54         TAG_TO_TYPE_MAP.put(Tag.NAMEANDTYPE, CONSTANT_NAMEANDTYPE);
  55         TAG_TO_TYPE_MAP.put(Tag.UTF8, CONSTANT_UTF8);




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 
  25 package compiler.jvmci.compilerToVM;
  26 
  27 import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses;
  28 import jdk.internal.reflect.ConstantPool;
  29 import jdk.internal.reflect.ConstantPool.Tag;
  30 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
  31 import jdk.vm.ci.meta.ResolvedJavaMethod;
  32 import sun.hotspot.WhiteBox;
  33 
  34 import java.util.HashMap;
  35 import java.util.Map;
  36 
  37 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS;
  38 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_DOUBLE;
  39 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF;
  40 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FLOAT;
  41 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTEGER;
  42 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF;
  43 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVALID;
  44 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC;
  45 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_LONG;
  46 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE;
  47 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF;
  48 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE;
  49 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_NAMEANDTYPE;
  50 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING;
  51 import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_UTF8;
  52 
  53 /**
  54  * Common class for jdk.vm.ci.hotspot.CompilerToVM constant pool tests
  55  */
  56 public class ConstantPoolTestCase {
  57 
  58     private static final Map<Tag, ConstantTypes> TAG_TO_TYPE_MAP;
  59     static {
  60         TAG_TO_TYPE_MAP = new HashMap<>();
  61         TAG_TO_TYPE_MAP.put(Tag.CLASS, CONSTANT_CLASS);
  62         TAG_TO_TYPE_MAP.put(Tag.FIELDREF, CONSTANT_FIELDREF);
  63         TAG_TO_TYPE_MAP.put(Tag.METHODREF, CONSTANT_METHODREF);
  64         TAG_TO_TYPE_MAP.put(Tag.INTERFACEMETHODREF, CONSTANT_INTERFACEMETHODREF);
  65         TAG_TO_TYPE_MAP.put(Tag.STRING, CONSTANT_STRING);
  66         TAG_TO_TYPE_MAP.put(Tag.INTEGER, CONSTANT_INTEGER);
  67         TAG_TO_TYPE_MAP.put(Tag.FLOAT, CONSTANT_FLOAT);
  68         TAG_TO_TYPE_MAP.put(Tag.LONG, CONSTANT_LONG);
  69         TAG_TO_TYPE_MAP.put(Tag.DOUBLE, CONSTANT_DOUBLE);
  70         TAG_TO_TYPE_MAP.put(Tag.NAMEANDTYPE, CONSTANT_NAMEANDTYPE);
  71         TAG_TO_TYPE_MAP.put(Tag.UTF8, CONSTANT_UTF8);


< prev index next >