Bug 876398 - Compile JSOP_POPN with Baseline and Ion. r=djvj

This commit is contained in:
Jan de Mooij 2013-05-28 14:32:47 +02:00
parent 57d16360ab
commit ccad30c741
4 changed files with 24 additions and 0 deletions

View File

@ -623,6 +623,13 @@ BaselineCompiler::emit_JSOP_POP()
return true;
}
bool
BaselineCompiler::emit_JSOP_POPN()
{
frame.popn(GET_UINT16(pc));
return true;
}
bool
BaselineCompiler::emit_JSOP_DUP()
{

View File

@ -35,6 +35,7 @@ namespace ion {
_(JSOP_LABEL) \
_(JSOP_NOTEARG) \
_(JSOP_POP) \
_(JSOP_POPN) \
_(JSOP_DUP) \
_(JSOP_DUP2) \
_(JSOP_SWAP) \

View File

@ -1244,6 +1244,11 @@ IonBuilder::inspectOpcode(JSOp op)
return true;
return maybeInsertResume();
case JSOP_POPN:
for (uint32_t i = 0, n = GET_UINT16(pc); i < n; i++)
current->pop();
return true;
case JSOP_NEWINIT:
{
if (GET_UINT8(pc) == JSProto_Array)

View File

@ -0,0 +1,11 @@
function f() {
var t = 0;
for (var j = 0; j < 10; j++) {
for (var i = 0; i < 9; ++i) {
var [r, g, b] = [1, i, -10];
t += r + g + b;
}
}
return t;
}
assertEq(f(), -450);