summaryrefslogtreecommitdiffstats
path: root/opcode-gen
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2011-02-02 14:01:52 -0800
committerDan Bornstein <danfuzz@android.com>2011-02-02 14:10:56 -0800
commitf67b6afce08a6b9b5daf7d4d69e132fda07bc78f (patch)
treec49803909b076d806bc89b268d7f768db60c1c59 /opcode-gen
parentfbb320e01b5e43a3d86740ef77961d2a9164c230 (diff)
downloadandroid_dalvik-f67b6afce08a6b9b5daf7d4d69e132fda07bc78f.tar.gz
android_dalvik-f67b6afce08a6b9b5daf7d4d69e132fda07bc78f.tar.bz2
android_dalvik-f67b6afce08a6b9b5daf7d4d69e132fda07bc78f.zip
CodeReader visitor dispatch now uses OpcodeInfo.
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
Diffstat (limited to 'opcode-gen')
-rw-r--r--opcode-gen/opcode-gen.awk12
1 files changed, 3 insertions, 9 deletions
diff --git a/opcode-gen/opcode-gen.awk b/opcode-gen/opcode-gen.awk
index 2f1a830eb..0e0ff6cab 100644
--- a/opcode-gen/opcode-gen.awk
+++ b/opcode-gen/opcode-gen.awk
@@ -108,18 +108,12 @@ emission == "opcode-info-defs" {
for (i = 0; i <= MAX_OPCODE; i++) {
if (isUnused(i) || isOptimized(i)) continue;
- itype = indexType[i];
- if ((itype == "none") || (itype == "unknown")) {
- itype = "null";
- } else {
- itype = toupper(itype);
- gsub(/-/, "_", itype);
- itype = "IndexType." itype;
- }
+ itype = toupper(indexType[i]);
+ gsub(/-/, "_", itype);
printf(" public static final Info %s =\n" \
" new Info(Opcodes.%s, \"%s\",\n" \
- " InstructionCodec.FORMAT_%s, %s);\n\n", \
+ " InstructionCodec.FORMAT_%s, IndexType.%s);\n\n", \
constName[i], constName[i], name[i], toupper(format[i]), itype);
}
}