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

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

Issue 2066223002: [turbofan] Introduce CheckHole and CheckHoleNaN operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Blacklist test 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/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 a5dbad2750171f8b7615694d9597c4a4dfef0463..151ca1f217ada4c9f0b36af69e8ced24ecf304de 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1446,57 +1446,6 @@ class RepresentationSelector {
if (lower()) DeferReplacement(node, node->InputAt(0));
return;
}
- case IrOpcode::kNumberIsHoleNaN: {
- VisitUnop(node, UseInfo::TruncatingFloat64(),
- MachineRepresentation::kBit);
- if (lower()) {
- // NumberIsHoleNaN(x) => Word32Equal(Float64ExtractHighWord32(x),
- // #HoleNanUpper32)
- node->ReplaceInput(
- 0, jsgraph_->graph()->NewNode(
- lowering->machine()->Float64ExtractHighWord32(),
- node->InputAt(0)));
- node->AppendInput(jsgraph_->zone(),
- jsgraph_->Int32Constant(kHoleNanUpper32));
- NodeProperties::ChangeOp(node, jsgraph_->machine()->Word32Equal());
- }
- return;
- }
- case IrOpcode::kNumberConvertHoleNaN: {
- if (truncation.TruncatesToFloat64()) {
- // NumberConvertHoleNaN(x) => x
- VisitUnop(node, UseInfo::TruncatingFloat64(),
- MachineRepresentation::kFloat64);
- if (lower()) DeferReplacement(node, node->InputAt(0));
- } else {
- VisitUnop(node, UseInfo::TruncatingFloat64(),
- MachineRepresentation::kTagged);
- if (lower()) {
- // NumberConvertHoleNaN(x) =>
- // Select(Word32Equal(Float64ExtractHighWord32(x),
- // #HoleNanUpper32),
- // #Undefined,
- // ChangeFloat64ToTagged(x))
- Node* value = node->InputAt(0);
- node->ReplaceInput(
- 0,
- jsgraph_->graph()->NewNode(
- jsgraph_->machine()->Word32Equal(),
- jsgraph_->graph()->NewNode(
- jsgraph_->machine()->Float64ExtractHighWord32(), value),
- jsgraph_->Int32Constant(kHoleNanUpper32)));
- node->AppendInput(jsgraph_->zone(), jsgraph_->UndefinedConstant());
- node->AppendInput(
- jsgraph_->zone(),
- jsgraph_->graph()->NewNode(
- jsgraph_->simplified()->ChangeFloat64ToTagged(), value));
- NodeProperties::ChangeOp(
- node, jsgraph_->common()->Select(MachineRepresentation::kTagged,
- BranchHint::kFalse));
- }
- }
- return;
- }
case IrOpcode::kReferenceEqual: {
VisitBinop(node, UseInfo::AnyTagged(), MachineRepresentation::kBit);
if (lower()) {
@@ -1738,6 +1687,23 @@ class RepresentationSelector {
SetOutput(node, MachineRepresentation::kBit);
return;
}
+ case IrOpcode::kCheckFloat64Hole: {
+ CheckFloat64HoleMode mode = CheckFloat64HoleModeOf(node->op());
+ ProcessInput(node, 0, UseInfo::TruncatingFloat64());
+ ProcessRemainingInputs(node, 1);
+ SetOutput(node, MachineRepresentation::kFloat64);
+ if (truncation.TruncatesToFloat64() &&
+ mode == CheckFloat64HoleMode::kAllowReturnHole) {
+ if (lower()) DeferReplacement(node, node->InputAt(0));
+ }
+ return;
+ }
+ case IrOpcode::kCheckTaggedHole: {
+ ProcessInput(node, 0, UseInfo::AnyTagged());
+ ProcessRemainingInputs(node, 1);
+ SetOutput(node, MachineRepresentation::kTagged);
+ return;
+ }
//------------------------------------------------------------------
// Machine-level operators.
« 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