Commit 9c87bd4b authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Get rid of truncation by store.

Nowadays, representation inference and simplified lowering can insert the
right truncations based on the use.

Review URL: https://codereview.chromium.org/1512243002

Cr-Commit-Position: refs/heads/master@{#32747}
parent 40817d22
......@@ -1063,15 +1063,6 @@ Reduction JSTypedLowering::ReduceJSStoreProperty(Node* node) {
frame_state_for_to_number, effect, control);
}
}
// For integer-typed arrays, convert to the integer type.
if (access.machine_type().semantic() == MachineSemantic::kInt32 &&
!value_type->Is(Type::Signed32())) {
value = graph()->NewNode(simplified()->NumberToInt32(), value);
} else if (access.machine_type().semantic() ==
MachineSemantic::kUint32 &&
!value_type->Is(Type::Unsigned32())) {
value = graph()->NewNode(simplified()->NumberToUint32(), value);
}
// Check if we can avoid the bounds check.
if (key_type->Min() >= 0 && key_type->Max() < array->length_value()) {
RelaxControls(node);
......
......@@ -782,13 +782,6 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArrayWithConversion) {
Matcher<Node*> value_matcher =
IsToNumber(value, context, effect, control);
Matcher<Node*> effect_matcher = value_matcher;
if (AccessBuilder::ForTypedArrayElement(type, true)
.type->Is(Type::Signed32())) {
value_matcher = IsNumberToInt32(value_matcher);
} else if (AccessBuilder::ForTypedArrayElement(type, true)
.type->Is(Type::Unsigned32())) {
value_matcher = IsNumberToUint32(value_matcher);
}
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment