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

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

Issue 2082523002: [turbofan] Introduce CheckTaggedSigned and CheckTaggedPointer operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile Created 4 years, 6 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/operator.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/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 4810ede877954dcf41b204803b1e76ba822156b4..50b220ba74a9f46f97af580c1add78954da24ab1 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -672,7 +672,7 @@ class RepresentationSelector {
Type* GetUpperBound(Node* node) { return NodeProperties::GetType(node); }
bool InputIs(Node* node, Type* type) {
- DCHECK_EQ(1, node->InputCount());
+ DCHECK_EQ(1, node->op()->ValueInputCount());
return GetUpperBound(node->InputAt(0))->Is(type);
}
@@ -772,8 +772,9 @@ class RepresentationSelector {
// Helper for unops of the I -> O variety.
void VisitUnop(Node* node, UseInfo input_use, MachineRepresentation output) {
- DCHECK_EQ(1, node->InputCount());
+ DCHECK_EQ(1, node->op()->ValueInputCount());
ProcessInput(node, 0, input_use);
+ ProcessRemainingInputs(node, 1);
SetOutput(node, output);
}
@@ -1669,6 +1670,31 @@ class RepresentationSelector {
UseInfo::TruncatingWord32(), MachineRepresentation::kWord32);
return;
}
+ case IrOpcode::kCheckTaggedPointer: {
+ VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ if (lower()) {
+ if (InputIs(node, Type::TaggedPointer())) {
+ DeferReplacement(node, node->InputAt(0));
+ }
+ }
+ return;
+ }
+ case IrOpcode::kCheckTaggedSigned: {
+ if (SmiValuesAre32Bits() && truncation.TruncatesToWord32()) {
+ // TODO(jarin,bmeurer): Add CheckedSignedSmallAsWord32?
+ VisitUnop(node, UseInfo::CheckedSigned32AsWord32(),
+ MachineRepresentation::kWord32);
+ DeferReplacement(node, node->InputAt(0));
+ } else {
+ VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ if (lower()) {
+ if (InputIs(node, Type::TaggedSigned())) {
+ DeferReplacement(node, node->InputAt(0));
+ }
+ }
+ }
+ return;
+ }
case IrOpcode::kAllocate: {
ProcessInput(node, 0, UseInfo::TruncatingWord32());
« no previous file with comments | « src/compiler/operator.h ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698