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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 2201073002: [turbofan] Adds speculative operator for bitwise and, or and xor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handles kSigned32 feedback. Created 4 years, 4 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/representation-change.cc ('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/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 927f3edd842e2101b7edb0dbe5a18a001375412d..05b3f254deaffc1a7c2b17bb5bd56fe2f8831d33 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -776,6 +776,23 @@ class RepresentationSelector {
VisitBinop(node, input_use, input_use, output, restriction_type);
}
+ void VisitSpeculativeInt32Binop(Node* node) {
+ DCHECK_EQ(2, node->op()->ValueInputCount());
+ if (BothInputsAre(node, Type::NumberOrOddball())) {
+ return VisitBinop(node, UseInfo::TruncatingWord32(),
+ MachineRepresentation::kWord32);
+ }
+ BinaryOperationHints::Hint hint = BinaryOperationHintOf(node->op());
+ if (hint == BinaryOperationHints::kSignedSmall ||
+ hint == BinaryOperationHints::kSigned32) {
+ return VisitBinop(node, UseInfo::CheckedSigned32AsWord32(),
+ MachineRepresentation::kWord32);
+ }
+ DCHECK_EQ(BinaryOperationHints::kNumberOrOddball, hint);
+ VisitBinop(node, UseInfo::CheckedNumberOrOddballAsWord32(),
+ MachineRepresentation::kWord32, Type::Signed32());
+ }
+
// Helper for unops of the I -> O variety.
void VisitUnop(Node* node, UseInfo input_use, MachineRepresentation output) {
DCHECK_EQ(1, node->op()->ValueInputCount());
@@ -1666,6 +1683,14 @@ class RepresentationSelector {
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
return;
}
+ case IrOpcode::kSpeculativeNumberBitwiseOr:
+ case IrOpcode::kSpeculativeNumberBitwiseXor:
+ case IrOpcode::kSpeculativeNumberBitwiseAnd:
+ VisitSpeculativeInt32Binop(node);
+ if (lower()) {
+ ChangeToPureOp(node, Int32Op(node));
+ }
+ return;
case IrOpcode::kNumberShiftLeft: {
Type* rhs_type = GetUpperBound(node->InputAt(1));
VisitBinop(node, UseInfo::TruncatingWord32(),
« no previous file with comments | « src/compiler/representation-change.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698