summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-11-13 21:42:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-11-13 21:42:09 (GMT)
commit760e2e7346518dd1264126c1696f9ad88884d64c (patch)
tree4912592877b204d9d7765acd7c04dae65a764027
parent866993263387f96ebe2e482d63c9c4225e2c6085 (diff)
Optimized the decoding of Dalvik opcodes.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@284 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
-rw-r--r--ChangeLog5
-rw-r--r--src/arch/dalvik/instruction.c10
2 files changed, 6 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d4df40..3153a68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
12-11-13 Cyrille Bagard <nocbos@gmail.com>
* src/arch/dalvik/instruction.c:
+ Optimize the decoding of Dalvik opcodes.
+
+12-11-13 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/arch/dalvik/instruction.c:
Add links for 'goto' instructions too.
* src/gtkext/graph/dot.c:
diff --git a/src/arch/dalvik/instruction.c b/src/arch/dalvik/instruction.c
index 065c67a..f0e679f 100644
--- a/src/arch/dalvik/instruction.c
+++ b/src/arch/dalvik/instruction.c
@@ -446,16 +446,8 @@ DalvikOpcodes g_dalvik_instruction_get_opcode(const GDalvikInstruction *instr)
DalvikOpcodes dalvik_guess_next_instruction(const bin_t *data, off_t pos, off_t len)
{
DalvikOpcodes result; /* Identifiant à retourner */
- bin_t opcode; /* Opcode à trouver */
- opcode = data[pos];
-
- for (result = 0; result < DOP_COUNT; result++)
- {
- if (_instructions[result].opcode == opcode)
- break;
-
- }
+ result = (DalvikOpcodes)data[pos];
/* Si l'instruction est marquée comme non utilisée... */
if (_instructions[result].keyword == NULL)