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:
André Bargull 2020-04-29 17:45:58 +00:00
Родитель dfd291de41
Коммит 724bdad04a
4 изменённых файлов: 8 добавлений и 14 удалений

Просмотреть файл

@ -11845,18 +11845,18 @@ void CodeGenerator::visitLoadUnboxedScalar(LLoadUnboxedScalar* lir) {
const MLoadUnboxedScalar* mir = lir->mir();
Scalar::Type readType = mir->readType();
size_t width = Scalar::byteSize(mir->storageType());
Scalar::Type storageType = mir->storageType();
size_t width = Scalar::byteSize(storageType);
Label fail;
if (lir->index()->isConstant()) {
Address source(elements,
ToInt32(lir->index()) * width + mir->offsetAdjustment());
masm.loadFromTypedArray(readType, source, out, temp, &fail);
masm.loadFromTypedArray(storageType, source, out, temp, &fail);
} else {
BaseIndex source(elements, ToRegister(lir->index()),
ScaleFromElemWidth(width), mir->offsetAdjustment());
masm.loadFromTypedArray(readType, source, out, temp, &fail);
masm.loadFromTypedArray(storageType, source, out, temp, &fail);
}
if (fail.used()) {

Просмотреть файл

@ -3420,7 +3420,8 @@ void LIRGenerator::visitLoadUnboxedScalar(MLoadUnboxedScalar* ins) {
// We need a temp register for Uint32Array with known double result.
LDefinition tempDef = LDefinition::BogusTemp();
if (ins->readType() == Scalar::Uint32 && IsFloatingPointType(ins->type())) {
if (ins->storageType() == Scalar::Uint32 &&
IsFloatingPointType(ins->type())) {
tempDef = temp();
}

Просмотреть файл

@ -7776,7 +7776,6 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
public SingleObjectPolicy::Data {
int32_t offsetAdjustment_ = 0;
Scalar::Type storageType_;
Scalar::Type readType_;
bool requiresBarrier_;
MLoadUnboxedScalar(
@ -7784,7 +7783,6 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
MemoryBarrierRequirement requiresBarrier = DoesNotRequireMemoryBarrier)
: MBinaryInstruction(classOpcode, elements, index),
storageType_(storageType),
readType_(storageType),
requiresBarrier_(requiresBarrier == DoesRequireMemoryBarrier) {
setResultType(MIRType::Value);
if (requiresBarrier_) {
@ -7802,12 +7800,10 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, elements), (1, index))
Scalar::Type readType() const { return readType_; }
Scalar::Type storageType() const { return storageType_; }
bool fallible() const {
// 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_; }
int32_t offsetAdjustment() const { return offsetAdjustment_; }
@ -7834,9 +7830,6 @@ class MLoadUnboxedScalar : public MBinaryInstruction,
if (storageType_ != other->storageType_) {
return false;
}
if (readType_ != other->readType_) {
return false;
}
if (offsetAdjustment() != other->offsetAdjustment()) {
return false;
}

Просмотреть файл

@ -1757,7 +1757,7 @@ static Range* GetTypedArrayRange(TempAllocator& alloc, Scalar::Type type) {
void MLoadUnboxedScalar::computeRange(TempAllocator& alloc) {
// 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.
setRange(GetTypedArrayRange(alloc, readType()));
setRange(GetTypedArrayRange(alloc, storageType()));
}
void MArrayLength::computeRange(TempAllocator& alloc) {