Skip to content

Commit

Permalink
Ensure registers are spilled pre-BailIn
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuanjl committed Apr 16, 2021
1 parent d9e818b commit ba708b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Backend/LinearScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3339,7 +3339,7 @@ LinearScan::KillImplicitRegs(IR::Instr *instr)
return;
}

if (instr->m_opcode == Js::OpCode::Yield)
if (instr->m_opcode == Js::OpCode::GeneratorBailInLabel)
{
this->bailIn.SpillRegsForBailIn();
return;
Expand Down
17 changes: 17 additions & 0 deletions test/es6/generator-jit-bugs.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,22 @@ check(gf8().next().value.v8, 1.1);
check(gf8().next().value.v8, 1.1);
check(gf8().next().value.v8, 1.1);

// Test 9 - double use of rax register when setting up BailIn
title("Rax register must be spilled before BailIn")
{
let i = 0;
function* v1() {
function v7() {}
for (var v10 in []) {
yield undefined;
}
if(++i < 4)
v1().next()
v7 + 1;
}
}
check(v1().next().value, undefined);



print("pass");

0 comments on commit ba708b5

Please sign in to comment.