зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1359952 - Fix CacheIRCompiler handling of boolean results r=jandem
MozReview-Commit-ID: 5xeZQyprlpm --HG-- extra : rebase_source : f3df3bae4ab544d2de5610134ad9399d161288ad
This commit is contained in:
Родитель
0bfebf0c87
Коммит
786416aaf1
|
@ -1635,18 +1635,24 @@ CacheIRCompiler::emitLoadUndefinedResult()
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
EmitStoreBoolean(MacroAssembler& masm, bool b, const AutoOutputRegister& output)
|
||||
{
|
||||
if (output.hasValue()) {
|
||||
Value val = BooleanValue(b);
|
||||
masm.moveValue(val, output.valueReg());
|
||||
} else {
|
||||
MOZ_ASSERT(output.type() == JSVAL_TYPE_BOOLEAN);
|
||||
masm.movePtr(ImmWord(b), output.typedReg().gpr());
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CacheIRCompiler::emitLoadBooleanResult()
|
||||
{
|
||||
AutoOutputRegister output(*this);
|
||||
if (output.hasValue()) {
|
||||
Value val = BooleanValue(reader.readBool());
|
||||
masm.moveValue(val, output.valueReg());
|
||||
} else {
|
||||
MOZ_ASSERT(output.type() == JSVAL_TYPE_BOOLEAN);
|
||||
bool b = reader.readBool();
|
||||
masm.movePtr(ImmWord(b), output.typedReg().gpr());
|
||||
}
|
||||
bool b = reader.readBool();
|
||||
EmitStoreBoolean(masm, b, output);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1950,12 +1956,7 @@ CacheIRCompiler::emitLoadDenseElementExistsResult()
|
|||
BaseObjectElementIndex element(scratch, index);
|
||||
masm.branchTestMagic(Assembler::Equal, element, failure->label());
|
||||
|
||||
if (output.hasValue()) {
|
||||
masm.moveValue(BooleanValue(true), output.valueReg());
|
||||
} else {
|
||||
MOZ_ASSERT(output.type() == JSVAL_TYPE_BOOLEAN);
|
||||
masm.movePtr(ImmWord(true), output.typedReg().gpr());
|
||||
}
|
||||
EmitStoreBoolean(masm, true, output);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1984,14 +1985,14 @@ CacheIRCompiler::emitLoadDenseElementHoleExistsResult()
|
|||
|
||||
// Load value and replace with true.
|
||||
Label done;
|
||||
masm.loadValue(BaseObjectElementIndex(scratch, index), output.valueReg());
|
||||
masm.branchTestMagic(Assembler::Equal, output.valueReg(), &hole);
|
||||
masm.moveValue(BooleanValue(true), output.valueReg());
|
||||
BaseObjectElementIndex element(scratch, index);
|
||||
masm.branchTestMagic(Assembler::Equal, element, &hole);
|
||||
EmitStoreBoolean(masm, true, output);
|
||||
masm.jump(&done);
|
||||
|
||||
// Load false for the hole.
|
||||
masm.bind(&hole);
|
||||
masm.moveValue(BooleanValue(false), output.valueReg());
|
||||
EmitStoreBoolean(masm, false, output);
|
||||
|
||||
masm.bind(&done);
|
||||
return true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче