diff --git a/runtime/vm/compiler/backend/type_propagator.cc b/runtime/vm/compiler/backend/type_propagator.cc index 7043c362850..b8704b8ceec 100644 --- a/runtime/vm/compiler/backend/type_propagator.cc +++ b/runtime/vm/compiler/backend/type_propagator.cc @@ -662,7 +662,7 @@ CompileType CompileType::Int() { } CompileType CompileType::Int32() { -#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64) +#if defined(TARGET_ARCH_IS_64_BIT) return FromCid(kSmiCid); #else return Int(); diff --git a/runtime/vm/compiler/graph_intrinsifier.cc b/runtime/vm/compiler/graph_intrinsifier.cc index f3a2313f7bc..728aee51d26 100644 --- a/runtime/vm/compiler/graph_intrinsifier.cc +++ b/runtime/vm/compiler/graph_intrinsifier.cc @@ -280,11 +280,15 @@ static bool IntrinsifyArraySetIndexed(FlowGraph* flow_graph, switch (array_cid) { case kTypedDataUint8ClampedArrayCid: case kExternalTypedDataUint8ClampedArrayCid: - // Clamping operations need the exact value for proper operations. - // All others get away with truncating even non-smi values. +#if defined(TARGET_ARCH_IS_32_BIT) + // On 32-bit architectures, clamping operations need the exact value + // for proper operations. On 64-bit architectures, kUnboxedIntPtr + // maps to kUnboxedInt64. All other situations get away with + // truncating even non-smi values. builder.AddInstruction(new CheckSmiInstr(new Value(value), DeoptId::kNone, builder.TokenPos())); FALL_THROUGH; +#endif case kTypedDataInt8ArrayCid: case kTypedDataInt16ArrayCid: case kTypedDataUint8ArrayCid: