| Index: src/compiler/simplified-lowering.cc
|
| diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
|
| index 39d473e7a9687b68dcec17eac8a67fdf34284d07..57f3fd5b436ccc60c4633089cf101211ac4b073b 100644
|
| --- a/src/compiler/simplified-lowering.cc
|
| +++ b/src/compiler/simplified-lowering.cc
|
| @@ -1871,9 +1871,31 @@ class RepresentationSelector {
|
| }
|
| case IrOpcode::kLoadField: {
|
| FieldAccess access = FieldAccessOf(node->op());
|
| - ProcessInput(node, 0, UseInfoForBasePointer(access));
|
| - ProcessRemainingInputs(node, 1);
|
| - SetOutput(node, access.machine_type.representation());
|
| + MachineRepresentation representation =
|
| + access.machine_type.representation();
|
| + // If we are loading from a Smi field and truncate the result to Word32,
|
| + // we can instead just load the high word on 64-bit architectures, which
|
| + // is exactly the Word32 we are looking for, and therefore avoid a nasty
|
| + // right shift afterwards.
|
| + // TODO(bmeurer): Introduce an appropriate tagged-signed machine rep.
|
| + if (truncation.TruncatesToWord32() &&
|
| + representation == MachineRepresentation::kTagged &&
|
| + access.type->Is(Type::TaggedSigned()) && SmiValuesAre32Bits()) {
|
| + VisitUnop(node, UseInfoForBasePointer(access),
|
| + MachineRepresentation::kWord32);
|
| + if (lower()) {
|
| + // Morph this Smi load field into an int32 load field.
|
| + access.machine_type = MachineType::Int32();
|
| + access.type = type_cache_.kInt32;
|
| +#if V8_TARGET_LITTLE_ENDIAN
|
| + access.offset += kPointerSize / 2;
|
| +#endif
|
| + NodeProperties::ChangeOp(node,
|
| + jsgraph_->simplified()->LoadField(access));
|
| + }
|
| + } else {
|
| + VisitUnop(node, UseInfoForBasePointer(access), representation);
|
| + }
|
| return;
|
| }
|
| case IrOpcode::kStoreField: {
|
|
|