Added format 25x to dexdump(2).
Rationale: Igor introduced a new format for invoke-lambda which
was not recognized by dexdump(2) yet.
Sample output:
Change-Id: I2d9cd4b740452bb8380de2234819bcd4ad49345a
0002ac: |[0002ac] Hello.doit:()V
0002bc: f600 0200 |0000: create-lambda v0, LHello;.-void_doit__LambdaImpl0:(J)V // method@0002
0002c0: f300 0000 |0002: invoke-lambda v0, {}
0002c4: f600 0300 |0004: create-lambda v0, LHello;.-void_doit__LambdaImpl1:(JI)V // method@0003
0002c8: 1212 |0006: const/4 v2, #int 1 // #1
0002ca: f310 2000 |0007: invoke-lambda v0, {v2}
0002ce: 0e00 |0009: return-void
diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc
index 282db5d..52e6c02 100644
--- a/dexdump/dexdump.cc
+++ b/dexdump/dexdump.cc
@@ -775,7 +775,7 @@
// case Instruction::k35ms: // [opt] invoke-virtual+super
// case Instruction::k35mi: // [opt] inline invoke
{
- u4 arg[5];
+ u4 arg[Instruction::kMaxVarArgRegs];
pDecInsn->GetVarArgs(arg);
fputs(" {", gOutFile);
for (int i = 0, n = pDecInsn->VRegA(); i < n; i++) {
@@ -788,6 +788,21 @@
fprintf(gOutFile, "}, %s", indexBuf);
}
break;
+ case Instruction::k25x: // op vC, {vD, vE, vF, vG} (B: count)
+ {
+ u4 arg[Instruction::kMaxVarArgRegs25x];
+ pDecInsn->GetAllArgs25x(arg);
+ fprintf(gOutFile, " v%d, {", arg[0]);
+ for (int i = 0, n = pDecInsn->VRegB(); i < n; i++) {
+ if (i == 0) {
+ fprintf(gOutFile, "v%d", arg[Instruction::kLambdaVirtualRegisterWidth + i]);
+ } else {
+ fprintf(gOutFile, ", v%d", arg[Instruction::kLambdaVirtualRegisterWidth + i]);
+ }
+ } // for
+ fputc('}', gOutFile);
+ }
+ break;
case Instruction::k3rc: // op {vCCCC .. v(CCCC+AA-1)}, thing@BBBB
// NOT SUPPORTED:
// case Instruction::k3rms: // [opt] invoke-virtual+super/range
diff --git a/runtime/dex_instruction.h b/runtime/dex_instruction.h
index 2871f76..035230e 100644
--- a/runtime/dex_instruction.h
+++ b/runtime/dex_instruction.h
@@ -185,6 +185,7 @@
static constexpr uint32_t kMaxVarArgRegs = 5;
static constexpr uint32_t kMaxVarArgRegs25x = 6; // lambdas are 2 registers.
+ static constexpr uint32_t kLambdaVirtualRegisterWidth = 2;
// Returns the size (in 2 byte code units) of this instruction.
size_t SizeInCodeUnits() const {