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

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

Issue 2236443004: [turbofan] Introduce a dedicated ConvertTaggedHoleToUndefined operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix verify heap. 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/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/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 6e560dbffcc68634665cc073444ff94a2ab3bd2c..1759a30354876dbf78b1df594e6c033cc9477e59 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -2392,17 +2392,29 @@ class RepresentationSelector {
return;
}
case IrOpcode::kCheckTaggedHole: {
- CheckTaggedHoleMode mode = CheckTaggedHoleModeOf(node->op());
- if (truncation.IsUsedAsWord32() &&
- mode == CheckTaggedHoleMode::kConvertHoleToUndefined) {
- ProcessInput(node, 0, UseInfo::CheckedSigned32AsWord32());
- ProcessRemainingInputs(node, 1);
- SetOutput(node, MachineRepresentation::kWord32);
+ VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
+ return;
+ }
+ case IrOpcode::kConvertTaggedHoleToUndefined: {
+ if (InputIs(node, Type::NumberOrOddball()) &&
+ truncation.IsUsedAsWord32()) {
+ // Propagate the Word32 truncation.
+ VisitUnop(node, UseInfo::TruncatingWord32(),
+ MachineRepresentation::kWord32);
+ if (lower()) DeferReplacement(node, node->InputAt(0));
+ } else if (InputIs(node, Type::NumberOrOddball()) &&
+ truncation.IsUsedAsFloat64()) {
+ // Propagate the Float64 truncation.
+ VisitUnop(node, UseInfo::TruncatingFloat64(),
+ MachineRepresentation::kFloat64);
+ if (lower()) DeferReplacement(node, node->InputAt(0));
+ } else if (InputIs(node, Type::NonInternal())) {
+ VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
if (lower()) DeferReplacement(node, node->InputAt(0));
} else {
- ProcessInput(node, 0, UseInfo::AnyTagged());
- ProcessRemainingInputs(node, 1);
- SetOutput(node, MachineRepresentation::kTagged);
+ // TODO(turbofan): Add a (Tagged) truncation that identifies hole
+ // and undefined, i.e. for a[i] === obj cases.
+ VisitUnop(node, UseInfo::AnyTagged(), MachineRepresentation::kTagged);
}
return;
}
« 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