summaryrefslogtreecommitdiffstats
path: root/dexdump
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2010-11-19 12:36:19 -0800
committerDan Bornstein <danfuzz@android.com>2010-11-19 12:36:19 -0800
commit41e286c0623dcb4efc6243c94ba14e7febed4b25 (patch)
tree0913ea0ac7a342fceb9ee5d60c5ff26af8381850 /dexdump
parent1bf27827da214984d84febe187899969457bfb31 (diff)
downloadandroid_dalvik-41e286c0623dcb4efc6243c94ba14e7febed4b25.tar.gz
android_dalvik-41e286c0623dcb4efc6243c94ba14e7febed4b25.tar.bz2
android_dalvik-41e286c0623dcb4efc6243c94ba14e7febed4b25.zip
Get rid of the copies of the opcode table pointers.
This inclduded fixing all the accessor functions to refer to the global ones defined in InstrUtils.[ch] instead of taking separate "table pointer" arguments. This did end up adding a few more truly global references to some of the code paths, particularly when performing dex optimization, so I went ahead and measured the time to do a cold first-boot both before and after the change (on real hardware). The times were identical (to one-second granularity), so I'm reasonably comfortable making this change. Change-Id: I604d9f7882bad4245bb11371218d13b06c3a5375
Diffstat (limited to 'dexdump')
-rw-r--r--dexdump/DexDump.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/dexdump/DexDump.c b/dexdump/DexDump.c
index 556dbc22a..3950a81d0 100644
--- a/dexdump/DexDump.c
+++ b/dexdump/DexDump.c
@@ -49,8 +49,6 @@
static const char* gProgName = "dexdump";
-static InstructionInfoTables gInstrInfo;
-
typedef enum OutputFormat {
OUTPUT_PLAIN = 0, /* default */
OUTPUT_XML, /* fancy */
@@ -710,7 +708,7 @@ static char* indexString(DexFile* pDexFile,
u4 width;
/* TODO: Make the index *always* be in field B, to simplify this code. */
- switch (dexGetInstrFormat(gInstrInfo.formats, pDecInsn->opCode)) {
+ switch (dexGetInstrFormat(pDecInsn->opCode)) {
case kFmt20bc:
case kFmt21c:
case kFmt35c:
@@ -882,7 +880,7 @@ void dumpInstruction(DexFile* pDexFile, const DexCode* pCode, int insnIdx,
indexBufChars, sizeof(indexBufChars));
}
- switch (dexGetInstrFormat(gInstrInfo.formats, pDecInsn->opCode)) {
+ switch (dexGetInstrFormat(pDecInsn->opCode)) {
case kFmt10x: // op
break;
case kFmt12x: // op vA, vB
@@ -1089,7 +1087,7 @@ void dumpBytecodes(DexFile* pDexFile, const DexMethod* pDexMethod)
insnWidth = 4 + ((size * width) + 1) / 2;
} else {
opCode = instr & 0xff;
- insnWidth = dexGetInstrWidth(gInstrInfo.widths, opCode);
+ insnWidth = dexGetInstrWidth(opCode);
if (insnWidth == 0) {
fprintf(stderr,
"GLITCH: zero-width instruction at idx=0x%04x\n", insnIdx);
@@ -1890,9 +1888,6 @@ int main(int argc, char* const argv[])
wantUsage = true;
}
- /* initialize some VM tables */
- dexGetInstructionInfoTables(&gInstrInfo);
-
if (wantUsage) {
usage();
return 2;