Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: src/compiler/representation-change.cc

Issue 2738483002: [turbofan] Introduce TruncateTaggedPointerToBit operator. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/representation-change.cc
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc
index 4b4f8c91c65e0cd8b36ac548077125939e160ba5..6b532702958eda40cc9af09c70939e59580aa5fb 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -725,7 +725,14 @@ Node* RepresentationChanger::GetBitRepresentationFor(
// true is the only trueish Oddball.
op = simplified()->ChangeTaggedToBit();
} else {
- op = simplified()->TruncateTaggedToBit();
+ if (output_rep == MachineRepresentation::kTagged &&
+ output_type->Maybe(Type::SignedSmall())) {
+ op = simplified()->TruncateTaggedToBit();
+ } else {
+ // The {output_type} either doesn't include the Smi range,
+ // or the {output_rep} is known to be TaggedPointer.
+ op = simplified()->TruncateTaggedPointerToBit();
+ }
}
} else if (output_rep == MachineRepresentation::kTaggedSigned) {
node = jsgraph()->graph()->NewNode(machine()->WordEqual(), node,
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698