summaryrefslogtreecommitdiffstats
path: root/opcode-gen
Commit message (Collapse)AuthorAgeFilesLines
* Remove unsupported experimental opcodes.Elliott Hughes2012-01-052-80/+8
| | | | | | | External developers were starting to try to get themselves into trouble with this stuff... Change-Id: I2b03bfeaa8c98b6a994bc7924fc8dcf4e4d4f6cb
* Tweaks for C++ compilation.Dan Bornstein2011-04-191-2/+2
| | | | Change-Id: I6ac0ffe4941c6d655025a0738413b60b636400a9
* Move finalization out of the VM.Carl Shapiro2011-03-211-9/+2
| | | | | | | | | This change introduces a new reference class whose referent points to instances requiring finalization. This makes the finalization of objects possible using a reference queue and a dedicated thread which removes objects from the queue. Change-Id: I0ff6dd272f00ca08c6ed3aa667bf766a039a944e
* Add volatile/jumbo opcodesAndy McFadden2011-03-101-2/+17
| | | | | | | | | | | | | | | This adds 12 dexopt-generated "volatile/jumbo" instructions, to be used for replacing appropriate get/put ops, plus a jumbo replacement for invoke-object-init/range. The new instructions are defined but not yet used. For x86 and x86-atom, C stubs are selected. Also, guarded macro args used in arithmetic expressions in header.S. Bug 3403118 Change-Id: I283cea053d1cee1d70c3715df3e71177e8b8d3b2
* Change invoke-object-init to /range formAndy McFadden2011-03-021-1/+1
| | | | | | | | | | | The invoke-object-init instruction pretends to be a regular invoke that only knows how to call Object.<init>. As such it always takes one argument, and if we use the /range version we can specify the "this" register with 16 bits instead of only 4. Bug 3486699 Change-Id: I9ee4700c6935beee1dcbaa583b57befd33641414
* Rename invoke-direct-empty to invoke-object-initAndy McFadden2011-02-111-6/+5
| | | | | | | | | | | | | | The invoke-direct-empty instruction was introduced to remove the overhead of calling the empty Object constructor. We now need it to do some extra work on behalf of object construction, so it's appropriate to change the instruction name to match the role it fills rather than the more general role it was hoped to fill. No functional changes. Bug 3342343 Change-Id: I65dd6a2c00c99581c9a19b16fe193b70642c8fbb
* CodeReader visitor dispatch now uses OpcodeInfo.Dan Bornstein2011-02-021-9/+3
| | | | | | | | | | | | This gets rid of the per-opcode Instruction array and just does a simple switch. If it turns out that the switch has poor performance, we can push the visitor abstraction down into IndexType. The big change to OpcodeInfo is to make every Info instance always have a non-null IndexType, exactly so it could be reliably switch()ed on without having to do an explicit null check. Change-Id: Iee8289f8766ce41c5043eec7212b2133ec71e682
* Move opcode names into OpcodeInfo.Dan Bornstein2011-02-021-5/+4
| | | | | | | | | This also allowed me to remove the Instruction argument from the CodeReader visitor methods. Per previous discussion, this also gets rid of the redundant argument output in FindUsages. I can clean up CodeReader some more in a follow-up. Change-Id: I7a65e8d74498e201fd169cddde0d1f19d6f33f81
* Move dx.dex.code.DalvOps -> dx.io.Opcodes.Dan Bornstein2011-01-302-5/+5
| | | | | | | | | This breaks a nascent circular dependency, keeping dx.io the lower layer. Bonus: While I was in the territory, I clarified the data payload opcodes, including adding explicit constants for them. Change-Id: I8655064ebc3b5713cbb4a6c83bcc90984393701f
* Basic facility to read/write bytecode.Dan Bornstein2011-01-302-1/+24
| | | | | | | | | | | | | | These classes are meant for reading and writing bytecode at the lowest possible level, in particular without layering any interpretation of the instructions beyond understanding the instruction formats. (For example, constant indices remain numbers and aren't tied to objects representing constants.) This patch represents a work-in-progress that compiles but is as yet not hooked up to anything else. Hooking it all up will happen in one or more follow-on patches. Change-Id: Ifd3b3ff0925dc9dc3d82e507dc1be83cb560031d
* Added vm support for new jumbo opcodes.jeffhao2011-01-071-1/+0
| | | | | | | | | This enables jumbo opcodes by default, and they will get used by the current build without modification. Support has been added for arm, x86, and the portable interpreter. x86-atom support is on the TODO list. This commit also includes a test for the new jumbo opcodes. Change-Id: Ic3f1b41b51645861c5196f76aaf0e96e727ea537
* New jumbo verification error opcode.Dan Bornstein2010-12-101-1/+9
| | | | | | I'll regenerate the vm code for this in a follow-up change. Change-Id: I59a0a91d39fd539f1b3a25f1f2889618fa484b96
* Minor simplification.Dan Bornstein2010-12-031-10/+8
| | | | Change-Id: Ie17ba83ead45028a8b7b32c1cc5763f9dd6d684c
* Fix stupid copy-paste error.Dan Bornstein2010-12-031-2/+2
| | | | Change-Id: I1ad1e8c26ec47b9b148fc6a4292afa2ee25e58e2
* Another clarifying rename and a bit more automation.Dan Bornstein2010-12-031-0/+7
| | | | | | | | kNumDalvikInstructions is now kNumPackedOpcodes, there is a new kMaxOpcodeValue, and both are generated by opcode-gen. Change-Id: Ic46f1f52d2d21382452c8e777024f4a985ad31d3 Bonus: Reworded the switch and array data comment for clarity.
* Regular-expression compatibility.Dan Bornstein2010-12-031-2/+2
| | | | | | | | The most compatible way of indicating that a dash is part of a character range is to put a single dash at the end of the range expression. Change-Id: I1e118038dfacffbc004c97be0ae1c3dfe97e861d
* Small fixes.Dan Bornstein2010-12-031-1/+2
| | | | | | | I had unpackOpcode() slightly wrong, and I made the libcore opcode numbers always be four hex digits. Change-Id: I4f988b8794b4b6c48ef91698a8e567fa46b96dac
* Clean up the opcode-gen script.Dan Bornstein2010-12-032-75/+88
| | | | | | | There was way too much string duplication, and it needed at least a bit more commenting. Change-Id: Id31ee1fd260db6f4afe301764c60de7c63b3f729
* Inching closer to having extended opcodes in the vm.Dan Bornstein2010-12-021-66/+94
| | | | Change-Id: If6578a0686ac8fe5e6d1a26509d8a5c748bed179
* Give the awk script its own file.Dan Bornstein2010-12-022-485/+496
| | | | | | | | The embedded awk script totally dwarfed the shell script driver. It was getting pretty ridiculous. (Ok ok, maybe the fact that this uses awk in the first place is itself ridiculous.) Change-Id: Ia53dbbff636eab7aeb44ff24013c62494ef86da0
* Rename OpCodeNames.c -> DexOpcodes.c.Dan Bornstein2010-12-011-1/+1
| | | | Change-Id: I9e22543740129f4a8fd50ff246a165d6358ed9b5
* Rename OpCode.h -> DexOpcodes.h.Dan Bornstein2010-12-012-2/+2
| | | | | | | | Also incorporate the former contents of OpCodeNames.h. This is a small attempt to increase naming consistency in libdex. There will be a bit more to come, in a follow-up. Change-Id: Ia7ab06042dde2e19eda02ef1fee72fb4260e899d
* Add more "extended opcode" structure to libdex.Dan Bornstein2010-12-011-0/+11
| | | | | | | | | | | | | | | | Although we don't yet generate any of the extended opcodes, this change makes it a bit easier to add them. In particular, we now differentiate between the raw opcode in a code unit and an associated "packed opcode number." The packed opcode space is densely populated in the range 0x000-0x1ff (though there will still be a few unused slots), whereas the raw opcode values are sparse throughout the range 0x0000-0xffff. The OpCode enum is redefined/clarified to have packed, not sparse, opcode values. Change-Id: Ie3208a258648fbf044d344646f66c49ad24c31b2
* Bring 00x and 20bc into the fold.Dan Bornstein2010-11-301-2/+2
| | | | Change-Id: I12fde7eb665c9f3b75684018457f9464b0990156
* Explain a bit.Dan Bornstein2010-11-301-3/+20
| | | | Change-Id: I845f34924249b6c5f34ad9ef7b9ebd3bc44f1aac
* invoke-direct-empty doesn't actually invoke anything.Dan Bornstein2010-11-301-2/+5
| | | | | | | Update bytecode.txt as well as a couple bits in the JIT in recognition of this fact. Change-Id: I989556d39b40a879021eaf841404e015076073be
* Clean up the opcode maintenance instructions.Dan Bornstein2010-11-301-0/+74
| | | | Change-Id: Ic9d7fcfd234116099ef510e4339a9af0bc3fcb1d
* Code to generate libcore's Dalvik opcode code.Dan Bornstein2010-11-292-0/+29
| | | | | | That was a mouthful. Change-Id: I49152fdacbfa9593e7a95f5c120fea023b06d03b
* Generate the tables in InstrUtils.c...almost.Dan Bornstein2010-11-173-21/+93
| | | | | | | | | | | | | This patch adds code to opcode-gen to generate the opcode info tables currently built at vm start time, but they are left commented out for now. I wanted to separate the work of getting these tables generated from the work of getting those new tables hooked up, and this seemed like a reasonable way to cut through the larger effort. To be clear, I've already verified that the data in the new pregenerated tables matches what's in the status quo. Change-Id: Ie73dc6c6a5721e8f714f845c97b5338141995770
* Generate the contents of OpCodeNames.c.Dan Bornstein2010-11-163-308/+333
| | | | | | | | | | | This was another one that was pretty easy to add to opcode-gen. I did end up tweaking opcode-gen to make it obvious that the two forms of name are different by more than just upper vs. lower case, especially because I duplicated the original distinction of the optimized opcodes having extra prefix characters in their human-oriented names but not in the names when used as programming constants. Change-Id: I5062442540d26318914964bd2722cc32380b19ca
* Generate most of OpCode.h using opcode-gen.Dan Bornstein2010-11-162-3/+40
| | | | | | This was the easiest bit to tackle in libdex. More to come! Change-Id: I3f79039ce98951d694d2c896ee1c7a60b417bc49
* Promote opcode-gen to the dalvik directory.Dan Bornstein2010-11-163-0/+791
This tool will soon be used to generate code in libdex, so it doesn't make sense for it to live in the dx directory. Change-Id: I63ff7ccceac08fbe314fb0782dc8f2b5d75d155a