зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1633997 - Part 4: Remove MLoadUnboxedScalar::readType. r=jandem
Depends on D73020 Differential Revision: https://phabricator.services.mozilla.com/D73021
This commit is contained in:
Родитель
dfd291de41
Коммит
724bdad04a
|
@ -11845,18 +11845,18 @@ void CodeGenerator::visitLoadUnboxedScalar(LLoadUnboxedScalar* lir) {
|
||||||
|
|
||||||
const MLoadUnboxedScalar* mir = lir->mir();
|
const MLoadUnboxedScalar* mir = lir->mir();
|
||||||
|
|
||||||
Scalar::Type readType = mir->readType();
|
Scalar::Type storageType = mir->storageType();
|
||||||
size_t width = Scalar::byteSize(mir->storageType());
|
size_t width = Scalar::byteSize(storageType);
|
||||||
|
|
||||||
Label fail;
|
Label fail;
|
||||||
if (lir->index()->isConstant()) {
|
if (lir->index()->isConstant()) {
|
||||||
Address source(elements,
|
Address source(elements,
|
||||||
ToInt32(lir->index()) * width + mir->offsetAdjustment());
|
ToInt32(lir->index()) * width + mir->offsetAdjustment());
|
||||||
masm.loadFromTypedArray(readType, source, out, temp, &fail);
|
masm.loadFromTypedArray(storageType, source, out, temp, &fail);
|
||||||
} else {
|
} else {
|
||||||
BaseIndex source(elements, ToRegister(lir->index()),
|
BaseIndex source(elements, ToRegister(lir->index()),
|
||||||
ScaleFromElemWidth(width), mir->offsetAdjustment());
|
ScaleFromElemWidth(width), mir->offsetAdjustment());
|
||||||
masm.loadFromTypedArray(readType, source, out, temp, &fail);
|
masm.loadFromTypedArray(storageType, source, out, temp, &fail);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fail.used()) {
|
if (fail.used()) {
|
||||||
|
|
|
@ -3420,7 +3420,8 @@ void LIRGenerator::visitLoadUnboxedScalar(MLoadUnboxedScalar* ins) {
|
||||||
|
|
||||||
// We need a temp register for Uint32Array with known double result.
|
// We need a temp register for Uint32Array with known double result.
|
||||||
LDefinition tempDef = LDefinition::BogusTemp();
|
LDefinition tempDef = LDefinition::BogusTemp();
|
||||||
if (ins->readType() == Scalar::Uint32 && IsFloatingPointType(ins->type())) {
|
if (ins->storageType() == Scalar::Uint32 &&
|
||||||
|
IsFloatingPointType(ins->type())) {
|
||||||
tempDef = temp();
|
tempDef = temp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7776,7 +7776,6 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
|
||||||
public SingleObjectPolicy::Data {
|
public SingleObjectPolicy::Data {
|
||||||
int32_t offsetAdjustment_ = 0;
|
int32_t offsetAdjustment_ = 0;
|
||||||
Scalar::Type storageType_;
|
Scalar::Type storageType_;
|
||||||
Scalar::Type readType_;
|
|
||||||
bool requiresBarrier_;
|
bool requiresBarrier_;
|
||||||
|
|
||||||
MLoadUnboxedScalar(
|
MLoadUnboxedScalar(
|
||||||
|
@ -7784,7 +7783,6 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
|
||||||
MemoryBarrierRequirement requiresBarrier = DoesNotRequireMemoryBarrier)
|
MemoryBarrierRequirement requiresBarrier = DoesNotRequireMemoryBarrier)
|
||||||
: MBinaryInstruction(classOpcode, elements, index),
|
: MBinaryInstruction(classOpcode, elements, index),
|
||||||
storageType_(storageType),
|
storageType_(storageType),
|
||||||
readType_(storageType),
|
|
||||||
requiresBarrier_(requiresBarrier == DoesRequireMemoryBarrier) {
|
requiresBarrier_(requiresBarrier == DoesRequireMemoryBarrier) {
|
||||||
setResultType(MIRType::Value);
|
setResultType(MIRType::Value);
|
||||||
if (requiresBarrier_) {
|
if (requiresBarrier_) {
|
||||||
|
@ -7802,12 +7800,10 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
|
||||||
TRIVIAL_NEW_WRAPPERS
|
TRIVIAL_NEW_WRAPPERS
|
||||||
NAMED_OPERANDS((0, elements), (1, index))
|
NAMED_OPERANDS((0, elements), (1, index))
|
||||||
|
|
||||||
Scalar::Type readType() const { return readType_; }
|
|
||||||
|
|
||||||
Scalar::Type storageType() const { return storageType_; }
|
Scalar::Type storageType() const { return storageType_; }
|
||||||
bool fallible() const {
|
bool fallible() const {
|
||||||
// Bailout if the result does not fit in an int32.
|
// Bailout if the result does not fit in an int32.
|
||||||
return readType_ == Scalar::Uint32 && type() == MIRType::Int32;
|
return storageType_ == Scalar::Uint32 && type() == MIRType::Int32;
|
||||||
}
|
}
|
||||||
bool requiresMemoryBarrier() const { return requiresBarrier_; }
|
bool requiresMemoryBarrier() const { return requiresBarrier_; }
|
||||||
int32_t offsetAdjustment() const { return offsetAdjustment_; }
|
int32_t offsetAdjustment() const { return offsetAdjustment_; }
|
||||||
|
@ -7834,9 +7830,6 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
|
||||||
if (storageType_ != other->storageType_) {
|
if (storageType_ != other->storageType_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (readType_ != other->readType_) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (offsetAdjustment() != other->offsetAdjustment()) {
|
if (offsetAdjustment() != other->offsetAdjustment()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1757,7 +1757,7 @@ static Range* GetTypedArrayRange(TempAllocator& alloc, Scalar::Type type) {
|
||||||
void MLoadUnboxedScalar::computeRange(TempAllocator& alloc) {
|
void MLoadUnboxedScalar::computeRange(TempAllocator& alloc) {
|
||||||
// We have an Int32 type and if this is a UInt32 load it may produce a value
|
// We have an Int32 type and if this is a UInt32 load it may produce a value
|
||||||
// outside of our range, but we have a bailout to handle those cases.
|
// outside of our range, but we have a bailout to handle those cases.
|
||||||
setRange(GetTypedArrayRange(alloc, readType()));
|
setRange(GetTypedArrayRange(alloc, storageType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MArrayLength::computeRange(TempAllocator& alloc) {
|
void MArrayLength::computeRange(TempAllocator& alloc) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче