Index: src/compiler/simplified-lowering.cc |
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc |
index 093b09ecc0f711bd466af097dc88750097a1431f..bc1721e88d173d9af5661f5def7b039ec80bd5dc 100644 |
--- a/src/compiler/simplified-lowering.cc |
+++ b/src/compiler/simplified-lowering.cc |
@@ -65,6 +65,27 @@ enum Phase { |
namespace { |
+MachineRepresentation MachineRepresentationFromArrayType( |
+ ExternalArrayType array_type) { |
+ switch (array_type) { |
+ case kExternalUint8Array: |
+ case kExternalUint8ClampedArray: |
+ case kExternalInt8Array: |
+ return MachineRepresentation::kWord8; |
+ case kExternalUint16Array: |
+ case kExternalInt16Array: |
+ return MachineRepresentation::kWord16; |
+ case kExternalUint32Array: |
+ case kExternalInt32Array: |
+ return MachineRepresentation::kWord32; |
+ case kExternalFloat32Array: |
+ return MachineRepresentation::kFloat32; |
+ case kExternalFloat64Array: |
+ return MachineRepresentation::kFloat64; |
+ } |
+ UNREACHABLE(); |
+ return MachineRepresentation::kNone; |
+} |
UseInfo TruncatingUseInfoFromRepresentation(MachineRepresentation rep) { |
switch (rep) { |
@@ -2209,6 +2230,30 @@ class RepresentationSelector { |
} |
return; |
} |
+ case IrOpcode::kLoadTypedElement: { |
+ MachineRepresentation const rep = |
+ MachineRepresentationFromArrayType(ExternalArrayTypeOf(node->op())); |
+ ProcessInput(node, 0, UseInfo::AnyTagged()); // buffer |
+ ProcessInput(node, 1, UseInfo::AnyTagged()); // base pointer |
+ ProcessInput(node, 2, UseInfo::PointerInt()); // external pointer |
+ ProcessInput(node, 3, UseInfo::TruncatingWord32()); // index |
+ ProcessRemainingInputs(node, 4); |
+ SetOutput(node, rep); |
+ return; |
+ } |
+ case IrOpcode::kStoreTypedElement: { |
+ MachineRepresentation const rep = |
+ MachineRepresentationFromArrayType(ExternalArrayTypeOf(node->op())); |
+ ProcessInput(node, 0, UseInfo::AnyTagged()); // buffer |
+ ProcessInput(node, 1, UseInfo::AnyTagged()); // base pointer |
+ ProcessInput(node, 2, UseInfo::PointerInt()); // external pointer |
+ ProcessInput(node, 3, UseInfo::TruncatingWord32()); // index |
+ ProcessInput(node, 4, |
+ TruncatingUseInfoFromRepresentation(rep)); // value |
+ ProcessRemainingInputs(node, 5); |
+ SetOutput(node, MachineRepresentation::kNone); |
+ return; |
+ } |
case IrOpcode::kPlainPrimitiveToNumber: { |
if (InputIs(node, Type::Boolean())) { |
VisitUnop(node, UseInfo::Bool(), MachineRepresentation::kWord32); |