mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 04:05:32 +00:00
Back out bug 1410429 because dependency hasn't been landed yet; r=me
This commit is contained in:
parent
cd6edeac02
commit
5fdcca21ad
@ -756,7 +756,6 @@ class MemoryAccessDesc
|
|||||||
bool isPlainAsmJS() const { return !hasTrap(); }
|
bool isPlainAsmJS() const { return !hasTrap(); }
|
||||||
|
|
||||||
void clearOffset() { offset_ = 0; }
|
void clearOffset() { offset_ = 0; }
|
||||||
void setOffset(uint32_t offset) { offset_ = offset; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Summarizes a global access for a mutable (in asm.js) or immutable value (in
|
// Summarizes a global access for a mutable (in asm.js) or immutable value (in
|
||||||
|
@ -777,24 +777,6 @@ class FunctionCompiler
|
|||||||
|
|
||||||
void checkOffsetAndBounds(MemoryAccessDesc* access, MDefinition** base)
|
void checkOffsetAndBounds(MemoryAccessDesc* access, MDefinition** base)
|
||||||
{
|
{
|
||||||
// Fold a constant base into the offset (so the base is 0 in which case
|
|
||||||
// the codegen is optimized), if it doesn't wrap or trigger an
|
|
||||||
// MWasmAddOffset.
|
|
||||||
if ((*base)->isConstant()) {
|
|
||||||
uint32_t basePtr = (*base)->toConstant()->toInt32();
|
|
||||||
uint32_t offset = access->offset();
|
|
||||||
|
|
||||||
static_assert(OffsetGuardLimit < UINT32_MAX,
|
|
||||||
"checking for overflow against OffsetGuardLimit is enough.");
|
|
||||||
|
|
||||||
if (offset < OffsetGuardLimit && basePtr < OffsetGuardLimit - offset) {
|
|
||||||
auto* ins = MConstant::New(alloc(), Int32Value(0), MIRType::Int32);
|
|
||||||
curBlock_->add(ins);
|
|
||||||
*base = ins;
|
|
||||||
access->setOffset(access->offset() + basePtr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the offset is bigger than the guard region, a separate instruction
|
// If the offset is bigger than the guard region, a separate instruction
|
||||||
// is necessary to add the offset to the base and check for overflow.
|
// is necessary to add the offset to the base and check for overflow.
|
||||||
if (access->offset() >= OffsetGuardLimit || !JitOptions.wasmFoldOffsets) {
|
if (access->offset() >= OffsetGuardLimit || !JitOptions.wasmFoldOffsets) {
|
||||||
|
Loading…
Reference in New Issue
Block a user