Lines Matching defs:in
5 * you may not use this file except in compliance with the License.
10 * Unless required by applicable law or agreed to in writing, software
192 * result in too many bytes wasted, compact the result. To compact,
224 * merged dex file. Populates maps from old to new indices in the process.
251 // Fill in values with the first value of each dex.
273 private int readIntoMap(Dex.Section in, TableOfContents.Section section, IndexMap indexMap,
275 int offset = in != null ? in.getPosition() : -1;
277 T v = read(in, indexMap, index);
290 * sorting in memory.
325 Dex.Section in = source.open(section.off);
327 int offset = in.getPosition();
328 T value = read(in, indexMap, 0);
335 abstract T read(Dex.Section in, IndexMap indexMap, int index);
377 @Override String read(Dex.Section in, IndexMap indexMap, int index) {
378 return in.readString();
399 @Override Integer read(Dex.Section in, IndexMap indexMap, int index) {
400 int stringIndex = in.readInt();
406 throw new DexIndexOverflowException("type ID not in [0, 0xffff]: " + newIndex);
423 @Override TypeList read(Dex.Section in, IndexMap indexMap, int index) {
424 return indexMap.adjustTypeList(in.readTypeList());
443 @Override ProtoId read(Dex.Section in, IndexMap indexMap, int index) {
444 return indexMap.adjust(in.readProtoId());
449 throw new DexIndexOverflowException("proto ID not in [0, 0xffff]: " + newIndex);
466 @Override FieldId read(Dex.Section in, IndexMap indexMap, int index) {
467 return indexMap.adjust(in.readFieldId());
472 throw new DexIndexOverflowException("field ID not in [0, 0xffff]: " + newIndex);
489 @Override MethodId read(Dex.Section in, IndexMap indexMap, int index) {
490 return indexMap.adjust(in.readMethodId());
496 "method ID not in [0, 0xffff]: " + newIndex);
513 @Override Annotation read(Dex.Section in, IndexMap indexMap, int index) {
514 return indexMap.adjust(in.readAnnotation());
533 Dex in = type.getDex();
534 transformClassDef(in, type.getClassDef(), type.getIndexMap());
539 * Returns the union of classes from both files, sorted in order such that
552 * example, the deepest class in libcore is Xalan's KeyIterator, which
617 private void transformAnnotationSets(Dex in, IndexMap indexMap) {
618 TableOfContents.Section section = in.getTableOfContents().annotationSets;
620 Dex.Section setIn = in.open(section.off);
627 private void transformAnnotationSetRefLists(Dex in, IndexMap indexMap) {
628 TableOfContents.Section section = in.getTableOfContents().annotationSetRefLists;
630 Dex.Section setIn = in.open(section.off);
637 private void transformAnnotationDirectories(Dex in, IndexMap indexMap) {
638 TableOfContents.Section section = in.getTableOfContents().annotationsDirectories;
640 Dex.Section directoryIn = in.open(section.off);
647 private void transformStaticValues(Dex in, IndexMap indexMap) {
648 TableOfContents.Section section = in.getTableOfContents().encodedArrays;
650 Dex.Section staticValuesIn = in.open(section.off);
658 * Reads a class_def_item beginning at {@code in} and writes the index and
661 private void transformClassDef(Dex in, ClassDef classDef, IndexMap indexMap) {
679 ClassData classData = in.readClassData(classDef);
680 transformClassData(in, classData, indexMap);
768 private void transformClassData(Dex in, ClassData classData, IndexMap indexMap) {
783 transformMethods(in, indexMap, directMethods);
784 transformMethods(in, indexMap, virtualMethods);
797 private void transformMethods(Dex in, IndexMap indexMap, ClassData.Method[] methods) {
811 transformCode(in, in.readCode(method), indexMap);
816 private void transformCode(Dex in, Code code, IndexMap indexMap) {
831 transformDebugInfoItem(in.open(debugInfoOffset), indexMap);
848 * Unfortunately they're in the opposite order in the dex file so we
892 private void transformDebugInfoItem(Dex.Section in, IndexMap indexMap) {
894 int lineStart = in.readUleb128();
897 int parametersSize = in.readUleb128();
901 int parameterName = in.readUleb128p1();
913 int opcode = in.readByte();
921 addrDiff = in.readUleb128();
926 lineDiff = in.readSleb128();
932 registerNum = in.readUleb128();
934 nameIndex = in.readUleb128p1();
936 typeIndex = in.readUleb128p1();
939 sigIndex = in.readUleb128p1();
946 registerNum = in.readUleb128();
951 nameIndex = in.readUleb128p1();
984 private void transformStaticValues(Dex.Section in, IndexMap indexMap) {
986 indexMap.putStaticValuesOffset(in.getPosition(), encodedArrayOut.getPosition());
987 indexMap.adjustEncodedArray(in.readEncodedArray()).writeTo(encodedArrayOut);
992 * are defined in one of two ways:
1069 // at most 1/4 of the bytes in a code section are uleb/sleb
1071 // at most 2/3 of the bytes in a class data section are uleb/sleb that may change
1074 // all of the bytes in an encoding arrays section may be uleb/sleb
1076 // all of the bytes in an annotations section may be uleb/sleb
1078 // all of the bytes in a debug info section may be uleb/sleb
1128 "If a class is defined in several dex, the class found in the first dex will be used.");