Bug 1518837: Reuse input register in LGuardToClass. r=jandem

This commit is contained in:
André Bargull 2019-01-09 09:04:15 -08:00
Родитель 6de4d9b81c
Коммит 085ce9ea7b
2 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -12678,14 +12678,16 @@ void CodeGenerator::visitHasClass(LHasClass* ins) {
void CodeGenerator::visitGuardToClass(LGuardToClass* ins) {
Register lhs = ToRegister(ins->lhs());
Register output = ToRegister(ins->output());
Register temp = ToRegister(ins->temp());
// branchTestObjClass may zero the object register on speculative paths
// (we should have a defineReuseInput allocation in this case).
Register spectreRegToZero = lhs;
Label notEqual;
masm.branchTestObjClass(Assembler::NotEqual, lhs, ins->mir()->getClass(),
temp, output, &notEqual);
masm.mov(lhs, output);
temp, spectreRegToZero, &notEqual);
// Can't return null-return here, so bail.
bailoutFrom(&notEqual, ins->snapshot());

Просмотреть файл

@ -4208,9 +4208,9 @@ void LIRGenerator::visitGuardToClass(MGuardToClass* ins) {
MOZ_ASSERT(ins->object()->type() == MIRType::Object);
MOZ_ASSERT(ins->type() == MIRType::Object);
LGuardToClass* lir =
new (alloc()) LGuardToClass(useRegister(ins->object()), temp());
new (alloc()) LGuardToClass(useRegisterAtStart(ins->object()), temp());
assignSnapshot(lir, Bailout_TypeBarrierO);
define(lir, ins);
defineReuseInput(lir, ins, 0);
}
void LIRGenerator::visitObjectClassToString(MObjectClassToString* ins) {