/** * Helper method to allow easier "inline" retrieval of of the list of TypeIdItems * @param typeListItem the typeListItem to return the types of (can be null) * @return an array of the <code>TypeIdItems</code> in the specified <code>TypeListItem</code>, or null if the * TypeListItem is null */ public static List<TypeIdItem> getTypes(TypeListItem typeListItem) { return typeListItem==null?null:typeListItem.getTypes(); }
private String[] loadInterfaces(ClassDefItem classDefItem) { TypeListItem typeList = classDefItem.getInterfaces(); if (typeList != null) { List<TypeIdItem> types = typeList.getTypes(); if (types != null && types.size() > 0) { String[] interfaces = new String[types.size()]; for (int i=0; i<interfaces.length; i++) { interfaces[i] = types.get(i).getTypeDescriptor(); } return interfaces; } } return null; }
private void placeClass(ClassDefItem classDefItem) { if (classDefItem.getOffset() == -1) { TypeIdItem superType = classDefItem.superType; ClassDefItem superClassDefItem = unplacedClassDefsByType.get(superType); if (superClassDefItem != null) { placeClass(superClassDefItem); } TypeListItem interfaces = classDefItem.implementedInterfaces; if (interfaces != null) { for (TypeIdItem interfaceType: interfaces.getTypes()) { ClassDefItem interfaceClass = unplacedClassDefsByType.get(interfaceType); if (interfaceClass != null) { placeClass(interfaceClass); } } } currentOffset = classDefItem.placeAt(currentOffset, currentIndex++); unplacedClassDefsByType.remove(classDefItem.classType); } } }
private static RegisterType[] getParameterTypes(TypeListItem typeListItem, int parameterRegisterCount) { assert typeListItem != null; assert parameterRegisterCount == typeListItem.getRegisterCount(); RegisterType[] registerTypes = new RegisterType[parameterRegisterCount]; int registerNum = 0; for (TypeIdItem type: typeListItem.getTypes()) { if (type.getRegisterCount() == 2) { registerTypes[registerNum++] = RegisterType.getWideRegisterTypeForTypeIdItem(type, true); registerTypes[registerNum++] = RegisterType.getWideRegisterTypeForTypeIdItem(type, false); } else { registerTypes[registerNum++] = RegisterType.getRegisterTypeForTypeIdItem(type); } } return registerTypes; }
List<TypeIdItem> parameterTypes = typeListItem.getTypes(); int parameterTypeIndex = 0; while (!registers.pastEnd()) {
/** * Helper method to allow easier "inline" retrieval of of the list of TypeIdItems * @param typeListItem the typeListItem to return the types of (can be null) * @return an array of the <code>TypeIdItems</code> in the specified <code>TypeListItem</code>, or null if the * TypeListItem is null */ public static List<TypeIdItem> getTypes(TypeListItem typeListItem) { return typeListItem==null?null:typeListItem.getTypes(); }
private String[] loadInterfaces(ClassDefItem classDefItem) { TypeListItem typeList = classDefItem.getInterfaces(); if (typeList != null) { List<TypeIdItem> types = typeList.getTypes(); if (types != null && types.size() > 0) { String[] interfaces = new String[types.size()]; for (int i=0; i<interfaces.length; i++) { interfaces[i] = types.get(i).getTypeDescriptor(); } return interfaces; } } return null; }
private void placeClass(ClassDefItem classDefItem) { if (!classDefItem.isPlaced()) { TypeIdItem superType = classDefItem.superType; ClassDefItem superClassDefItem = unplacedClassDefsByType.get(superType); if (superClassDefItem != null) { placeClass(superClassDefItem); } TypeListItem interfaces = classDefItem.implementedInterfaces; if (interfaces != null) { for (TypeIdItem interfaceType: interfaces.getTypes()) { ClassDefItem interfaceClass = unplacedClassDefsByType.get(interfaceType); if (interfaceClass != null) { placeClass(interfaceClass); } } } currentOffset = classDefItem.placeAt(currentOffset, currentIndex++); unplacedClassDefsByType.remove(classDefItem.classType); } } }
private static RegisterType[] getParameterTypes(TypeListItem typeListItem, int parameterRegisterCount) { assert typeListItem != null; assert parameterRegisterCount == typeListItem.getRegisterCount(); RegisterType[] registerTypes = new RegisterType[parameterRegisterCount]; int registerNum = 0; for (TypeIdItem type: typeListItem.getTypes()) { if (type.getRegisterCount() == 2) { registerTypes[registerNum++] = RegisterType.getWideRegisterTypeForTypeIdItem(type, true); registerTypes[registerNum++] = RegisterType.getWideRegisterTypeForTypeIdItem(type, false); } else { registerTypes[registerNum++] = RegisterType.getRegisterTypeForTypeIdItem(type); } } return registerTypes; }