Commit dc76a4da authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[ptr-compr] Add method that checks sminess in 32 bits

If we are sure that we are dealing with a Compressed value, we can check
for sminess in 32 bits.

Cq-Include-Trybots: luci.v8.try:v8_linux64_pointer_compression_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Bug: v8:7703
Change-Id: Icf77d8bcd1decfd392b4887241a9b559f11814c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1718146Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62940}
parent 35a61355
...@@ -239,6 +239,7 @@ class EffectControlLinearizer { ...@@ -239,6 +239,7 @@ class EffectControlLinearizer {
Node* ChangeSmiToInt32(Node* value); Node* ChangeSmiToInt32(Node* value);
Node* ChangeSmiToInt64(Node* value); Node* ChangeSmiToInt64(Node* value);
Node* ObjectIsSmi(Node* value); Node* ObjectIsSmi(Node* value);
Node* CompressedObjectIsSmi(Node* value);
Node* LoadFromSeqString(Node* receiver, Node* position, Node* is_one_byte); Node* LoadFromSeqString(Node* receiver, Node* position, Node* is_one_byte);
Node* SmiMaxValueConstant(); Node* SmiMaxValueConstant();
...@@ -1711,7 +1712,7 @@ Node* EffectControlLinearizer::LowerChangeCompressedToTaggedSigned(Node* node) { ...@@ -1711,7 +1712,7 @@ Node* EffectControlLinearizer::LowerChangeCompressedToTaggedSigned(Node* node) {
auto if_not_smi = __ MakeDeferredLabel(); auto if_not_smi = __ MakeDeferredLabel();
auto done = __ MakeLabel(MachineRepresentation::kWord32); auto done = __ MakeLabel(MachineRepresentation::kWord32);
Node* check = ObjectIsSmi(value); Node* check = CompressedObjectIsSmi(value);
__ GotoIfNot(check, &if_not_smi); __ GotoIfNot(check, &if_not_smi);
__ Goto(&done, __ ChangeCompressedSignedToTaggedSigned(value)); __ Goto(&done, __ ChangeCompressedSignedToTaggedSigned(value));
...@@ -2840,7 +2841,7 @@ Node* EffectControlLinearizer::LowerCheckedCompressedToTaggedSigned( ...@@ -2840,7 +2841,7 @@ Node* EffectControlLinearizer::LowerCheckedCompressedToTaggedSigned(
Node* value = node->InputAt(0); Node* value = node->InputAt(0);
const CheckParameters& params = CheckParametersOf(node->op()); const CheckParameters& params = CheckParametersOf(node->op());
Node* check = ObjectIsSmi(value); Node* check = CompressedObjectIsSmi(value);
__ DeoptimizeIfNot(DeoptimizeReason::kNotASmi, params.feedback(), check, __ DeoptimizeIfNot(DeoptimizeReason::kNotASmi, params.feedback(), check,
frame_state); frame_state);
...@@ -2852,7 +2853,7 @@ Node* EffectControlLinearizer::LowerCheckedCompressedToTaggedPointer( ...@@ -2852,7 +2853,7 @@ Node* EffectControlLinearizer::LowerCheckedCompressedToTaggedPointer(
Node* value = node->InputAt(0); Node* value = node->InputAt(0);
const CheckParameters& params = CheckParametersOf(node->op()); const CheckParameters& params = CheckParametersOf(node->op());
Node* check = ObjectIsSmi(value); Node* check = CompressedObjectIsSmi(value);
__ DeoptimizeIf(DeoptimizeReason::kSmi, params.feedback(), check, __ DeoptimizeIf(DeoptimizeReason::kSmi, params.feedback(), check,
frame_state); frame_state);
return __ ChangeCompressedPointerToTaggedPointer(value); return __ ChangeCompressedPointerToTaggedPointer(value);
...@@ -4547,6 +4548,11 @@ Node* EffectControlLinearizer::ObjectIsSmi(Node* value) { ...@@ -4547,6 +4548,11 @@ Node* EffectControlLinearizer::ObjectIsSmi(Node* value) {
__ IntPtrConstant(kSmiTag)); __ IntPtrConstant(kSmiTag));
} }
Node* EffectControlLinearizer::CompressedObjectIsSmi(Node* value) {
return __ Word32Equal(__ Word32And(value, __ Int32Constant(kSmiTagMask)),
__ Int32Constant(kSmiTag));
}
Node* EffectControlLinearizer::SmiMaxValueConstant() { Node* EffectControlLinearizer::SmiMaxValueConstant() {
return __ Int32Constant(Smi::kMaxValue); return __ Int32Constant(Smi::kMaxValue);
} }
...@@ -5906,7 +5912,11 @@ Node* EffectControlLinearizer::LowerFindOrderedHashMapEntryForInt32Key( ...@@ -5906,7 +5912,11 @@ Node* EffectControlLinearizer::LowerFindOrderedHashMapEntryForInt32Key(
auto if_match = __ MakeLabel(); auto if_match = __ MakeLabel();
auto if_notmatch = __ MakeLabel(); auto if_notmatch = __ MakeLabel();
auto if_notsmi = __ MakeDeferredLabel(); auto if_notsmi = __ MakeDeferredLabel();
if (COMPRESS_POINTERS_BOOL) {
__ GotoIfNot(CompressedObjectIsSmi(candidate_key), &if_notsmi);
} else {
__ GotoIfNot(ObjectIsSmi(candidate_key), &if_notsmi); __ GotoIfNot(ObjectIsSmi(candidate_key), &if_notsmi);
}
__ Branch(__ Word32Equal(ChangeSmiToInt32(candidate_key), key), &if_match, __ Branch(__ Word32Equal(ChangeSmiToInt32(candidate_key), key), &if_match,
&if_notmatch); &if_notmatch);
......
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