Bug 1103450 - Odin atomic and locks: optimize array access when the index is known to be within bounds. r=lth

This commit is contained in:
Douglas Crosher 2014-12-07 00:15:24 +11:00
parent 2524d22691
commit c2d28aa76f
2 changed files with 4 additions and 8 deletions

View File

@ -2814,8 +2814,7 @@ class FunctionCompiler
if (inDeadCode())
return nullptr;
// The code generator requires explicit bounds checking for compareExchange.
bool needsBoundsCheck = true;
bool needsBoundsCheck = chk == NEEDS_BOUNDS_CHECK;
MAsmJSCompareExchangeHeap *cas =
MAsmJSCompareExchangeHeap::New(alloc(), vt, ptr, oldv, newv, needsBoundsCheck);
curBlock_->add(cas);
@ -2828,8 +2827,7 @@ class FunctionCompiler
if (inDeadCode())
return nullptr;
// The code generator requires explicit bounds checking for the binops.
bool needsBoundsCheck = true;
bool needsBoundsCheck = chk == NEEDS_BOUNDS_CHECK;
MAsmJSAtomicBinopHeap *binop =
MAsmJSAtomicBinopHeap::New(alloc(), op, vt, ptr, v, needsBoundsCheck);
curBlock_->add(binop);

View File

@ -387,8 +387,7 @@ CodeGeneratorX64::visitAsmJSCompareExchangeHeap(LAsmJSCompareExchangeHeap *ins)
Label rejoin;
uint32_t maybeCmpOffset = AsmJSHeapAccess::NoLengthCheck;
MOZ_ASSERT(mir->needsBoundsCheck());
{
if (mir->needsBoundsCheck()) {
maybeCmpOffset = masm.cmplWithPatch(ToRegister(ptr), Imm32(0)).offset();
Label goahead;
masm.j(Assembler::LessThan, &goahead);
@ -425,8 +424,7 @@ CodeGeneratorX64::visitAsmJSAtomicBinopHeap(LAsmJSAtomicBinopHeap *ins)
Label rejoin;
uint32_t maybeCmpOffset = AsmJSHeapAccess::NoLengthCheck;
MOZ_ASSERT(mir->needsBoundsCheck());
{
if (mir->needsBoundsCheck()) {
maybeCmpOffset = masm.cmplWithPatch(ToRegister(ptr), Imm32(0)).offset();
Label goahead;
masm.j(Assembler::LessThan, &goahead);