1168 Commits

Author SHA1 Message Date
Ben Gruver
cb5cf3d6c0 Delete the MethodPrototype interface 2012-11-16 22:53:03 -08:00
Ben Gruver
85b3146224 Use final and a private constructor for non-instantiable classes 2012-11-16 22:35:12 -08:00
Ben Gruver
d71c98f6b9 Return the correct register count in ImmutableMethodImplementation 2012-11-12 23:03:18 -08:00
Ben Gruver
2d7e111135 Add sorted interface and immutable implementations 2012-11-12 22:55:06 -08:00
Ben Gruver
ddf2021942 Add @Nonnull for ImmutableListConverter methods 2012-11-12 22:25:15 -08:00
Ben Gruver
60ca2ce0ae Add base implementations of Annotation and AnnotationElement 2012-11-12 22:25:15 -08:00
Ben Gruver
8f14d3641c Make StringReference and TypeReference implement CharSequence 2012-11-12 22:25:11 -08:00
Ben Gruver
c6e54994a7 Use collections of annotations, not lists. 2012-11-12 22:20:39 -08:00
Ben Gruver
07cf2064e6 Fix logic that determine if an immutable list needs to be copied 2012-11-12 22:20:39 -08:00
Ben Gruver
12b970ed4d Use collections instead of lists for variable size "lists" in the dex file
Only things that can be accessed in the dex file in a random access manner
should be exposed as a list. If the list must be read sequentially, it is
exposed in the interface as a Collection if the size is available up-front
or as an Iterable if the size can only be determined by iterating over the
list.
2012-11-12 22:20:33 -08:00
Ben Gruver
65d969c23b Rename VariableSizeIterator to VariableSizeLookaheadIterator
This improves the implementation, and is now used for debug info
2012-11-11 12:49:38 -08:00
Ben Gruver
b26b492fcc Get rid of BaseAnnotation 2012-11-10 21:04:31 -08:00
Ben Gruver
e27e44bee3 Refactor EnumEncodedValue to use a field reference 2012-11-10 17:36:16 -08:00
Ben Gruver
b76e75c8bc Implement hashCode and equals for encoded values 2012-11-10 17:33:28 -08:00
Ben Gruver
ff9eb9fa61 Remove the unnecessary abstract methods from the base reference implementations 2012-11-10 16:21:30 -08:00
Ben Gruver
f7823c4fe1 Add MethodPrototype interface 2012-11-10 16:03:43 -08:00
Ben Gruver
b7b15efc03 Replace BasicMethodParameter with TypeReference 2012-11-10 13:30:07 -08:00
Ben Gruver
f81150ad43 Implement hashCode and equals for references 2012-11-10 13:08:06 -08:00
Ben Gruver
4060490e85 Get rid of old commented code block for methods in ClassDefinition 2012-11-09 23:56:13 -08:00
Ben Gruver
98eede2ce1 Don't write default field values for static final fields that are set in <clinit> 2012-11-09 23:55:15 -08:00
Ben Gruver
60631f684f Detect static final fields that are set in the static initializer 2012-11-09 23:55:12 -08:00
Ben Gruver
987cdc3e0e Sort the classes before disassembling 2012-11-09 22:54:39 -08:00
Ben Gruver
42b6dc3e37 Minor cleanup of synthetic accessor code 2012-11-09 22:34:20 -08:00
Ben Gruver
3563a20427 Fix invalid cast in ImmutableInstruction20t 2012-11-09 21:16:55 -08:00
Ben Gruver
2b8845bb24 Re-implement SyntheticAccessorResolver 2012-11-09 21:16:51 -08:00
Ben Gruver
db389aa3a1 Make ClassDef implement TypeReference 2012-11-04 22:49:36 -08:00
Ben Gruver
b116cb0ac9 Add DexBacked implementations for all instructions 2012-11-04 16:47:20 -08:00
Ben Gruver
f4662586da Clean up imports in dexlib2 2012-11-04 13:56:09 -08:00
Ben Gruver
b0383884fa Add and use ImmutabeleListUtils.nullToEmptyList() 2012-11-04 13:53:41 -08:00
Ben Gruver
a8e05220c1 Refactor how method/field/string/type references are handled 2012-11-04 13:04:21 -08:00
Ben Gruver
c42ffd8dbe Fix the offset calculation for paramater annotations 2012-11-03 18:06:47 -07:00
Ben Gruver
7fe0543b66 Cache the MethodParameters in MethodDefinition 2012-11-03 18:06:47 -07:00
Ben Gruver
6b93c7cc35 Don't precompute the full method string in MethodDefinition 2012-11-03 18:06:47 -07:00
Ben Gruver
d1662b67fe Refactor dexbacked implementations
Made construction of a new dexbacked item as light weight as possible,
only the very mimimum in computed/stored. Some of the values that were
previously calculated/loaded in the constructor are now lazily loaded
upon first use.

In general, nothing is cached, unless the item can't be fully read by
the consumer without causing the value to be computed multiple times.
Otherwise, it is up to the consume to decide if/when/what they want to
cache.
2012-11-03 18:06:41 -07:00
Ben Gruver
8ae711cf3b Get rid of the vestigal commented out code in IndentingWriter 2012-11-03 01:08:04 -07:00
Ben Gruver
dccca459e9 Fix some null issues in the immutable implementation 2012-11-01 22:41:06 -07:00
Ben Gruver
db49fd7714 Use a for instead of foreach loop when iterating over MethodItems
This is measurably faster than the previous version
2012-11-01 21:16:28 -07:00
Ben Gruver
8582095cfb Fix up and improve how parameters are mapped to registers, for local info
This additionally adds the local info for the "this" parameter
2012-11-01 21:14:17 -07:00
Ben Gruver
269c15688b Add the local info for the implicit "this" param
This also fixes some minor issues with using the correct register
for parameter info
2012-11-01 00:16:30 -07:00
Ben Gruver
476e704c86 Use getType to get the annotation type for an annotation encoded value 2012-10-31 22:24:44 -07:00
Ben Gruver
3f3427d0dd Reset annotation iterators for virtual methods/instance fields
The method/field number restarts when we go from direct to virtual methods
and from static to instance fields, so we have to reset the annotation
iterators accordingly
2012-10-31 21:20:12 -07:00
Ben Gruver
09058f9914 Don't forget to intern the switch labels 2012-10-31 20:42:17 -07:00
Ben Gruver
d3dd617d25 Switch key/value in the switch maps 2012-10-31 20:37:39 -07:00
Ben Gruver
4499f63c6c Add a space after the # for .end/.restart local 2012-10-31 20:28:35 -07:00
Ben Gruver
c3a3ee3799 Refactor the writeParameters method a bit
- Accepts a method instead of the parameter list directly
- Uses the correct pN register values for non-static vs. static methods
- Adds a space after the # for the type comment
2012-10-31 20:20:28 -07:00
Ben Gruver
db4316ef6d Add TODO regarding parameter/local names 2012-10-31 19:49:52 -07:00
Ben Gruver
51984fc259 Read the field name index in a field_id_item as a uint 2012-10-31 19:40:55 -07:00
Ben Gruver
c12bbf3a25 Read the element count of a packed switch payload as a ushort 2012-10-31 19:28:45 -07:00
Ben Gruver
1ff61d42de Increment the offset correctly when reading a sized long 2012-10-31 19:28:12 -07:00
Ben Gruver
ebd6178008 Increment the offset correctly when reading a long 2012-10-31 19:27:52 -07:00