< prev index next >

buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/StringConstants.java

Print this page




  28 import java.lang.invoke.MethodHandle;
  29 import java.util.ArrayList;
  30 import java.util.Collection;
  31 import java.util.Collections;
  32 import java.util.List;
  33 import jdk.internal.org.objectweb.asm.Type;
  34 
  35 /**
  36  * String constants used for code generation/instrumentation.
  37  */
  38 @SuppressWarnings("javadoc")
  39 public interface StringConstants {
  40     static final String NASHORN_INTERNAL = "jdk/nashorn/internal/";
  41     static final String OBJ_PKG = NASHORN_INTERNAL + "objects/";
  42     static final String OBJ_ANNO_PKG = OBJ_PKG + "annotations/";
  43     static final String RUNTIME_PKG = NASHORN_INTERNAL + "runtime/";
  44     static final String SCRIPTS_PKG = NASHORN_INTERNAL + "scripts/";
  45 
  46     // standard jdk types, methods
  47     static final Type TYPE_METHODHANDLE         = Type.getType(MethodHandle.class);
  48     static final Type TYPE_METHODHANDLE_ARRAY   = Type.getType(MethodHandle[].class);
  49     static final Type TYPE_SPECIALIZATION       = Type.getType("L" + RUNTIME_PKG + "Specialization;");
  50     static final Type TYPE_SPECIALIZATION_ARRAY = Type.getType("[L" + RUNTIME_PKG + "Specialization;");
  51     static final Type TYPE_OBJECT               = Type.getType(Object.class);
  52     static final Type TYPE_STRING               = Type.getType(String.class);
  53     static final Type TYPE_CLASS                = Type.getType(Class.class);
  54     static final Type TYPE_COLLECTION           = Type.getType(Collection.class);
  55     static final Type TYPE_COLLECTIONS          = Type.getType(Collections.class);
  56     static final Type TYPE_ARRAYLIST            = Type.getType(ArrayList.class);
  57     static final Type TYPE_LIST                 = Type.getType(List.class);
  58 
  59     static final String CLINIT = "<clinit>";
  60     static final String INIT = "<init>";
  61     static final String DEFAULT_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE);
  62 
  63     static final String METHODHANDLE_TYPE = TYPE_METHODHANDLE.getInternalName();
  64     static final String SPECIALIZATION_TYPE = TYPE_SPECIALIZATION.getInternalName();
  65     static final String SPECIALIZATION_INIT2 = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_METHODHANDLE, Type.getType(boolean.class));
  66     static final String SPECIALIZATION_INIT3 = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_METHODHANDLE, TYPE_CLASS, Type.getType(boolean.class));
  67     static final String OBJECT_TYPE = TYPE_OBJECT.getInternalName();
  68     static final String OBJECT_DESC = TYPE_OBJECT.getDescriptor();
  69     static final String STRING_TYPE = TYPE_STRING.getInternalName();
  70     static final String STRING_DESC = TYPE_STRING.getDescriptor();
  71     static final String OBJECT_ARRAY_DESC = Type.getDescriptor(Object[].class);
  72     static final String ARRAYLIST_TYPE = TYPE_ARRAYLIST.getInternalName();
  73     static final String COLLECTION_TYPE = TYPE_COLLECTION.getInternalName();
  74     static final String COLLECTIONS_TYPE = TYPE_COLLECTIONS.getInternalName();
  75 
  76     // java.util.Collection.add(Object)
  77     static final String COLLECTION_ADD = "add";
  78     static final String COLLECTION_ADD_DESC = Type.getMethodDescriptor(Type.BOOLEAN_TYPE, TYPE_OBJECT);
  79     // java.util.ArrayList.<init>(int)
  80     static final String ARRAYLIST_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE);
  81     // java.util.Collections.EMPTY_LIST
  82     static final String COLLECTIONS_EMPTY_LIST = "EMPTY_LIST";
  83     static final String LIST_DESC = TYPE_LIST.getDescriptor();
  84 
  85     // Nashorn types, methods
  86     static final Type TYPE_ACCESSORPROPERTY   = Type.getType("L" + RUNTIME_PKG + "AccessorProperty;");
  87     static final Type TYPE_PROPERTYMAP        = Type.getType("L" + RUNTIME_PKG + "PropertyMap;");
  88     static final Type TYPE_PROTOTYPEOBJECT    = Type.getType("L" + RUNTIME_PKG + "PrototypeObject;");
  89     static final Type TYPE_SCRIPTFUNCTION     = Type.getType("L" + RUNTIME_PKG + "ScriptFunction;");




  28 import java.lang.invoke.MethodHandle;
  29 import java.util.ArrayList;
  30 import java.util.Collection;
  31 import java.util.Collections;
  32 import java.util.List;
  33 import jdk.internal.org.objectweb.asm.Type;
  34 
  35 /**
  36  * String constants used for code generation/instrumentation.
  37  */
  38 @SuppressWarnings("javadoc")
  39 public interface StringConstants {
  40     static final String NASHORN_INTERNAL = "jdk/nashorn/internal/";
  41     static final String OBJ_PKG = NASHORN_INTERNAL + "objects/";
  42     static final String OBJ_ANNO_PKG = OBJ_PKG + "annotations/";
  43     static final String RUNTIME_PKG = NASHORN_INTERNAL + "runtime/";
  44     static final String SCRIPTS_PKG = NASHORN_INTERNAL + "scripts/";
  45 
  46     // standard jdk types, methods
  47     static final Type TYPE_METHODHANDLE         = Type.getType(MethodHandle.class);

  48     static final Type TYPE_SPECIALIZATION       = Type.getType("L" + RUNTIME_PKG + "Specialization;");
  49     static final Type TYPE_SPECIALIZATION_ARRAY = Type.getType("[L" + RUNTIME_PKG + "Specialization;");
  50     static final Type TYPE_OBJECT               = Type.getType(Object.class);
  51     static final Type TYPE_STRING               = Type.getType(String.class);
  52     static final Type TYPE_CLASS                = Type.getType(Class.class);
  53     static final Type TYPE_COLLECTION           = Type.getType(Collection.class);
  54     static final Type TYPE_COLLECTIONS          = Type.getType(Collections.class);
  55     static final Type TYPE_ARRAYLIST            = Type.getType(ArrayList.class);
  56     static final Type TYPE_LIST                 = Type.getType(List.class);
  57 
  58     static final String CLINIT = "<clinit>";
  59     static final String INIT = "<init>";
  60     static final String DEFAULT_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE);
  61 

  62     static final String SPECIALIZATION_TYPE = TYPE_SPECIALIZATION.getInternalName();
  63     static final String SPECIALIZATION_INIT2 = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_METHODHANDLE, Type.BOOLEAN_TYPE, Type.BOOLEAN_TYPE);
  64     static final String SPECIALIZATION_INIT3 = Type.getMethodDescriptor(Type.VOID_TYPE, TYPE_METHODHANDLE, TYPE_CLASS, Type.BOOLEAN_TYPE, Type.BOOLEAN_TYPE);
  65     static final String OBJECT_TYPE = TYPE_OBJECT.getInternalName();
  66     static final String OBJECT_DESC = TYPE_OBJECT.getDescriptor();

  67     static final String STRING_DESC = TYPE_STRING.getDescriptor();
  68     static final String OBJECT_ARRAY_DESC = Type.getDescriptor(Object[].class);
  69     static final String ARRAYLIST_TYPE = TYPE_ARRAYLIST.getInternalName();
  70     static final String COLLECTION_TYPE = TYPE_COLLECTION.getInternalName();
  71     static final String COLLECTIONS_TYPE = TYPE_COLLECTIONS.getInternalName();
  72 
  73     // java.util.Collection.add(Object)
  74     static final String COLLECTION_ADD = "add";
  75     static final String COLLECTION_ADD_DESC = Type.getMethodDescriptor(Type.BOOLEAN_TYPE, TYPE_OBJECT);
  76     // java.util.ArrayList.<init>(int)
  77     static final String ARRAYLIST_INIT_DESC = Type.getMethodDescriptor(Type.VOID_TYPE, Type.INT_TYPE);
  78     // java.util.Collections.EMPTY_LIST
  79     static final String COLLECTIONS_EMPTY_LIST = "EMPTY_LIST";
  80     static final String LIST_DESC = TYPE_LIST.getDescriptor();
  81 
  82     // Nashorn types, methods
  83     static final Type TYPE_ACCESSORPROPERTY   = Type.getType("L" + RUNTIME_PKG + "AccessorProperty;");
  84     static final Type TYPE_PROPERTYMAP        = Type.getType("L" + RUNTIME_PKG + "PropertyMap;");
  85     static final Type TYPE_PROTOTYPEOBJECT    = Type.getType("L" + RUNTIME_PKG + "PrototypeObject;");
  86     static final Type TYPE_SCRIPTFUNCTION     = Type.getType("L" + RUNTIME_PKG + "ScriptFunction;");


< prev index next >