mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
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:
parent
2524d22691
commit
c2d28aa76f
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user