Index: test/unittests/compiler/scheduler-unittest.cc |
diff --git a/test/unittests/compiler/scheduler-unittest.cc b/test/unittests/compiler/scheduler-unittest.cc |
index eeb5bbc4d69f5cca84cd918c1bac3f38cedef4d7..ba2e0b0c65b84ea62e1f97a685d7e2bbf9388c4c 100644 |
--- a/test/unittests/compiler/scheduler-unittest.cc |
+++ b/test/unittests/compiler/scheduler-unittest.cc |
@@ -24,7 +24,7 @@ namespace v8 { |
namespace internal { |
namespace compiler { |
-class SchedulerTest : public TestWithZone { |
+class SchedulerTest : public TestWithIsolateAndZone { |
public: |
SchedulerTest() |
: graph_(zone()), common_(zone()), simplified_(zone()), js_(zone()) {} |
@@ -673,9 +673,9 @@ TEST_F(SchedulerTest, BuildScheduleIfSplit) { |
TEST_F(SchedulerTest, BuildScheduleIfSplitWithEffects) { |
- FLAG_turbo_deoptimization = false; |
- |
const Operator* op; |
+ Unique<HeapObject> unique_constant = |
+ Unique<HeapObject>::CreateImmovable(factory()->undefined_value()); |
// Manually transcripted code for: |
// function turbo_fan_test(a, b, c, y) { |
@@ -685,135 +685,216 @@ TEST_F(SchedulerTest, BuildScheduleIfSplitWithEffects) { |
// return c * c - a; |
// } |
// } |
- op = common()->Start(0); |
- Node* n0 = graph()->NewNode(op); |
- USE(n0); |
Node* nil = graph()->NewNode(common()->Dead()); |
op = common()->End(); |
- Node* n23 = graph()->NewNode(op, nil); |
- USE(n23); |
+ Node* n39 = graph()->NewNode(op, nil); |
+ USE(n39); |
op = common()->Merge(2); |
- Node* n22 = graph()->NewNode(op, nil, nil); |
- USE(n22); |
+ Node* n37 = graph()->NewNode(op, nil, nil); |
+ USE(n37); |
op = common()->Return(); |
- Node* n16 = graph()->NewNode(op, nil, nil, nil); |
- USE(n16); |
+ Node* n29 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n29); |
+ op = common()->Return(); |
+ Node* n36 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n36); |
op = js()->Add(); |
- Node* n15 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n15); |
+ Node* n27 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n27); |
+ op = common()->IfSuccess(); |
+ Node* n28 = graph()->NewNode(op, nil); |
+ USE(n28); |
op = js()->Subtract(); |
- Node* n14 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n14); |
+ Node* n34 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n34); |
+ op = common()->IfSuccess(); |
+ Node* n35 = graph()->NewNode(op, nil); |
+ USE(n35); |
op = js()->Subtract(); |
+ Node* n25 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n25); |
+ op = common()->Parameter(4); |
+ Node* n5 = graph()->NewNode(op, nil); |
+ USE(n5); |
+ op = common()->Parameter(5); |
+ Node* n7 = graph()->NewNode(op, nil); |
+ USE(n7); |
+ op = common()->FrameState(JS_FRAME, BailoutId(-1), |
+ OutputFrameStateCombine::Ignore()); |
Node* n13 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
USE(n13); |
- op = js()->Add(); |
- Node* n11 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n11); |
- op = common()->Parameter(0); |
- Node* n2 = graph()->NewNode(op, n0); |
+ op = common()->IfSuccess(); |
+ Node* n26 = graph()->NewNode(op, nil); |
+ USE(n26); |
+ op = js()->Multiply(); |
+ Node* n32 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n32); |
+ op = common()->Parameter(1); |
+ Node* n2 = graph()->NewNode(op, nil); |
USE(n2); |
- n11->ReplaceInput(0, n2); |
- op = common()->Parameter(0); |
- Node* n3 = graph()->NewNode(op, n0); |
- USE(n3); |
- n11->ReplaceInput(1, n3); |
- op = &kHeapConstant; |
- Node* n7 = graph()->NewNode(op); |
- USE(n7); |
- n11->ReplaceInput(2, n7); |
+ op = common()->IfSuccess(); |
+ Node* n33 = graph()->NewNode(op, nil); |
+ USE(n33); |
+ op = js()->Subtract(); |
+ Node* n23 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n23); |
+ op = common()->IfSuccess(); |
+ Node* n24 = graph()->NewNode(op, nil); |
+ USE(n24); |
+ op = common()->Start(4); |
+ Node* n0 = graph()->NewNode(op); |
+ USE(n0); |
+ op = common()->StateValues(0); |
+ Node* n11 = graph()->NewNode(op); |
+ USE(n11); |
+ op = common()->NumberConstant(0); |
+ Node* n12 = graph()->NewNode(op); |
+ USE(n12); |
+ op = common()->HeapConstant(unique_constant); |
+ Node* n6 = graph()->NewNode(op); |
+ USE(n6); |
+ op = common()->Parameter(3); |
+ Node* n4 = graph()->NewNode(op, nil); |
+ USE(n4); |
op = js()->LessThan(); |
- Node* n8 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n8); |
- n8->ReplaceInput(0, n2); |
- n8->ReplaceInput(1, n3); |
- n8->ReplaceInput(2, n7); |
- n8->ReplaceInput(3, n0); |
- n8->ReplaceInput(4, n0); |
- n11->ReplaceInput(3, n8); |
- op = common()->IfTrue(); |
+ Node* n15 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n15); |
+ op = common()->IfFalse(); |
+ Node* n31 = graph()->NewNode(op, nil); |
+ USE(n31); |
+ op = js()->Add(); |
+ Node* n19 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n19); |
+ op = js()->Multiply(); |
+ Node* n21 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n21); |
+ op = common()->IfSuccess(); |
+ Node* n22 = graph()->NewNode(op, nil); |
+ USE(n22); |
+ op = common()->Parameter(2); |
+ Node* n3 = graph()->NewNode(op, nil); |
+ USE(n3); |
+ op = js()->StackCheck(); |
+ Node* n9 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n9); |
+ op = common()->IfSuccess(); |
Node* n10 = graph()->NewNode(op, nil); |
USE(n10); |
op = common()->Branch(); |
- Node* n9 = graph()->NewNode(op, nil, nil); |
- USE(n9); |
- n9->ReplaceInput(0, n8); |
- n9->ReplaceInput(1, n0); |
- n10->ReplaceInput(0, n9); |
- n11->ReplaceInput(4, n10); |
+ Node* n17 = graph()->NewNode(op, nil, nil); |
+ USE(n17); |
+ op = common()->IfTrue(); |
+ Node* n18 = graph()->NewNode(op, nil); |
+ USE(n18); |
+ op = common()->IfSuccess(); |
+ Node* n20 = graph()->NewNode(op, nil); |
+ USE(n20); |
+ op = common()->IfSuccess(); |
+ Node* n16 = graph()->NewNode(op, nil); |
+ USE(n16); |
+ n39->ReplaceInput(0, n37); |
+ n37->ReplaceInput(0, n29); |
+ n37->ReplaceInput(1, n36); |
+ n29->ReplaceInput(0, n27); |
+ n29->ReplaceInput(1, n27); |
+ n29->ReplaceInput(2, n28); |
+ n36->ReplaceInput(0, n34); |
+ n36->ReplaceInput(1, n34); |
+ n36->ReplaceInput(2, n35); |
+ n27->ReplaceInput(0, n25); |
+ n27->ReplaceInput(1, n5); |
+ n27->ReplaceInput(2, n7); |
+ n27->ReplaceInput(3, n13); |
+ n27->ReplaceInput(4, n13); |
+ n27->ReplaceInput(5, n25); |
+ n27->ReplaceInput(6, n26); |
+ n28->ReplaceInput(0, n27); |
+ n34->ReplaceInput(0, n32); |
+ n34->ReplaceInput(1, n2); |
+ n34->ReplaceInput(2, n7); |
+ n34->ReplaceInput(3, n13); |
+ n34->ReplaceInput(4, n13); |
+ n34->ReplaceInput(5, n32); |
+ n34->ReplaceInput(6, n33); |
+ n35->ReplaceInput(0, n34); |
+ n25->ReplaceInput(0, n23); |
+ n25->ReplaceInput(1, n2); |
+ n25->ReplaceInput(2, n7); |
+ n25->ReplaceInput(3, n13); |
+ n25->ReplaceInput(4, n13); |
+ n25->ReplaceInput(5, n23); |
+ n25->ReplaceInput(6, n24); |
+ n5->ReplaceInput(0, n0); |
+ n7->ReplaceInput(0, n0); |
n13->ReplaceInput(0, n11); |
- op = js()->Multiply(); |
- Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n12); |
- op = common()->Parameter(0); |
- Node* n4 = graph()->NewNode(op, n0); |
- USE(n4); |
- n12->ReplaceInput(0, n4); |
- n12->ReplaceInput(1, n4); |
- n12->ReplaceInput(2, n7); |
- n12->ReplaceInput(3, n11); |
- n12->ReplaceInput(4, n10); |
- n13->ReplaceInput(1, n12); |
- n13->ReplaceInput(2, n7); |
+ n13->ReplaceInput(1, n11); |
+ n13->ReplaceInput(2, n11); |
n13->ReplaceInput(3, n12); |
- n13->ReplaceInput(4, n10); |
- n14->ReplaceInput(0, n13); |
- n14->ReplaceInput(1, n2); |
- n14->ReplaceInput(2, n7); |
- n14->ReplaceInput(3, n13); |
- n14->ReplaceInput(4, n10); |
- n15->ReplaceInput(0, n14); |
- op = common()->Parameter(0); |
- Node* n5 = graph()->NewNode(op, n0); |
- USE(n5); |
- n15->ReplaceInput(1, n5); |
+ n13->ReplaceInput(4, n6); |
+ n26->ReplaceInput(0, n25); |
+ n32->ReplaceInput(0, n4); |
+ n32->ReplaceInput(1, n4); |
+ n32->ReplaceInput(2, n7); |
+ n32->ReplaceInput(3, n13); |
+ n32->ReplaceInput(4, n13); |
+ n32->ReplaceInput(5, n15); |
+ n32->ReplaceInput(6, n31); |
+ n2->ReplaceInput(0, n0); |
+ n33->ReplaceInput(0, n32); |
+ n23->ReplaceInput(0, n19); |
+ n23->ReplaceInput(1, n21); |
+ n23->ReplaceInput(2, n7); |
+ n23->ReplaceInput(3, n13); |
+ n23->ReplaceInput(4, n13); |
+ n23->ReplaceInput(5, n21); |
+ n23->ReplaceInput(6, n22); |
+ n24->ReplaceInput(0, n23); |
+ n4->ReplaceInput(0, n0); |
+ n15->ReplaceInput(0, n2); |
+ n15->ReplaceInput(1, n3); |
n15->ReplaceInput(2, n7); |
- n15->ReplaceInput(3, n14); |
- n15->ReplaceInput(4, n10); |
- n16->ReplaceInput(0, n15); |
- n16->ReplaceInput(1, n15); |
- n16->ReplaceInput(2, n10); |
- n22->ReplaceInput(0, n16); |
- op = common()->Return(); |
- Node* n21 = graph()->NewNode(op, nil, nil, nil); |
- USE(n21); |
- op = js()->Subtract(); |
- Node* n20 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n20); |
- op = js()->Multiply(); |
- Node* n19 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n19); |
- n19->ReplaceInput(0, n4); |
- n19->ReplaceInput(1, n4); |
+ n15->ReplaceInput(3, n13); |
+ n15->ReplaceInput(4, n9); |
+ n15->ReplaceInput(5, n10); |
+ n31->ReplaceInput(0, n17); |
+ n19->ReplaceInput(0, n2); |
+ n19->ReplaceInput(1, n3); |
n19->ReplaceInput(2, n7); |
- n19->ReplaceInput(3, n8); |
- op = common()->IfFalse(); |
- Node* n18 = graph()->NewNode(op, nil); |
- USE(n18); |
- n18->ReplaceInput(0, n9); |
- n19->ReplaceInput(4, n18); |
+ n19->ReplaceInput(3, n13); |
+ n19->ReplaceInput(4, n13); |
+ n19->ReplaceInput(5, n15); |
+ n19->ReplaceInput(6, n18); |
+ n21->ReplaceInput(0, n4); |
+ n21->ReplaceInput(1, n4); |
+ n21->ReplaceInput(2, n7); |
+ n21->ReplaceInput(3, n13); |
+ n21->ReplaceInput(4, n13); |
+ n21->ReplaceInput(5, n19); |
+ n21->ReplaceInput(6, n20); |
+ n22->ReplaceInput(0, n21); |
+ n3->ReplaceInput(0, n0); |
+ n9->ReplaceInput(0, n7); |
+ n9->ReplaceInput(1, n13); |
+ n9->ReplaceInput(2, n0); |
+ n9->ReplaceInput(3, n0); |
+ n10->ReplaceInput(0, n9); |
+ n17->ReplaceInput(0, n15); |
+ n17->ReplaceInput(1, n16); |
+ n18->ReplaceInput(0, n17); |
n20->ReplaceInput(0, n19); |
- n20->ReplaceInput(1, n2); |
- n20->ReplaceInput(2, n7); |
- n20->ReplaceInput(3, n19); |
- n20->ReplaceInput(4, n18); |
- n21->ReplaceInput(0, n20); |
- n21->ReplaceInput(1, n20); |
- n21->ReplaceInput(2, n18); |
- n22->ReplaceInput(1, n21); |
- n23->ReplaceInput(0, n22); |
+ n16->ReplaceInput(0, n15); |
graph()->SetStart(n0); |
- graph()->SetEnd(n23); |
+ graph()->SetEnd(n39); |
- ComputeAndVerifySchedule(20); |
+ ComputeAndVerifySchedule(34); |
} |
TEST_F(SchedulerTest, BuildScheduleSimpleLoop) { |
- FLAG_turbo_deoptimization = false; |
- |
const Operator* op; |
+ Unique<HeapObject> unique_constant = |
+ Unique<HeapObject>::CreateImmovable(factory()->undefined_value()); |
// Manually transcripted code for: |
// function turbo_fan_test(a, b) { |
@@ -822,103 +903,161 @@ TEST_F(SchedulerTest, BuildScheduleSimpleLoop) { |
// } |
// return a; |
// } |
- op = common()->Start(0); |
- Node* n0 = graph()->NewNode(op); |
- USE(n0); |
Node* nil = graph()->NewNode(common()->Dead()); |
op = common()->End(); |
- Node* n20 = graph()->NewNode(op, nil); |
- USE(n20); |
+ Node* n34 = graph()->NewNode(op, nil); |
+ USE(n34); |
op = common()->Return(); |
- Node* n19 = graph()->NewNode(op, nil, nil, nil); |
- USE(n19); |
+ Node* n32 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n32); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n8 = graph()->NewNode(op, nil, nil, nil); |
- USE(n8); |
- op = common()->Parameter(0); |
- Node* n2 = graph()->NewNode(op, n0); |
+ Node* n13 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n13); |
+ op = js()->LessThan(); |
+ Node* n16 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n16); |
+ op = common()->IfFalse(); |
+ Node* n22 = graph()->NewNode(op, nil); |
+ USE(n22); |
+ op = common()->Parameter(1); |
+ Node* n2 = graph()->NewNode(op, nil); |
USE(n2); |
- n8->ReplaceInput(0, n2); |
op = js()->Add(); |
- Node* n18 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n18); |
- op = js()->ToNumber(); |
- Node* n16 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n16); |
- n16->ReplaceInput(0, n8); |
- op = &kHeapConstant; |
- Node* n5 = graph()->NewNode(op); |
- USE(n5); |
- n16->ReplaceInput(1, n5); |
- op = js()->LessThan(); |
- Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ Node* n29 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n29); |
+ op = common()->Loop(2); |
+ Node* n12 = graph()->NewNode(op, nil, nil); |
USE(n12); |
- n12->ReplaceInput(0, n8); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n9 = graph()->NewNode(op, nil, nil, nil); |
- USE(n9); |
- op = common()->Parameter(0); |
- Node* n3 = graph()->NewNode(op, n0); |
+ op = common()->Parameter(2); |
+ Node* n3 = graph()->NewNode(op, nil); |
USE(n3); |
- n9->ReplaceInput(0, n3); |
- n9->ReplaceInput(1, n9); |
- op = common()->Loop(2); |
- Node* n6 = graph()->NewNode(op, nil, nil); |
- USE(n6); |
- n6->ReplaceInput(0, n0); |
- op = common()->IfTrue(); |
- Node* n14 = graph()->NewNode(op, nil); |
+ op = common()->Parameter(3); |
+ Node* n5 = graph()->NewNode(op, nil); |
+ USE(n5); |
+ op = common()->FrameState(JS_FRAME, BailoutId(-1), |
+ OutputFrameStateCombine::Ignore()); |
+ Node* n11 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n11); |
+ op = common()->EffectPhi(2); |
+ Node* n14 = graph()->NewNode(op, nil, nil, nil); |
USE(n14); |
op = common()->Branch(); |
- Node* n13 = graph()->NewNode(op, nil, nil); |
- USE(n13); |
- n13->ReplaceInput(0, n12); |
- n13->ReplaceInput(1, n6); |
- n14->ReplaceInput(0, n13); |
- n6->ReplaceInput(1, n14); |
- n9->ReplaceInput(2, n6); |
- n12->ReplaceInput(1, n9); |
- n12->ReplaceInput(2, n5); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n10 = graph()->NewNode(op, nil, nil, nil); |
- USE(n10); |
- n10->ReplaceInput(0, n0); |
- n10->ReplaceInput(1, n18); |
- n10->ReplaceInput(2, n6); |
- n12->ReplaceInput(3, n10); |
- n12->ReplaceInput(4, n6); |
- n16->ReplaceInput(2, n12); |
- n16->ReplaceInput(3, n14); |
- n18->ReplaceInput(0, n16); |
+ Node* n19 = graph()->NewNode(op, nil, nil); |
+ USE(n19); |
+ op = common()->Start(2); |
+ Node* n0 = graph()->NewNode(op); |
+ USE(n0); |
+ op = js()->ToNumber(); |
+ Node* n26 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n26); |
+ op = common()->NumberConstant(1); |
+ Node* n28 = graph()->NewNode(op); |
+ USE(n28); |
+ op = common()->IfSuccess(); |
+ Node* n27 = graph()->NewNode(op, nil); |
+ USE(n27); |
+ op = common()->IfSuccess(); |
+ Node* n8 = graph()->NewNode(op, nil); |
+ USE(n8); |
+ op = common()->IfSuccess(); |
+ Node* n30 = graph()->NewNode(op, nil); |
+ USE(n30); |
+ op = common()->StateValues(0); |
+ Node* n9 = graph()->NewNode(op); |
+ USE(n9); |
op = common()->NumberConstant(0); |
- Node* n17 = graph()->NewNode(op); |
+ Node* n10 = graph()->NewNode(op); |
+ USE(n10); |
+ op = common()->HeapConstant(unique_constant); |
+ Node* n4 = graph()->NewNode(op); |
+ USE(n4); |
+ op = js()->StackCheck(); |
+ Node* n7 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n7); |
+ op = js()->ToBoolean(); |
+ Node* n18 = graph()->NewNode(op, nil, nil); |
+ USE(n18); |
+ op = common()->IfSuccess(); |
+ Node* n17 = graph()->NewNode(op, nil); |
USE(n17); |
- n18->ReplaceInput(1, n17); |
- n18->ReplaceInput(2, n5); |
- n18->ReplaceInput(3, n16); |
- n18->ReplaceInput(4, n14); |
- n8->ReplaceInput(1, n18); |
- n8->ReplaceInput(2, n6); |
- n19->ReplaceInput(0, n8); |
- n19->ReplaceInput(1, n12); |
- op = common()->IfFalse(); |
- Node* n15 = graph()->NewNode(op, nil); |
- USE(n15); |
- n15->ReplaceInput(0, n13); |
- n19->ReplaceInput(2, n15); |
+ op = js()->StackCheck(); |
+ Node* n24 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n24); |
+ op = common()->IfSuccess(); |
+ Node* n25 = graph()->NewNode(op, nil); |
+ USE(n25); |
+ op = common()->IfTrue(); |
+ Node* n20 = graph()->NewNode(op, nil); |
+ USE(n20); |
+ n34->ReplaceInput(0, n32); |
+ n32->ReplaceInput(0, n13); |
+ n32->ReplaceInput(1, n16); |
+ n32->ReplaceInput(2, n22); |
+ n13->ReplaceInput(0, n2); |
+ n13->ReplaceInput(1, n29); |
+ n13->ReplaceInput(2, n12); |
+ n16->ReplaceInput(0, n13); |
+ n16->ReplaceInput(1, n3); |
+ n16->ReplaceInput(2, n5); |
+ n16->ReplaceInput(3, n11); |
+ n16->ReplaceInput(4, n14); |
+ n16->ReplaceInput(5, n12); |
+ n22->ReplaceInput(0, n19); |
+ n2->ReplaceInput(0, n0); |
+ n29->ReplaceInput(0, n26); |
+ n29->ReplaceInput(1, n28); |
+ n29->ReplaceInput(2, n5); |
+ n29->ReplaceInput(3, n11); |
+ n29->ReplaceInput(4, n11); |
+ n29->ReplaceInput(5, n26); |
+ n29->ReplaceInput(6, n27); |
+ n12->ReplaceInput(0, n8); |
+ n12->ReplaceInput(1, n30); |
+ n3->ReplaceInput(0, n0); |
+ n5->ReplaceInput(0, n0); |
+ n11->ReplaceInput(0, n9); |
+ n11->ReplaceInput(1, n9); |
+ n11->ReplaceInput(2, n9); |
+ n11->ReplaceInput(3, n10); |
+ n11->ReplaceInput(4, n4); |
+ n14->ReplaceInput(0, n7); |
+ n14->ReplaceInput(1, n29); |
+ n14->ReplaceInput(2, n12); |
+ n19->ReplaceInput(0, n18); |
+ n19->ReplaceInput(1, n17); |
+ n26->ReplaceInput(0, n13); |
+ n26->ReplaceInput(1, n5); |
+ n26->ReplaceInput(2, n11); |
+ n26->ReplaceInput(3, n24); |
+ n26->ReplaceInput(4, n25); |
+ n27->ReplaceInput(0, n26); |
+ n8->ReplaceInput(0, n7); |
+ n30->ReplaceInput(0, n29); |
+ n7->ReplaceInput(0, n5); |
+ n7->ReplaceInput(1, n11); |
+ n7->ReplaceInput(2, n0); |
+ n7->ReplaceInput(3, n0); |
+ n18->ReplaceInput(0, n16); |
+ n18->ReplaceInput(1, n5); |
+ n17->ReplaceInput(0, n16); |
+ n24->ReplaceInput(0, n5); |
+ n24->ReplaceInput(1, n11); |
+ n24->ReplaceInput(2, n16); |
+ n24->ReplaceInput(3, n20); |
+ n25->ReplaceInput(0, n24); |
n20->ReplaceInput(0, n19); |
graph()->SetStart(n0); |
- graph()->SetEnd(n20); |
+ graph()->SetEnd(n34); |
- ComputeAndVerifySchedule(19); |
+ ComputeAndVerifySchedule(30); |
} |
TEST_F(SchedulerTest, BuildScheduleComplexLoops) { |
- FLAG_turbo_deoptimization = false; |
- |
const Operator* op; |
+ Unique<HeapObject> unique_constant = |
+ Unique<HeapObject>::CreateImmovable(factory()->undefined_value()); |
// Manually transcripted code for: |
// function turbo_fan_test(a, b, c) { |
@@ -933,232 +1072,332 @@ TEST_F(SchedulerTest, BuildScheduleComplexLoops) { |
// } |
// return a; |
// } |
- op = common()->Start(0); |
- Node* n0 = graph()->NewNode(op); |
- USE(n0); |
Node* nil = graph()->NewNode(common()->Dead()); |
op = common()->End(); |
- Node* n46 = graph()->NewNode(op, nil); |
- USE(n46); |
+ Node* n71 = graph()->NewNode(op, nil); |
+ USE(n71); |
op = common()->Return(); |
- Node* n45 = graph()->NewNode(op, nil, nil, nil); |
- USE(n45); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n35 = graph()->NewNode(op, nil, nil, nil); |
- USE(n35); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n9 = graph()->NewNode(op, nil, nil, nil); |
- USE(n9); |
- op = common()->Parameter(0); |
- Node* n2 = graph()->NewNode(op, n0); |
- USE(n2); |
- n9->ReplaceInput(0, n2); |
+ Node* n69 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n69); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n23 = graph()->NewNode(op, nil, nil, nil); |
- USE(n23); |
- op = js()->Add(); |
- Node* n20 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n20); |
- op = js()->ToNumber(); |
- Node* n18 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n18); |
- n18->ReplaceInput(0, n9); |
- op = &kHeapConstant; |
- Node* n6 = graph()->NewNode(op); |
- USE(n6); |
- n18->ReplaceInput(1, n6); |
+ Node* n53 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n53); |
op = js()->LessThan(); |
- Node* n14 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n14); |
- n14->ReplaceInput(0, n9); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n10 = graph()->NewNode(op, nil, nil, nil); |
- USE(n10); |
- op = common()->Parameter(0); |
- Node* n3 = graph()->NewNode(op, n0); |
- USE(n3); |
- n10->ReplaceInput(0, n3); |
+ Node* n55 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n55); |
+ op = common()->IfFalse(); |
+ Node* n61 = graph()->NewNode(op, nil); |
+ USE(n61); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n24 = graph()->NewNode(op, nil, nil, nil); |
- USE(n24); |
- n24->ReplaceInput(0, n10); |
- n24->ReplaceInput(1, n24); |
+ Node* n14 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n14); |
+ op = js()->Add(); |
+ Node* n66 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n66); |
op = common()->Loop(2); |
- Node* n21 = graph()->NewNode(op, nil, nil); |
- USE(n21); |
- op = common()->IfTrue(); |
- Node* n16 = graph()->NewNode(op, nil); |
- USE(n16); |
+ Node* n52 = graph()->NewNode(op, nil, nil); |
+ USE(n52); |
+ op = common()->Parameter(2); |
+ Node* n3 = graph()->NewNode(op, nil); |
+ USE(n3); |
+ op = common()->Parameter(4); |
+ Node* n6 = graph()->NewNode(op, nil); |
+ USE(n6); |
+ op = common()->FrameState(JS_FRAME, BailoutId(-1), |
+ OutputFrameStateCombine::Ignore()); |
+ Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n12); |
+ op = common()->EffectPhi(2); |
+ Node* n54 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n54); |
op = common()->Branch(); |
- Node* n15 = graph()->NewNode(op, nil, nil); |
- USE(n15); |
- n15->ReplaceInput(0, n14); |
+ Node* n58 = graph()->NewNode(op, nil, nil); |
+ USE(n58); |
+ op = common()->Parameter(1); |
+ Node* n2 = graph()->NewNode(op, nil); |
+ USE(n2); |
+ op = js()->Add(); |
+ Node* n31 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n31); |
op = common()->Loop(2); |
- Node* n7 = graph()->NewNode(op, nil, nil); |
- USE(n7); |
- n7->ReplaceInput(0, n0); |
+ Node* n13 = graph()->NewNode(op, nil, nil); |
+ USE(n13); |
+ op = common()->NumberConstant(2); |
+ Node* n65 = graph()->NewNode(op); |
+ USE(n65); |
+ op = js()->StackCheck(); |
+ Node* n63 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n63); |
+ op = common()->IfSuccess(); |
+ Node* n64 = graph()->NewNode(op, nil); |
+ USE(n64); |
op = common()->IfFalse(); |
- Node* n30 = graph()->NewNode(op, nil); |
- USE(n30); |
- op = common()->Branch(); |
- Node* n28 = graph()->NewNode(op, nil, nil); |
- USE(n28); |
- op = js()->LessThan(); |
- Node* n27 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n27); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n25 = graph()->NewNode(op, nil, nil, nil); |
- USE(n25); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n11 = graph()->NewNode(op, nil, nil, nil); |
+ Node* n24 = graph()->NewNode(op, nil); |
+ USE(n24); |
+ op = common()->IfSuccess(); |
+ Node* n67 = graph()->NewNode(op, nil); |
+ USE(n67); |
+ op = common()->Start(3); |
+ Node* n0 = graph()->NewNode(op); |
+ USE(n0); |
+ op = common()->StateValues(0); |
+ Node* n10 = graph()->NewNode(op); |
+ USE(n10); |
+ op = common()->NumberConstant(0); |
+ Node* n11 = graph()->NewNode(op); |
USE(n11); |
- op = common()->Parameter(0); |
- Node* n4 = graph()->NewNode(op, n0); |
- USE(n4); |
- n11->ReplaceInput(0, n4); |
- n11->ReplaceInput(1, n25); |
- n11->ReplaceInput(2, n7); |
- n25->ReplaceInput(0, n11); |
- op = js()->Add(); |
- Node* n32 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n32); |
+ op = common()->HeapConstant(unique_constant); |
+ Node* n5 = graph()->NewNode(op); |
+ USE(n5); |
+ op = js()->LessThan(); |
+ Node* n18 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n18); |
+ op = js()->ToBoolean(); |
+ Node* n57 = graph()->NewNode(op, nil, nil); |
+ USE(n57); |
+ op = common()->IfSuccess(); |
+ Node* n56 = graph()->NewNode(op, nil); |
+ USE(n56); |
op = js()->ToNumber(); |
- Node* n31 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n31); |
- n31->ReplaceInput(0, n25); |
- n31->ReplaceInput(1, n6); |
- n31->ReplaceInput(2, n27); |
- op = common()->IfTrue(); |
+ Node* n28 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n28); |
+ op = common()->NumberConstant(1); |
+ Node* n30 = graph()->NewNode(op); |
+ USE(n30); |
+ op = common()->IfSuccess(); |
Node* n29 = graph()->NewNode(op, nil); |
USE(n29); |
- n29->ReplaceInput(0, n28); |
- n31->ReplaceInput(3, n29); |
- n32->ReplaceInput(0, n31); |
- op = common()->NumberConstant(0); |
- Node* n19 = graph()->NewNode(op); |
- USE(n19); |
- n32->ReplaceInput(1, n19); |
- n32->ReplaceInput(2, n6); |
- n32->ReplaceInput(3, n31); |
- n32->ReplaceInput(4, n29); |
- n25->ReplaceInput(1, n32); |
- n25->ReplaceInput(2, n21); |
- n27->ReplaceInput(0, n25); |
- n27->ReplaceInput(1, n24); |
- n27->ReplaceInput(2, n6); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n26 = graph()->NewNode(op, nil, nil, nil); |
+ op = common()->IfSuccess(); |
+ Node* n9 = graph()->NewNode(op, nil); |
+ USE(n9); |
+ op = common()->IfFalse(); |
+ Node* n42 = graph()->NewNode(op, nil); |
+ USE(n42); |
+ op = common()->IfTrue(); |
+ Node* n59 = graph()->NewNode(op, nil); |
+ USE(n59); |
+ op = common()->Branch(); |
+ Node* n21 = graph()->NewNode(op, nil, nil); |
+ USE(n21); |
+ op = common()->EffectPhi(2); |
+ Node* n16 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n16); |
+ op = js()->StackCheck(); |
+ Node* n26 = graph()->NewNode(op, nil, nil, nil, nil); |
USE(n26); |
- n26->ReplaceInput(0, n20); |
- n26->ReplaceInput(1, n32); |
- n26->ReplaceInput(2, n21); |
- n27->ReplaceInput(3, n26); |
- n27->ReplaceInput(4, n21); |
- n28->ReplaceInput(0, n27); |
- n28->ReplaceInput(1, n21); |
- n30->ReplaceInput(0, n28); |
- n7->ReplaceInput(1, n30); |
- n15->ReplaceInput(1, n7); |
- n16->ReplaceInput(0, n15); |
- n21->ReplaceInput(0, n16); |
- n21->ReplaceInput(1, n29); |
- n24->ReplaceInput(2, n21); |
- n10->ReplaceInput(1, n24); |
- n10->ReplaceInput(2, n7); |
- n14->ReplaceInput(1, n10); |
- n14->ReplaceInput(2, n6); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n12 = graph()->NewNode(op, nil, nil, nil); |
- USE(n12); |
- n12->ReplaceInput(0, n0); |
- n12->ReplaceInput(1, n27); |
- n12->ReplaceInput(2, n7); |
- n14->ReplaceInput(3, n12); |
- n14->ReplaceInput(4, n7); |
- n18->ReplaceInput(2, n14); |
- n18->ReplaceInput(3, n16); |
- n20->ReplaceInput(0, n18); |
- n20->ReplaceInput(1, n19); |
- n20->ReplaceInput(2, n6); |
- n20->ReplaceInput(3, n18); |
- n20->ReplaceInput(4, n16); |
- n23->ReplaceInput(0, n20); |
- n23->ReplaceInput(1, n23); |
- n23->ReplaceInput(2, n21); |
- n9->ReplaceInput(1, n23); |
- n9->ReplaceInput(2, n7); |
- n35->ReplaceInput(0, n9); |
- op = js()->Add(); |
- Node* n44 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n44); |
- n44->ReplaceInput(0, n35); |
- op = common()->NumberConstant(0); |
- Node* n43 = graph()->NewNode(op); |
- USE(n43); |
- n44->ReplaceInput(1, n43); |
- n44->ReplaceInput(2, n6); |
- op = js()->LessThan(); |
- Node* n39 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ op = common()->IfSuccess(); |
+ Node* n27 = graph()->NewNode(op, nil); |
+ USE(n27); |
+ op = js()->StackCheck(); |
+ Node* n8 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n8); |
+ op = common()->Branch(); |
+ Node* n39 = graph()->NewNode(op, nil, nil); |
USE(n39); |
- n39->ReplaceInput(0, n35); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n36 = graph()->NewNode(op, nil, nil, nil); |
+ op = js()->ToBoolean(); |
+ Node* n20 = graph()->NewNode(op, nil, nil); |
+ USE(n20); |
+ op = common()->IfSuccess(); |
+ Node* n19 = graph()->NewNode(op, nil); |
+ USE(n19); |
+ op = js()->LessThan(); |
+ Node* n36 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
USE(n36); |
- n36->ReplaceInput(0, n10); |
- n36->ReplaceInput(1, n36); |
+ op = common()->IfTrue(); |
+ Node* n22 = graph()->NewNode(op, nil); |
+ USE(n22); |
+ op = js()->ToBoolean(); |
+ Node* n38 = graph()->NewNode(op, nil, nil); |
+ USE(n38); |
+ op = common()->IfSuccess(); |
+ Node* n37 = graph()->NewNode(op, nil); |
+ USE(n37); |
+ op = common()->Phi(kMachAnyTagged, 2); |
+ Node* n34 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n34); |
+ op = common()->EffectPhi(2); |
+ Node* n35 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n35); |
op = common()->Loop(2); |
Node* n33 = graph()->NewNode(op, nil, nil); |
USE(n33); |
- op = common()->IfFalse(); |
- Node* n17 = graph()->NewNode(op, nil); |
- USE(n17); |
- n17->ReplaceInput(0, n15); |
- n33->ReplaceInput(0, n17); |
+ op = common()->Phi(kMachAnyTagged, 2); |
+ Node* n15 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n15); |
+ op = js()->Add(); |
+ Node* n48 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n48); |
+ op = common()->IfSuccess(); |
+ Node* n32 = graph()->NewNode(op, nil); |
+ USE(n32); |
+ op = common()->IfSuccess(); |
+ Node* n49 = graph()->NewNode(op, nil); |
+ USE(n49); |
+ op = common()->Parameter(3); |
+ Node* n4 = graph()->NewNode(op, nil); |
+ USE(n4); |
+ op = js()->ToNumber(); |
+ Node* n46 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n46); |
+ op = common()->IfSuccess(); |
+ Node* n47 = graph()->NewNode(op, nil); |
+ USE(n47); |
+ op = js()->StackCheck(); |
+ Node* n44 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n44); |
+ op = common()->IfSuccess(); |
+ Node* n45 = graph()->NewNode(op, nil); |
+ USE(n45); |
op = common()->IfTrue(); |
- Node* n41 = graph()->NewNode(op, nil); |
- USE(n41); |
- op = common()->Branch(); |
- Node* n40 = graph()->NewNode(op, nil, nil); |
+ Node* n40 = graph()->NewNode(op, nil); |
USE(n40); |
- n40->ReplaceInput(0, n39); |
- n40->ReplaceInput(1, n33); |
- n41->ReplaceInput(0, n40); |
- n33->ReplaceInput(1, n41); |
- n36->ReplaceInput(2, n33); |
- n39->ReplaceInput(1, n36); |
- n39->ReplaceInput(2, n6); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n38 = graph()->NewNode(op, nil, nil, nil); |
- USE(n38); |
- n38->ReplaceInput(0, n14); |
- n38->ReplaceInput(1, n44); |
- n38->ReplaceInput(2, n33); |
- n39->ReplaceInput(3, n38); |
- n39->ReplaceInput(4, n33); |
- n44->ReplaceInput(3, n39); |
- n44->ReplaceInput(4, n41); |
- n35->ReplaceInput(1, n44); |
+ n71->ReplaceInput(0, n69); |
+ n69->ReplaceInput(0, n53); |
+ n69->ReplaceInput(1, n55); |
+ n69->ReplaceInput(2, n61); |
+ n53->ReplaceInput(0, n14); |
+ n53->ReplaceInput(1, n66); |
+ n53->ReplaceInput(2, n52); |
+ n55->ReplaceInput(0, n53); |
+ n55->ReplaceInput(1, n3); |
+ n55->ReplaceInput(2, n6); |
+ n55->ReplaceInput(3, n12); |
+ n55->ReplaceInput(4, n54); |
+ n55->ReplaceInput(5, n52); |
+ n61->ReplaceInput(0, n58); |
+ n14->ReplaceInput(0, n2); |
+ n14->ReplaceInput(1, n31); |
+ n14->ReplaceInput(2, n13); |
+ n66->ReplaceInput(0, n53); |
+ n66->ReplaceInput(1, n65); |
+ n66->ReplaceInput(2, n6); |
+ n66->ReplaceInput(3, n12); |
+ n66->ReplaceInput(4, n12); |
+ n66->ReplaceInput(5, n63); |
+ n66->ReplaceInput(6, n64); |
+ n52->ReplaceInput(0, n24); |
+ n52->ReplaceInput(1, n67); |
+ n3->ReplaceInput(0, n0); |
+ n6->ReplaceInput(0, n0); |
+ n12->ReplaceInput(0, n10); |
+ n12->ReplaceInput(1, n10); |
+ n12->ReplaceInput(2, n10); |
+ n12->ReplaceInput(3, n11); |
+ n12->ReplaceInput(4, n5); |
+ n54->ReplaceInput(0, n18); |
+ n54->ReplaceInput(1, n66); |
+ n54->ReplaceInput(2, n52); |
+ n58->ReplaceInput(0, n57); |
+ n58->ReplaceInput(1, n56); |
+ n2->ReplaceInput(0, n0); |
+ n31->ReplaceInput(0, n28); |
+ n31->ReplaceInput(1, n30); |
+ n31->ReplaceInput(2, n6); |
+ n31->ReplaceInput(3, n12); |
+ n31->ReplaceInput(4, n12); |
+ n31->ReplaceInput(5, n28); |
+ n31->ReplaceInput(6, n29); |
+ n13->ReplaceInput(0, n9); |
+ n13->ReplaceInput(1, n42); |
+ n63->ReplaceInput(0, n6); |
+ n63->ReplaceInput(1, n12); |
+ n63->ReplaceInput(2, n55); |
+ n63->ReplaceInput(3, n59); |
+ n64->ReplaceInput(0, n63); |
+ n24->ReplaceInput(0, n21); |
+ n67->ReplaceInput(0, n66); |
+ n18->ReplaceInput(0, n14); |
+ n18->ReplaceInput(1, n3); |
+ n18->ReplaceInput(2, n6); |
+ n18->ReplaceInput(3, n12); |
+ n18->ReplaceInput(4, n16); |
+ n18->ReplaceInput(5, n13); |
+ n57->ReplaceInput(0, n55); |
+ n57->ReplaceInput(1, n6); |
+ n56->ReplaceInput(0, n55); |
+ n28->ReplaceInput(0, n14); |
+ n28->ReplaceInput(1, n6); |
+ n28->ReplaceInput(2, n12); |
+ n28->ReplaceInput(3, n26); |
+ n28->ReplaceInput(4, n27); |
+ n29->ReplaceInput(0, n28); |
+ n9->ReplaceInput(0, n8); |
+ n42->ReplaceInput(0, n39); |
+ n59->ReplaceInput(0, n58); |
+ n21->ReplaceInput(0, n20); |
+ n21->ReplaceInput(1, n19); |
+ n16->ReplaceInput(0, n8); |
+ n16->ReplaceInput(1, n36); |
+ n16->ReplaceInput(2, n13); |
+ n26->ReplaceInput(0, n6); |
+ n26->ReplaceInput(1, n12); |
+ n26->ReplaceInput(2, n18); |
+ n26->ReplaceInput(3, n22); |
+ n27->ReplaceInput(0, n26); |
+ n8->ReplaceInput(0, n6); |
+ n8->ReplaceInput(1, n12); |
+ n8->ReplaceInput(2, n0); |
+ n8->ReplaceInput(3, n0); |
+ n39->ReplaceInput(0, n38); |
+ n39->ReplaceInput(1, n37); |
+ n20->ReplaceInput(0, n18); |
+ n20->ReplaceInput(1, n6); |
+ n19->ReplaceInput(0, n18); |
+ n36->ReplaceInput(0, n34); |
+ n36->ReplaceInput(1, n3); |
+ n36->ReplaceInput(2, n6); |
+ n36->ReplaceInput(3, n12); |
+ n36->ReplaceInput(4, n35); |
+ n36->ReplaceInput(5, n33); |
+ n22->ReplaceInput(0, n21); |
+ n38->ReplaceInput(0, n36); |
+ n38->ReplaceInput(1, n6); |
+ n37->ReplaceInput(0, n36); |
+ n34->ReplaceInput(0, n15); |
+ n34->ReplaceInput(1, n48); |
+ n34->ReplaceInput(2, n33); |
+ n35->ReplaceInput(0, n31); |
+ n35->ReplaceInput(1, n48); |
n35->ReplaceInput(2, n33); |
- n45->ReplaceInput(0, n35); |
- n45->ReplaceInput(1, n39); |
- op = common()->IfFalse(); |
- Node* n42 = graph()->NewNode(op, nil); |
- USE(n42); |
- n42->ReplaceInput(0, n40); |
- n45->ReplaceInput(2, n42); |
- n46->ReplaceInput(0, n45); |
+ n33->ReplaceInput(0, n32); |
+ n33->ReplaceInput(1, n49); |
+ n15->ReplaceInput(0, n4); |
+ n15->ReplaceInput(1, n34); |
+ n15->ReplaceInput(2, n13); |
+ n48->ReplaceInput(0, n46); |
+ n48->ReplaceInput(1, n30); |
+ n48->ReplaceInput(2, n6); |
+ n48->ReplaceInput(3, n12); |
+ n48->ReplaceInput(4, n12); |
+ n48->ReplaceInput(5, n46); |
+ n48->ReplaceInput(6, n47); |
+ n32->ReplaceInput(0, n31); |
+ n49->ReplaceInput(0, n48); |
+ n4->ReplaceInput(0, n0); |
+ n46->ReplaceInput(0, n34); |
+ n46->ReplaceInput(1, n6); |
+ n46->ReplaceInput(2, n12); |
+ n46->ReplaceInput(3, n44); |
+ n46->ReplaceInput(4, n45); |
+ n47->ReplaceInput(0, n46); |
+ n44->ReplaceInput(0, n6); |
+ n44->ReplaceInput(1, n12); |
+ n44->ReplaceInput(2, n36); |
+ n44->ReplaceInput(3, n40); |
+ n45->ReplaceInput(0, n44); |
+ n40->ReplaceInput(0, n39); |
graph()->SetStart(n0); |
- graph()->SetEnd(n46); |
+ graph()->SetEnd(n71); |
- ComputeAndVerifySchedule(46); |
+ ComputeAndVerifySchedule(65); |
} |
TEST_F(SchedulerTest, BuildScheduleBreakAndContinue) { |
- FLAG_turbo_deoptimization = false; |
- |
const Operator* op; |
+ Unique<HeapObject> unique_constant = |
+ Unique<HeapObject>::CreateImmovable(factory()->undefined_value()); |
// Manually transcripted code for: |
// function turbo_fan_test(a, b, c) { |
@@ -1175,312 +1414,430 @@ TEST_F(SchedulerTest, BuildScheduleBreakAndContinue) { |
// } |
// return a + d; |
// } |
- op = common()->Start(0); |
- Node* n0 = graph()->NewNode(op); |
- USE(n0); |
Node* nil = graph()->NewNode(common()->Dead()); |
op = common()->End(); |
- Node* n58 = graph()->NewNode(op, nil); |
- USE(n58); |
+ Node* n86 = graph()->NewNode(op, nil); |
+ USE(n86); |
op = common()->Return(); |
- Node* n57 = graph()->NewNode(op, nil, nil, nil); |
- USE(n57); |
+ Node* n84 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n84); |
op = js()->Add(); |
- Node* n56 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n56); |
+ Node* n82 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n82); |
+ op = common()->IfSuccess(); |
+ Node* n83 = graph()->NewNode(op, nil); |
+ USE(n83); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n10 = graph()->NewNode(op, nil, nil, nil); |
- USE(n10); |
- op = common()->Parameter(0); |
- Node* n2 = graph()->NewNode(op, n0); |
- USE(n2); |
- n10->ReplaceInput(0, n2); |
+ Node* n15 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n15); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n25 = graph()->NewNode(op, nil, nil, nil); |
- USE(n25); |
- op = js()->Add(); |
- Node* n22 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n22); |
- op = js()->ToNumber(); |
- Node* n20 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n20); |
- n20->ReplaceInput(0, n10); |
- op = &kHeapConstant; |
- Node* n6 = graph()->NewNode(op); |
+ Node* n17 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n17); |
+ op = common()->Parameter(4); |
+ Node* n6 = graph()->NewNode(op, nil); |
USE(n6); |
- n20->ReplaceInput(1, n6); |
+ op = common()->FrameState(JS_FRAME, BailoutId(-1), |
+ OutputFrameStateCombine::Ignore()); |
+ Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n12); |
op = js()->LessThan(); |
- Node* n16 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n16); |
- n16->ReplaceInput(0, n10); |
+ Node* n19 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n19); |
+ op = common()->IfFalse(); |
+ Node* n25 = graph()->NewNode(op, nil); |
+ USE(n25); |
+ op = common()->Parameter(1); |
+ Node* n2 = graph()->NewNode(op, nil); |
+ USE(n2); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n11 = graph()->NewNode(op, nil, nil, nil); |
+ Node* n35 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n35); |
+ op = common()->Loop(2); |
+ Node* n14 = graph()->NewNode(op, nil, nil); |
+ USE(n14); |
+ op = common()->NumberConstant(0); |
+ Node* n11 = graph()->NewNode(op); |
USE(n11); |
- op = common()->Parameter(0); |
- Node* n3 = graph()->NewNode(op, n0); |
- USE(n3); |
- n11->ReplaceInput(0, n3); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n26 = graph()->NewNode(op, nil, nil, nil); |
- USE(n26); |
- n26->ReplaceInput(0, n11); |
- n26->ReplaceInput(1, n26); |
- op = common()->Loop(2); |
- Node* n23 = graph()->NewNode(op, nil, nil); |
- USE(n23); |
- op = common()->IfTrue(); |
- Node* n18 = graph()->NewNode(op, nil); |
+ Node* n81 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n81); |
+ op = common()->Start(3); |
+ Node* n0 = graph()->NewNode(op); |
+ USE(n0); |
+ op = common()->StateValues(0); |
+ Node* n10 = graph()->NewNode(op); |
+ USE(n10); |
+ op = common()->HeapConstant(unique_constant); |
+ Node* n5 = graph()->NewNode(op); |
+ USE(n5); |
+ op = common()->Parameter(2); |
+ Node* n3 = graph()->NewNode(op, nil); |
+ USE(n3); |
+ op = common()->EffectPhi(2); |
+ Node* n18 = graph()->NewNode(op, nil, nil, nil); |
USE(n18); |
op = common()->Branch(); |
- Node* n17 = graph()->NewNode(op, nil, nil); |
- USE(n17); |
- n17->ReplaceInput(0, n16); |
+ Node* n22 = graph()->NewNode(op, nil, nil); |
+ USE(n22); |
+ op = js()->Add(); |
+ Node* n32 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n32); |
+ op = js()->Add(); |
+ Node* n64 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n64); |
op = common()->Loop(2); |
- Node* n8 = graph()->NewNode(op, nil, nil); |
+ Node* n34 = graph()->NewNode(op, nil, nil); |
+ USE(n34); |
+ op = common()->IfSuccess(); |
+ Node* n9 = graph()->NewNode(op, nil); |
+ USE(n9); |
+ op = common()->Merge(2); |
+ Node* n72 = graph()->NewNode(op, nil, nil); |
+ USE(n72); |
+ op = js()->Add(); |
+ Node* n78 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n78); |
+ op = js()->StackCheck(); |
+ Node* n8 = graph()->NewNode(op, nil, nil, nil, nil); |
USE(n8); |
- n8->ReplaceInput(0, n0); |
+ op = common()->EffectPhi(2); |
+ Node* n80 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n80); |
+ op = js()->ToBoolean(); |
+ Node* n21 = graph()->NewNode(op, nil, nil); |
+ USE(n21); |
+ op = common()->IfSuccess(); |
+ Node* n20 = graph()->NewNode(op, nil); |
+ USE(n20); |
+ op = js()->ToNumber(); |
+ Node* n29 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n29); |
+ op = common()->NumberConstant(1); |
+ Node* n31 = graph()->NewNode(op); |
+ USE(n31); |
+ op = common()->IfSuccess(); |
+ Node* n30 = graph()->NewNode(op, nil); |
+ USE(n30); |
+ op = js()->ToNumber(); |
+ Node* n62 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n62); |
+ op = common()->IfSuccess(); |
+ Node* n63 = graph()->NewNode(op, nil); |
+ USE(n63); |
+ op = common()->IfSuccess(); |
+ Node* n33 = graph()->NewNode(op, nil); |
+ USE(n33); |
+ op = common()->IfSuccess(); |
+ Node* n65 = graph()->NewNode(op, nil); |
+ USE(n65); |
+ op = common()->IfTrue(); |
+ Node* n71 = graph()->NewNode(op, nil); |
+ USE(n71); |
+ op = common()->IfSuccess(); |
+ Node* n79 = graph()->NewNode(op, nil); |
+ USE(n79); |
+ op = js()->ToNumber(); |
+ Node* n76 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n76); |
+ op = common()->IfSuccess(); |
+ Node* n77 = graph()->NewNode(op, nil); |
+ USE(n77); |
+ op = js()->Equal(); |
+ Node* n67 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n67); |
+ op = js()->StackCheck(); |
+ Node* n27 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n27); |
+ op = common()->IfSuccess(); |
+ Node* n28 = graph()->NewNode(op, nil); |
+ USE(n28); |
+ op = js()->Equal(); |
+ Node* n52 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n52); |
+ op = common()->IfFalse(); |
+ Node* n60 = graph()->NewNode(op, nil); |
+ USE(n60); |
+ op = common()->Branch(); |
+ Node* n70 = graph()->NewNode(op, nil, nil); |
+ USE(n70); |
+ op = common()->IfFalse(); |
+ Node* n74 = graph()->NewNode(op, nil); |
+ USE(n74); |
+ op = common()->EffectPhi(2); |
+ Node* n57 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n57); |
op = common()->Merge(2); |
- Node* n53 = graph()->NewNode(op, nil, nil); |
- USE(n53); |
+ Node* n45 = graph()->NewNode(op, nil, nil); |
+ USE(n45); |
+ op = common()->IfTrue(); |
+ Node* n23 = graph()->NewNode(op, nil); |
+ USE(n23); |
+ op = js()->Add(); |
+ Node* n50 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n50); |
+ op = common()->IfSuccess(); |
+ Node* n51 = graph()->NewNode(op, nil); |
+ USE(n51); |
+ op = common()->Branch(); |
+ Node* n55 = graph()->NewNode(op, nil, nil); |
+ USE(n55); |
+ op = js()->ToBoolean(); |
+ Node* n69 = graph()->NewNode(op, nil, nil); |
+ USE(n69); |
+ op = common()->IfSuccess(); |
+ Node* n68 = graph()->NewNode(op, nil); |
+ USE(n68); |
+ op = js()->LessThan(); |
+ Node* n38 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n38); |
+ op = common()->IfFalse(); |
+ Node* n44 = graph()->NewNode(op, nil); |
+ USE(n44); |
op = common()->IfTrue(); |
+ Node* n56 = graph()->NewNode(op, nil); |
+ USE(n56); |
+ op = js()->ToNumber(); |
+ Node* n48 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
+ USE(n48); |
+ op = common()->IfSuccess(); |
Node* n49 = graph()->NewNode(op, nil); |
USE(n49); |
+ op = js()->ToBoolean(); |
+ Node* n54 = graph()->NewNode(op, nil, nil); |
+ USE(n54); |
+ op = common()->IfSuccess(); |
+ Node* n53 = graph()->NewNode(op, nil); |
+ USE(n53); |
+ op = common()->Phi(kMachAnyTagged, 2); |
+ Node* n36 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n36); |
+ op = common()->EffectPhi(2); |
+ Node* n37 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n37); |
op = common()->Branch(); |
- Node* n48 = graph()->NewNode(op, nil, nil); |
- USE(n48); |
- op = js()->Equal(); |
- Node* n47 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n47); |
- n47->ReplaceInput(0, n25); |
- op = common()->NumberConstant(0); |
- Node* n46 = graph()->NewNode(op); |
+ Node* n41 = graph()->NewNode(op, nil, nil); |
+ USE(n41); |
+ op = js()->StackCheck(); |
+ Node* n46 = graph()->NewNode(op, nil, nil, nil, nil); |
USE(n46); |
- n47->ReplaceInput(1, n46); |
- n47->ReplaceInput(2, n6); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n42 = graph()->NewNode(op, nil, nil, nil); |
- USE(n42); |
- op = js()->LessThan(); |
- Node* n30 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n30); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n27 = graph()->NewNode(op, nil, nil, nil); |
- USE(n27); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n12 = graph()->NewNode(op, nil, nil, nil); |
- USE(n12); |
- op = common()->Parameter(0); |
- Node* n4 = graph()->NewNode(op, n0); |
- USE(n4); |
- n12->ReplaceInput(0, n4); |
+ op = common()->IfSuccess(); |
+ Node* n47 = graph()->NewNode(op, nil); |
+ USE(n47); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n41 = graph()->NewNode(op, nil, nil, nil); |
- USE(n41); |
- n41->ReplaceInput(0, n27); |
- op = js()->Add(); |
- Node* n35 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n35); |
- op = js()->ToNumber(); |
- Node* n34 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n34); |
- n34->ReplaceInput(0, n27); |
- n34->ReplaceInput(1, n6); |
- n34->ReplaceInput(2, n30); |
- op = common()->IfTrue(); |
- Node* n32 = graph()->NewNode(op, nil); |
- USE(n32); |
- op = common()->Branch(); |
- Node* n31 = graph()->NewNode(op, nil, nil); |
- USE(n31); |
- n31->ReplaceInput(0, n30); |
- n31->ReplaceInput(1, n23); |
- n32->ReplaceInput(0, n31); |
- n34->ReplaceInput(3, n32); |
- n35->ReplaceInput(0, n34); |
- op = common()->NumberConstant(0); |
- Node* n21 = graph()->NewNode(op); |
- USE(n21); |
- n35->ReplaceInput(1, n21); |
- n35->ReplaceInput(2, n6); |
- n35->ReplaceInput(3, n34); |
- n35->ReplaceInput(4, n32); |
- n41->ReplaceInput(1, n35); |
- op = common()->Merge(2); |
+ Node* n16 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n16); |
+ op = js()->ToBoolean(); |
Node* n40 = graph()->NewNode(op, nil, nil); |
USE(n40); |
- op = common()->IfFalse(); |
- Node* n33 = graph()->NewNode(op, nil); |
- USE(n33); |
- n33->ReplaceInput(0, n31); |
- n40->ReplaceInput(0, n33); |
- op = common()->IfTrue(); |
+ op = common()->IfSuccess(); |
Node* n39 = graph()->NewNode(op, nil); |
USE(n39); |
- op = common()->Branch(); |
- Node* n38 = graph()->NewNode(op, nil, nil); |
- USE(n38); |
- op = js()->Equal(); |
- Node* n37 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n37); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n28 = graph()->NewNode(op, nil, nil, nil); |
- USE(n28); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n13 = graph()->NewNode(op, nil, nil, nil); |
- USE(n13); |
- op = common()->NumberConstant(0); |
- Node* n7 = graph()->NewNode(op); |
- USE(n7); |
- n13->ReplaceInput(0, n7); |
+ op = common()->IfTrue(); |
+ Node* n42 = graph()->NewNode(op, nil); |
+ USE(n42); |
+ op = common()->Parameter(3); |
+ Node* n4 = graph()->NewNode(op, nil); |
+ USE(n4); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n54 = graph()->NewNode(op, nil, nil, nil); |
- USE(n54); |
- n54->ReplaceInput(0, n28); |
- op = js()->Add(); |
- Node* n52 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n52); |
- op = js()->ToNumber(); |
- Node* n51 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n51); |
- n51->ReplaceInput(0, n28); |
- n51->ReplaceInput(1, n6); |
- n51->ReplaceInput(2, n47); |
- op = common()->IfFalse(); |
- Node* n50 = graph()->NewNode(op, nil); |
- USE(n50); |
- n50->ReplaceInput(0, n48); |
- n51->ReplaceInput(3, n50); |
- n52->ReplaceInput(0, n51); |
- n52->ReplaceInput(1, n21); |
+ Node* n58 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n58); |
+ n86->ReplaceInput(0, n84); |
+ n84->ReplaceInput(0, n82); |
+ n84->ReplaceInput(1, n82); |
+ n84->ReplaceInput(2, n83); |
+ n82->ReplaceInput(0, n15); |
+ n82->ReplaceInput(1, n17); |
+ n82->ReplaceInput(2, n6); |
+ n82->ReplaceInput(3, n12); |
+ n82->ReplaceInput(4, n12); |
+ n82->ReplaceInput(5, n19); |
+ n82->ReplaceInput(6, n25); |
+ n83->ReplaceInput(0, n82); |
+ n15->ReplaceInput(0, n2); |
+ n15->ReplaceInput(1, n35); |
+ n15->ReplaceInput(2, n14); |
+ n17->ReplaceInput(0, n11); |
+ n17->ReplaceInput(1, n81); |
+ n17->ReplaceInput(2, n14); |
+ n6->ReplaceInput(0, n0); |
+ n12->ReplaceInput(0, n10); |
+ n12->ReplaceInput(1, n10); |
+ n12->ReplaceInput(2, n10); |
+ n12->ReplaceInput(3, n11); |
+ n12->ReplaceInput(4, n5); |
+ n19->ReplaceInput(0, n15); |
+ n19->ReplaceInput(1, n3); |
+ n19->ReplaceInput(2, n6); |
+ n19->ReplaceInput(3, n12); |
+ n19->ReplaceInput(4, n18); |
+ n19->ReplaceInput(5, n14); |
+ n25->ReplaceInput(0, n22); |
+ n2->ReplaceInput(0, n0); |
+ n35->ReplaceInput(0, n32); |
+ n35->ReplaceInput(1, n64); |
+ n35->ReplaceInput(2, n34); |
+ n14->ReplaceInput(0, n9); |
+ n14->ReplaceInput(1, n72); |
+ n81->ReplaceInput(0, n17); |
+ n81->ReplaceInput(1, n78); |
+ n81->ReplaceInput(2, n72); |
+ n3->ReplaceInput(0, n0); |
+ n18->ReplaceInput(0, n8); |
+ n18->ReplaceInput(1, n80); |
+ n18->ReplaceInput(2, n14); |
+ n22->ReplaceInput(0, n21); |
+ n22->ReplaceInput(1, n20); |
+ n32->ReplaceInput(0, n29); |
+ n32->ReplaceInput(1, n31); |
+ n32->ReplaceInput(2, n6); |
+ n32->ReplaceInput(3, n12); |
+ n32->ReplaceInput(4, n12); |
+ n32->ReplaceInput(5, n29); |
+ n32->ReplaceInput(6, n30); |
+ n64->ReplaceInput(0, n62); |
+ n64->ReplaceInput(1, n31); |
+ n64->ReplaceInput(2, n6); |
+ n64->ReplaceInput(3, n12); |
+ n64->ReplaceInput(4, n12); |
+ n64->ReplaceInput(5, n62); |
+ n64->ReplaceInput(6, n63); |
+ n34->ReplaceInput(0, n33); |
+ n34->ReplaceInput(1, n65); |
+ n9->ReplaceInput(0, n8); |
+ n72->ReplaceInput(0, n71); |
+ n72->ReplaceInput(1, n79); |
+ n78->ReplaceInput(0, n76); |
+ n78->ReplaceInput(1, n31); |
+ n78->ReplaceInput(2, n6); |
+ n78->ReplaceInput(3, n12); |
+ n78->ReplaceInput(4, n12); |
+ n78->ReplaceInput(5, n76); |
+ n78->ReplaceInput(6, n77); |
+ n8->ReplaceInput(0, n6); |
+ n8->ReplaceInput(1, n12); |
+ n8->ReplaceInput(2, n0); |
+ n8->ReplaceInput(3, n0); |
+ n80->ReplaceInput(0, n67); |
+ n80->ReplaceInput(1, n78); |
+ n80->ReplaceInput(2, n72); |
+ n21->ReplaceInput(0, n19); |
+ n21->ReplaceInput(1, n6); |
+ n20->ReplaceInput(0, n19); |
+ n29->ReplaceInput(0, n15); |
+ n29->ReplaceInput(1, n6); |
+ n29->ReplaceInput(2, n12); |
+ n29->ReplaceInput(3, n27); |
+ n29->ReplaceInput(4, n28); |
+ n30->ReplaceInput(0, n29); |
+ n62->ReplaceInput(0, n35); |
+ n62->ReplaceInput(1, n6); |
+ n62->ReplaceInput(2, n12); |
+ n62->ReplaceInput(3, n52); |
+ n62->ReplaceInput(4, n60); |
+ n63->ReplaceInput(0, n62); |
+ n33->ReplaceInput(0, n32); |
+ n65->ReplaceInput(0, n64); |
+ n71->ReplaceInput(0, n70); |
+ n79->ReplaceInput(0, n78); |
+ n76->ReplaceInput(0, n17); |
+ n76->ReplaceInput(1, n6); |
+ n76->ReplaceInput(2, n12); |
+ n76->ReplaceInput(3, n67); |
+ n76->ReplaceInput(4, n74); |
+ n77->ReplaceInput(0, n76); |
+ n67->ReplaceInput(0, n35); |
+ n67->ReplaceInput(1, n31); |
+ n67->ReplaceInput(2, n6); |
+ n67->ReplaceInput(3, n12); |
+ n67->ReplaceInput(4, n57); |
+ n67->ReplaceInput(5, n45); |
+ n27->ReplaceInput(0, n6); |
+ n27->ReplaceInput(1, n12); |
+ n27->ReplaceInput(2, n19); |
+ n27->ReplaceInput(3, n23); |
+ n28->ReplaceInput(0, n27); |
+ n52->ReplaceInput(0, n17); |
+ n52->ReplaceInput(1, n11); |
n52->ReplaceInput(2, n6); |
- n52->ReplaceInput(3, n51); |
+ n52->ReplaceInput(3, n12); |
n52->ReplaceInput(4, n50); |
- n54->ReplaceInput(1, n52); |
- n54->ReplaceInput(2, n53); |
- n13->ReplaceInput(1, n54); |
- n13->ReplaceInput(2, n8); |
- n28->ReplaceInput(0, n13); |
- n28->ReplaceInput(1, n28); |
- n28->ReplaceInput(2, n23); |
- n37->ReplaceInput(0, n28); |
- op = common()->NumberConstant(0); |
- Node* n36 = graph()->NewNode(op); |
- USE(n36); |
- n37->ReplaceInput(1, n36); |
- n37->ReplaceInput(2, n6); |
- n37->ReplaceInput(3, n35); |
- n37->ReplaceInput(4, n32); |
- n38->ReplaceInput(0, n37); |
- n38->ReplaceInput(1, n32); |
- n39->ReplaceInput(0, n38); |
- n40->ReplaceInput(1, n39); |
- n41->ReplaceInput(2, n40); |
- n12->ReplaceInput(1, n41); |
- n12->ReplaceInput(2, n8); |
- n27->ReplaceInput(0, n12); |
- n27->ReplaceInput(1, n35); |
- n27->ReplaceInput(2, n23); |
- n30->ReplaceInput(0, n27); |
- n30->ReplaceInput(1, n26); |
- n30->ReplaceInput(2, n6); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n29 = graph()->NewNode(op, nil, nil, nil); |
- USE(n29); |
- n29->ReplaceInput(0, n22); |
- op = js()->Add(); |
- Node* n45 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n45); |
- op = js()->ToNumber(); |
- Node* n44 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n44); |
- n44->ReplaceInput(0, n25); |
- n44->ReplaceInput(1, n6); |
- n44->ReplaceInput(2, n37); |
- op = common()->IfFalse(); |
- Node* n43 = graph()->NewNode(op, nil); |
- USE(n43); |
- n43->ReplaceInput(0, n38); |
- n44->ReplaceInput(3, n43); |
+ n52->ReplaceInput(5, n51); |
+ n60->ReplaceInput(0, n55); |
+ n70->ReplaceInput(0, n69); |
+ n70->ReplaceInput(1, n68); |
+ n74->ReplaceInput(0, n70); |
+ n57->ReplaceInput(0, n38); |
+ n57->ReplaceInput(1, n52); |
+ n57->ReplaceInput(2, n45); |
n45->ReplaceInput(0, n44); |
- n45->ReplaceInput(1, n21); |
- n45->ReplaceInput(2, n6); |
- n45->ReplaceInput(3, n44); |
- n45->ReplaceInput(4, n43); |
- n29->ReplaceInput(1, n45); |
- n29->ReplaceInput(2, n23); |
- n30->ReplaceInput(3, n29); |
- n30->ReplaceInput(4, n23); |
- n42->ReplaceInput(0, n30); |
- n42->ReplaceInput(1, n37); |
- n42->ReplaceInput(2, n40); |
- n47->ReplaceInput(3, n42); |
- n47->ReplaceInput(4, n40); |
- n48->ReplaceInput(0, n47); |
- n48->ReplaceInput(1, n40); |
+ n45->ReplaceInput(1, n56); |
+ n23->ReplaceInput(0, n22); |
+ n50->ReplaceInput(0, n48); |
+ n50->ReplaceInput(1, n31); |
+ n50->ReplaceInput(2, n6); |
+ n50->ReplaceInput(3, n12); |
+ n50->ReplaceInput(4, n12); |
+ n50->ReplaceInput(5, n48); |
+ n50->ReplaceInput(6, n49); |
+ n51->ReplaceInput(0, n50); |
+ n55->ReplaceInput(0, n54); |
+ n55->ReplaceInput(1, n53); |
+ n69->ReplaceInput(0, n67); |
+ n69->ReplaceInput(1, n6); |
+ n68->ReplaceInput(0, n67); |
+ n38->ReplaceInput(0, n36); |
+ n38->ReplaceInput(1, n3); |
+ n38->ReplaceInput(2, n6); |
+ n38->ReplaceInput(3, n12); |
+ n38->ReplaceInput(4, n37); |
+ n38->ReplaceInput(5, n34); |
+ n44->ReplaceInput(0, n41); |
+ n56->ReplaceInput(0, n55); |
+ n48->ReplaceInput(0, n36); |
+ n48->ReplaceInput(1, n6); |
+ n48->ReplaceInput(2, n12); |
+ n48->ReplaceInput(3, n46); |
+ n48->ReplaceInput(4, n47); |
n49->ReplaceInput(0, n48); |
- n53->ReplaceInput(0, n49); |
- n53->ReplaceInput(1, n50); |
- n8->ReplaceInput(1, n53); |
- n17->ReplaceInput(1, n8); |
- n18->ReplaceInput(0, n17); |
- n23->ReplaceInput(0, n18); |
- n23->ReplaceInput(1, n43); |
- n26->ReplaceInput(2, n23); |
- n11->ReplaceInput(1, n26); |
- n11->ReplaceInput(2, n8); |
- n16->ReplaceInput(1, n11); |
- n16->ReplaceInput(2, n6); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n14 = graph()->NewNode(op, nil, nil, nil); |
- USE(n14); |
- n14->ReplaceInput(0, n0); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n55 = graph()->NewNode(op, nil, nil, nil); |
- USE(n55); |
- n55->ReplaceInput(0, n47); |
- n55->ReplaceInput(1, n52); |
- n55->ReplaceInput(2, n53); |
- n14->ReplaceInput(1, n55); |
- n14->ReplaceInput(2, n8); |
- n16->ReplaceInput(3, n14); |
- n16->ReplaceInput(4, n8); |
- n20->ReplaceInput(2, n16); |
- n20->ReplaceInput(3, n18); |
- n22->ReplaceInput(0, n20); |
- n22->ReplaceInput(1, n21); |
- n22->ReplaceInput(2, n6); |
- n22->ReplaceInput(3, n20); |
- n22->ReplaceInput(4, n18); |
- n25->ReplaceInput(0, n22); |
- n25->ReplaceInput(1, n45); |
- n25->ReplaceInput(2, n23); |
- n10->ReplaceInput(1, n25); |
- n10->ReplaceInput(2, n8); |
- n56->ReplaceInput(0, n10); |
- n56->ReplaceInput(1, n13); |
- n56->ReplaceInput(2, n6); |
- n56->ReplaceInput(3, n16); |
- op = common()->IfFalse(); |
- Node* n19 = graph()->NewNode(op, nil); |
- USE(n19); |
- n19->ReplaceInput(0, n17); |
- n56->ReplaceInput(4, n19); |
- n57->ReplaceInput(0, n56); |
- n57->ReplaceInput(1, n56); |
- n57->ReplaceInput(2, n19); |
- n58->ReplaceInput(0, n57); |
+ n54->ReplaceInput(0, n52); |
+ n54->ReplaceInput(1, n6); |
+ n53->ReplaceInput(0, n52); |
+ n36->ReplaceInput(0, n16); |
+ n36->ReplaceInput(1, n50); |
+ n36->ReplaceInput(2, n34); |
+ n37->ReplaceInput(0, n32); |
+ n37->ReplaceInput(1, n64); |
+ n37->ReplaceInput(2, n34); |
+ n41->ReplaceInput(0, n40); |
+ n41->ReplaceInput(1, n39); |
+ n46->ReplaceInput(0, n6); |
+ n46->ReplaceInput(1, n12); |
+ n46->ReplaceInput(2, n38); |
+ n46->ReplaceInput(3, n42); |
+ n47->ReplaceInput(0, n46); |
+ n16->ReplaceInput(0, n4); |
+ n16->ReplaceInput(1, n58); |
+ n16->ReplaceInput(2, n14); |
+ n40->ReplaceInput(0, n38); |
+ n40->ReplaceInput(1, n6); |
+ n39->ReplaceInput(0, n38); |
+ n42->ReplaceInput(0, n41); |
+ n4->ReplaceInput(0, n0); |
+ n58->ReplaceInput(0, n36); |
+ n58->ReplaceInput(1, n50); |
+ n58->ReplaceInput(2, n45); |
graph()->SetStart(n0); |
- graph()->SetEnd(n58); |
+ graph()->SetEnd(n86); |
- ComputeAndVerifySchedule(62); |
+ ComputeAndVerifySchedule(83); |
} |
TEST_F(SchedulerTest, BuildScheduleSimpleLoopWithCodeMotion) { |
- FLAG_turbo_deoptimization = false; |
- |
const Operator* op; |
+ Unique<HeapObject> unique_constant = |
+ Unique<HeapObject>::CreateImmovable(factory()->undefined_value()); |
// Manually transcripted code for: |
// function turbo_fan_test(a, b, c) { |
@@ -1489,107 +1846,157 @@ TEST_F(SchedulerTest, BuildScheduleSimpleLoopWithCodeMotion) { |
// } |
// return a; |
// } |
- op = common()->Start(0); |
- Node* n0 = graph()->NewNode(op); |
- USE(n0); |
Node* nil = graph()->NewNode(common()->Dead()); |
op = common()->End(); |
- Node* n22 = graph()->NewNode(op, nil); |
- USE(n22); |
+ Node* n34 = graph()->NewNode(op, nil); |
+ USE(n34); |
op = common()->Return(); |
- Node* n21 = graph()->NewNode(op, nil, nil, nil); |
- USE(n21); |
+ Node* n32 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n32); |
op = common()->Phi(kMachAnyTagged, 2); |
- Node* n9 = graph()->NewNode(op, nil, nil, nil); |
- USE(n9); |
- op = common()->Parameter(0); |
- Node* n2 = graph()->NewNode(op, n0); |
+ Node* n14 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n14); |
+ op = js()->LessThan(); |
+ Node* n17 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil); |
+ USE(n17); |
+ op = common()->IfFalse(); |
+ Node* n23 = graph()->NewNode(op, nil); |
+ USE(n23); |
+ op = common()->Parameter(1); |
+ Node* n2 = graph()->NewNode(op, nil); |
USE(n2); |
- n9->ReplaceInput(0, n2); |
op = js()->Add(); |
- Node* n20 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n20); |
- n20->ReplaceInput(0, n9); |
- op = &kIntAdd; |
- Node* n19 = graph()->NewNode(op, nil, nil); |
- USE(n19); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n10 = graph()->NewNode(op, nil, nil, nil); |
- USE(n10); |
- op = common()->Parameter(0); |
- Node* n3 = graph()->NewNode(op, n0); |
- USE(n3); |
- n10->ReplaceInput(0, n3); |
- n10->ReplaceInput(1, n10); |
+ Node* n29 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n29); |
op = common()->Loop(2); |
- Node* n7 = graph()->NewNode(op, nil, nil); |
- USE(n7); |
- n7->ReplaceInput(0, n0); |
- op = common()->IfTrue(); |
- Node* n17 = graph()->NewNode(op, nil); |
- USE(n17); |
- op = common()->Branch(); |
- Node* n16 = graph()->NewNode(op, nil, nil); |
- USE(n16); |
- op = js()->ToBoolean(); |
- Node* n15 = graph()->NewNode(op, nil, nil, nil, nil); |
- USE(n15); |
- op = js()->LessThan(); |
- Node* n14 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
- USE(n14); |
- n14->ReplaceInput(0, n9); |
- n14->ReplaceInput(1, n10); |
- op = &kHeapConstant; |
- Node* n6 = graph()->NewNode(op); |
+ Node* n13 = graph()->NewNode(op, nil, nil); |
+ USE(n13); |
+ op = common()->Parameter(2); |
+ Node* n3 = graph()->NewNode(op, nil); |
+ USE(n3); |
+ op = common()->Parameter(4); |
+ Node* n6 = graph()->NewNode(op, nil); |
USE(n6); |
- n14->ReplaceInput(2, n6); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n12 = graph()->NewNode(op, nil, nil, nil); |
+ op = common()->FrameState(JS_FRAME, BailoutId(-1), |
+ OutputFrameStateCombine::Ignore()); |
+ Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil); |
USE(n12); |
- n12->ReplaceInput(0, n0); |
- n12->ReplaceInput(1, n20); |
- n12->ReplaceInput(2, n7); |
- n14->ReplaceInput(3, n12); |
- n14->ReplaceInput(4, n7); |
- n15->ReplaceInput(0, n14); |
- n15->ReplaceInput(1, n6); |
- n15->ReplaceInput(2, n14); |
- n15->ReplaceInput(3, n7); |
- n16->ReplaceInput(0, n15); |
- n16->ReplaceInput(1, n7); |
- n17->ReplaceInput(0, n16); |
- n7->ReplaceInput(1, n17); |
- n10->ReplaceInput(2, n7); |
- n19->ReplaceInput(0, n2); |
- op = common()->Phi(kMachAnyTagged, 2); |
- Node* n11 = graph()->NewNode(op, nil, nil, nil); |
+ op = common()->EffectPhi(2); |
+ Node* n15 = graph()->NewNode(op, nil, nil, nil); |
+ USE(n15); |
+ op = common()->Branch(); |
+ Node* n20 = graph()->NewNode(op, nil, nil); |
+ USE(n20); |
+ op = common()->Start(3); |
+ Node* n0 = graph()->NewNode(op); |
+ USE(n0); |
+ op = js()->Add(); |
+ Node* n27 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil); |
+ USE(n27); |
+ op = common()->IfSuccess(); |
+ Node* n28 = graph()->NewNode(op, nil); |
+ USE(n28); |
+ op = common()->IfSuccess(); |
+ Node* n9 = graph()->NewNode(op, nil); |
+ USE(n9); |
+ op = common()->IfSuccess(); |
+ Node* n30 = graph()->NewNode(op, nil); |
+ USE(n30); |
+ op = common()->StateValues(0); |
+ Node* n10 = graph()->NewNode(op); |
+ USE(n10); |
+ op = common()->NumberConstant(0); |
+ Node* n11 = graph()->NewNode(op); |
USE(n11); |
- op = common()->Parameter(0); |
- Node* n4 = graph()->NewNode(op, n0); |
- USE(n4); |
- n11->ReplaceInput(0, n4); |
- n11->ReplaceInput(1, n11); |
- n11->ReplaceInput(2, n7); |
- n19->ReplaceInput(1, n3); |
- n20->ReplaceInput(1, n19); |
- n20->ReplaceInput(2, n6); |
- n20->ReplaceInput(3, n19); |
- n20->ReplaceInput(4, n17); |
- n9->ReplaceInput(1, n20); |
- n9->ReplaceInput(2, n7); |
- n21->ReplaceInput(0, n9); |
- n21->ReplaceInput(1, n15); |
- op = common()->IfFalse(); |
+ op = common()->HeapConstant(unique_constant); |
+ Node* n5 = graph()->NewNode(op); |
+ USE(n5); |
+ op = js()->StackCheck(); |
+ Node* n8 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n8); |
+ op = js()->ToBoolean(); |
+ Node* n19 = graph()->NewNode(op, nil, nil); |
+ USE(n19); |
+ op = common()->IfSuccess(); |
Node* n18 = graph()->NewNode(op, nil); |
USE(n18); |
- n18->ReplaceInput(0, n16); |
- n21->ReplaceInput(2, n18); |
- n22->ReplaceInput(0, n21); |
+ op = common()->Parameter(3); |
+ Node* n4 = graph()->NewNode(op, nil); |
+ USE(n4); |
+ op = js()->StackCheck(); |
+ Node* n25 = graph()->NewNode(op, nil, nil, nil, nil); |
+ USE(n25); |
+ op = common()->IfSuccess(); |
+ Node* n26 = graph()->NewNode(op, nil); |
+ USE(n26); |
+ op = common()->IfTrue(); |
+ Node* n21 = graph()->NewNode(op, nil); |
+ USE(n21); |
+ n34->ReplaceInput(0, n32); |
+ n32->ReplaceInput(0, n14); |
+ n32->ReplaceInput(1, n17); |
+ n32->ReplaceInput(2, n23); |
+ n14->ReplaceInput(0, n2); |
+ n14->ReplaceInput(1, n29); |
+ n14->ReplaceInput(2, n13); |
+ n17->ReplaceInput(0, n14); |
+ n17->ReplaceInput(1, n3); |
+ n17->ReplaceInput(2, n6); |
+ n17->ReplaceInput(3, n12); |
+ n17->ReplaceInput(4, n15); |
+ n17->ReplaceInput(5, n13); |
+ n23->ReplaceInput(0, n20); |
+ n2->ReplaceInput(0, n0); |
+ n29->ReplaceInput(0, n14); |
+ n29->ReplaceInput(1, n27); |
+ n29->ReplaceInput(2, n6); |
+ n29->ReplaceInput(3, n12); |
+ n29->ReplaceInput(4, n12); |
+ n29->ReplaceInput(5, n27); |
+ n29->ReplaceInput(6, n28); |
+ n13->ReplaceInput(0, n9); |
+ n13->ReplaceInput(1, n30); |
+ n3->ReplaceInput(0, n0); |
+ n6->ReplaceInput(0, n0); |
+ n12->ReplaceInput(0, n10); |
+ n12->ReplaceInput(1, n10); |
+ n12->ReplaceInput(2, n10); |
+ n12->ReplaceInput(3, n11); |
+ n12->ReplaceInput(4, n5); |
+ n15->ReplaceInput(0, n8); |
+ n15->ReplaceInput(1, n29); |
+ n15->ReplaceInput(2, n13); |
+ n20->ReplaceInput(0, n19); |
+ n20->ReplaceInput(1, n18); |
+ n27->ReplaceInput(0, n3); |
+ n27->ReplaceInput(1, n4); |
+ n27->ReplaceInput(2, n6); |
+ n27->ReplaceInput(3, n12); |
+ n27->ReplaceInput(4, n12); |
+ n27->ReplaceInput(5, n25); |
+ n27->ReplaceInput(6, n26); |
+ n28->ReplaceInput(0, n27); |
+ n9->ReplaceInput(0, n8); |
+ n30->ReplaceInput(0, n29); |
+ n8->ReplaceInput(0, n6); |
+ n8->ReplaceInput(1, n12); |
+ n8->ReplaceInput(2, n0); |
+ n8->ReplaceInput(3, n0); |
+ n19->ReplaceInput(0, n17); |
+ n19->ReplaceInput(1, n6); |
+ n18->ReplaceInput(0, n17); |
+ n4->ReplaceInput(0, n0); |
+ n25->ReplaceInput(0, n6); |
+ n25->ReplaceInput(1, n12); |
+ n25->ReplaceInput(2, n17); |
+ n25->ReplaceInput(3, n21); |
+ n26->ReplaceInput(0, n25); |
+ n21->ReplaceInput(0, n20); |
graph()->SetStart(n0); |
- graph()->SetEnd(n22); |
+ graph()->SetEnd(n34); |
- ComputeAndVerifySchedule(19); |
+ ComputeAndVerifySchedule(30); |
} |