Commit 50c40a28 authored by Georgia Kouveli's avatar Georgia Kouveli Committed by Commit Bot

[ptr-compr] Do not use SMI upper bits in LowerArgumentsLength

Change-Id: Ie51d9d88fd1c13048557687fcf1a76435f776b9a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1856009Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/master@{#64767}
parent 0457bed1
......@@ -3560,8 +3560,8 @@ Node* EffectControlLinearizer::LowerArgumentsLength(Node* node) {
__ IntPtrConstant(ArgumentsAdaptorFrameConstants::kLengthOffset));
Node* rest_length =
__ IntSub(arguments_length, __ SmiConstant(formal_parameter_count));
__ GotoIf(__ IntLessThan(rest_length, __ SmiConstant(0)), &done,
__ SmiSub(arguments_length, __ SmiConstant(formal_parameter_count));
__ GotoIf(__ SmiLessThan(rest_length, __ SmiConstant(0)), &done,
__ SmiConstant(0));
__ Goto(&done, rest_length);
......
......@@ -431,6 +431,22 @@ Node* GraphAssembler::TaggedEqual(Node* left, Node* right) {
return WordEqual(left, right);
}
Node* GraphAssembler::SmiSub(Node* left, Node* right) {
if (COMPRESS_POINTERS_BOOL) {
return Int32Sub(ChangeTaggedToCompressed(left),
ChangeTaggedToCompressed(right));
}
return IntSub(left, right);
}
Node* GraphAssembler::SmiLessThan(Node* left, Node* right) {
if (COMPRESS_POINTERS_BOOL) {
return Int32LessThan(ChangeTaggedToCompressed(left),
ChangeTaggedToCompressed(right));
}
return IntLessThan(left, right);
}
Node* GraphAssembler::Float64RoundDown(Node* value) {
CHECK(machine()->Float64RoundDown().IsSupported());
return AddNode(graph()->NewNode(machine()->Float64RoundDown().op(), value));
......
......@@ -239,6 +239,9 @@ class GraphAssembler {
Node* IntPtrEqual(Node* left, Node* right);
Node* TaggedEqual(Node* left, Node* right);
Node* SmiSub(Node* left, Node* right);
Node* SmiLessThan(Node* left, Node* right);
Node* Float64RoundDown(Node* value);
Node* Float64RoundTruncate(Node* value);
......
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