Пример #1
0
  static {
    allTypes = new HashMap<RawType, TypeDef>();
    allMethods = new HashMap<RawMethod, MethodDef>();
    nativeTypes = new HashSet<NativeTypeDef>();

    // We need to ensure that NativeInt, NativeBool etc. are loaded, so that their TYPE
    // objects will be created and eventually added to nativeTypes. We might as well just
    // add them manually, as it guarantees initialization and redundant add's won't hurt.
    NativeTypeDef[] nativeTypesArr = {
      NativeObject.TOP_TYPE,
      NativeBool.TYPE,
      NativeInt.TYPE,
      NativeDouble.TYPE,
      NativeChar.TYPE,
      NativeArray.TYPE,
      NativeConsole.TYPE
    };
    for (NativeTypeDef nativeType : nativeTypesArr) {
      nativeTypes.add(nativeType);
      allTypes.put(nativeType.desc, nativeType);
    }
  }
Пример #2
0
 public static void newType(TypeDef type) {
   // Register the new type.
   allTypes.put(type.desc, type);
   if (type instanceof NativeTypeDef) nativeTypes.add((NativeTypeDef) type);
 }