mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-24 05:13:07 +09:00
Bug 1147371: Implement JSOP_PICK and JSOP_UNPICK in the expression decompiler
Issue #74
This commit is contained in:
parent
95390009cc
commit
0f625eb5bd
3 changed files with 31 additions and 1 deletions
|
|
@ -460,6 +460,34 @@ BytecodeParser::simulateOp(JSOp op, uint32_t offset, uint32_t* offsetStack, uint
|
|||
offsetStack[stackDepth] = tmp;
|
||||
}
|
||||
break;
|
||||
|
||||
case JSOP_PICK: {
|
||||
jsbytecode* pc = script_->offsetToPC(offset);
|
||||
unsigned n = GET_UINT8(pc);
|
||||
MOZ_ASSERT(ndefs == n + 1);
|
||||
if (offsetStack) {
|
||||
uint32_t top = stackDepth + n;
|
||||
uint32_t tmp = offsetStack[stackDepth];
|
||||
for (uint32_t i = stackDepth; i < top; i++)
|
||||
offsetStack[i] = offsetStack[i + 1];
|
||||
offsetStack[top] = tmp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case JSOP_UNPICK: {
|
||||
jsbytecode* pc = script_->offsetToPC(offset);
|
||||
unsigned n = GET_UINT8(pc);
|
||||
MOZ_ASSERT(ndefs == n + 1);
|
||||
if (offsetStack) {
|
||||
uint32_t top = stackDepth + n;
|
||||
uint32_t tmp = offsetStack[top];
|
||||
for (uint32_t i = top; i > stackDepth; i--)
|
||||
offsetStack[i] = offsetStack[i - 1];
|
||||
offsetStack[stackDepth] = tmp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
stackDepth += ndefs;
|
||||
return stackDepth;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue