summaryrefslogtreecommitdiffstats
path: root/libdex/DexFile.c
Commit message (Collapse)AuthorAgeFilesLines
* Compile libdex as C++.Dan Bornstein2011-04-141-551/+0
| | | | | | The major-looking code changes were all just to unravel some gotos. Change-Id: I86f98a48b160f357ce93c87446bad5d705d5f05b
* Clarify a comment.Dan Bornstein2011-03-111-0/+1
| | | | | | Per suggestion during code review of previous patch. Change-Id: I9bf88d3127f32036c1668ad03ffc491947a4f696
* Clean up how primitive types are handled.Dan Bornstein2011-03-111-0/+56
| | | | | | | | | | | | | | | | | | | | | | | The PrimitiveType enum got "promoted" to libdex, and I added a few helper functions there. I also quashed the idea that there is some sort of canonical ordering of the enumerated values. In the vm (per se), I made PrimitiveType uses where it had assumed an ordering instead switch(). This mostly made things much simpler. I also split out the array of type classes in Globals.h into individual ClassObject*s. This mostly made things simpler, but the gc got a tiny bit of extra cruft because of it. Finally, I made it so that the type classes get created explicitly during vm startup, instead of happening implicitly the first time they're accessed. This both simplified the code and, in particular, made it so that the type classes didn't have to be declared volatile. There are still a couple of related items that could stand to be cleaned up, but I think what's here is enough for one patch. Change-Id: Id14a6dfdb200abce9f30911c330ba32d9c2a4c3f
* A bit of libdex spring cleaning.Dan Bornstein2011-03-091-595/+11
| | | | | | | | | Give the UTF-8 parsing/validation code and the debug info decoder their own files in libdex. Also, moved the random utility dexRoundUpPower2() so it wasn't in the middle of unrelated stuff (though maybe it doesn't want to stay in DexFile.c at all). Change-Id: I115447e49904e2440dd538b1df90616ea95707a9
* Better class name validation.Dan Bornstein2011-03-091-39/+85
| | | | | | | | | | | | I made a combined class name / type descriptor validator in libdex extracted from the original type descriptor validator, made the original validator use that, and added another public function to do class name validation. The two not-quite-validators in CheckJNI.c and InternalNative.c now do proper checking. Change-Id: I0f25e3efb439da065d92596197d219792d5a46b1
* Split out the optimized dex file handling into its own file.Dan Bornstein2010-08-311-273/+3
| | | | | | | Also, make the optimized dex data area be consistently referred to as the "opt" section instead of sometimes the "aux" section. Change-Id: Id5589c13ce4b53d713f8186314ea886cd884c865
* Add a little bit of paranoia to the odex data reader.Dan Bornstein2010-08-171-22/+68
| | | | | | | | This prevents some potential segfaults when working with (e.g., trying to run) corrupted dex files, turning them into more informative error messages. Change-Id: Ie6845087bb17a5f65fafbd6f9ff335b6af489996
* Remove repeated newlines at the end of files.Carl Shapiro2010-06-081-1/+0
| | | | Change-Id: I1e3d103a7b932ef21acedb6438c0f26b315df28f
* Remove trailing whitespace.Carl Shapiro2010-06-081-19/+19
| | | | Change-Id: I95534bb2b88eaf48f2329282041118cd034c812b
* Added additional DEX checksum.Andy McFadden2009-12-031-6/+36
| | | | | | | | | | | | | | We have a checksum on the base DEX data, but not on the stuff that dexopt appends. If a flash block goes "funny" we might not be able to detect the problem. This change adds a checksum field to the "optimized" header. The new checksum is verified under the same circumstances as the base DEX checksum: when you use "dexdump", and when you enable additional checking with -Xcheckdexsum (or the property dalvik.vm.check-dex-sum is set to "true"). For bug 2255640.
* Defer reporting of certain verifier failures.Andy McFadden2009-05-181-0/+40
| | | | | | | | | | | | | | | | | | | | | | The verifier currently reports all failures immediately. Certain failures, such as the failure to resolve a method, or the determination that access to a field is not allowed, are supposed to deferred until the first time that executing code does something that could cause the resolution. With this change, several kinds of verification failures are deferred. This is done by making a writable copy of the bytecode and replacing the failing instruction with an "always throw" opcode. Gory details: - Added throw-verification-error instruction. Implemented in "portable" and ARM interpreters. x86 uses portable form through stub. - Added a function that creates a copy of a DexCode area and makes the bytecodes writable. - Added code that replaces a single instruction with an "always throw". - Replaced runtime check for abstract/interface in new-instance with a check at verification time. - Added a test to exercise the deferred error mechanism. - Minor cleanups (replaced tab, bad valgrind command, ...).
* auto import //branches/master/...@140412The Android Open Source Project2009-03-181-0/+4
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+1183
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-1183/+0
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-16/+36
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-20/+224
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+959