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

Side by Side Diff: test/unittests/compiler/scheduler-unittest.cc

Issue 1106613003: [turbofan] Unify frame state inputs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/graph-visualizer.h" 8 #include "src/compiler/graph-visualizer.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
11 #include "src/compiler/opcodes.h" 11 #include "src/compiler/opcodes.h"
12 #include "src/compiler/operator.h" 12 #include "src/compiler/operator.h"
13 #include "src/compiler/schedule.h" 13 #include "src/compiler/schedule.h"
14 #include "src/compiler/scheduler.h" 14 #include "src/compiler/scheduler.h"
15 #include "src/compiler/simplified-operator.h" 15 #include "src/compiler/simplified-operator.h"
16 #include "src/compiler/verifier.h" 16 #include "src/compiler/verifier.h"
17 #include "test/unittests/compiler/compiler-test-utils.h" 17 #include "test/unittests/compiler/compiler-test-utils.h"
18 #include "test/unittests/test-utils.h" 18 #include "test/unittests/test-utils.h"
19 #include "testing/gmock/include/gmock/gmock.h" 19 #include "testing/gmock/include/gmock/gmock.h"
20 20
21 using testing::AnyOf; 21 using testing::AnyOf;
22 22
23 namespace v8 { 23 namespace v8 {
24 namespace internal { 24 namespace internal {
25 namespace compiler { 25 namespace compiler {
26 26
27 class SchedulerTest : public TestWithZone { 27 class SchedulerTest : public TestWithIsolateAndZone {
28 public: 28 public:
29 SchedulerTest() 29 SchedulerTest()
30 : graph_(zone()), common_(zone()), simplified_(zone()), js_(zone()) {} 30 : graph_(zone()), common_(zone()), simplified_(zone()), js_(zone()) {}
31 31
32 Schedule* ComputeAndVerifySchedule(size_t expected) { 32 Schedule* ComputeAndVerifySchedule(size_t expected) {
33 if (FLAG_trace_turbo) { 33 if (FLAG_trace_turbo) {
34 OFStream os(stdout); 34 OFStream os(stdout);
35 os << AsDOT(*graph()); 35 os << AsDOT(*graph());
36 } 36 }
37 37
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 Node* ret2 = 666 Node* ret2 =
667 graph()->NewNode(common()->Return(), p5, graph()->start(), false_branch); 667 graph()->NewNode(common()->Return(), p5, graph()->start(), false_branch);
668 Node* merge = graph()->NewNode(common()->Merge(2), ret1, ret2); 668 Node* merge = graph()->NewNode(common()->Merge(2), ret1, ret2);
669 graph()->SetEnd(graph()->NewNode(common()->End(), merge)); 669 graph()->SetEnd(graph()->NewNode(common()->End(), merge));
670 670
671 ComputeAndVerifySchedule(13); 671 ComputeAndVerifySchedule(13);
672 } 672 }
673 673
674 674
675 TEST_F(SchedulerTest, BuildScheduleIfSplitWithEffects) { 675 TEST_F(SchedulerTest, BuildScheduleIfSplitWithEffects) {
676 FLAG_turbo_deoptimization = false;
677
678 const Operator* op; 676 const Operator* op;
677 Unique<HeapObject> unique_constant =
678 Unique<HeapObject>::CreateImmovable(factory()->undefined_value());
679 679
680 // Manually transcripted code for: 680 // Manually transcripted code for:
681 // function turbo_fan_test(a, b, c, y) { 681 // function turbo_fan_test(a, b, c, y) {
682 // if (a < b) { 682 // if (a < b) {
683 // return a + b - c * c - a + y; 683 // return a + b - c * c - a + y;
684 // } else { 684 // } else {
685 // return c * c - a; 685 // return c * c - a;
686 // } 686 // }
687 // } 687 // }
688 op = common()->Start(0); 688 Node* nil = graph()->NewNode(common()->Dead());
689 op = common()->End();
690 Node* n39 = graph()->NewNode(op, nil);
691 USE(n39);
692 op = common()->Merge(2);
693 Node* n37 = graph()->NewNode(op, nil, nil);
694 USE(n37);
695 op = common()->Return();
696 Node* n29 = graph()->NewNode(op, nil, nil, nil);
697 USE(n29);
698 op = common()->Return();
699 Node* n36 = graph()->NewNode(op, nil, nil, nil);
700 USE(n36);
701 op = js()->Add();
702 Node* n27 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
703 USE(n27);
704 op = common()->IfSuccess();
705 Node* n28 = graph()->NewNode(op, nil);
706 USE(n28);
707 op = js()->Subtract();
708 Node* n34 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
709 USE(n34);
710 op = common()->IfSuccess();
711 Node* n35 = graph()->NewNode(op, nil);
712 USE(n35);
713 op = js()->Subtract();
714 Node* n25 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
715 USE(n25);
716 op = common()->Parameter(4);
717 Node* n5 = graph()->NewNode(op, nil);
718 USE(n5);
719 op = common()->Parameter(5);
720 Node* n7 = graph()->NewNode(op, nil);
721 USE(n7);
722 op = common()->FrameState(JS_FRAME, BailoutId(-1),
723 OutputFrameStateCombine::Ignore());
724 Node* n13 = graph()->NewNode(op, nil, nil, nil, nil, nil);
725 USE(n13);
726 op = common()->IfSuccess();
727 Node* n26 = graph()->NewNode(op, nil);
728 USE(n26);
729 op = js()->Multiply();
730 Node* n32 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
731 USE(n32);
732 op = common()->Parameter(1);
733 Node* n2 = graph()->NewNode(op, nil);
734 USE(n2);
735 op = common()->IfSuccess();
736 Node* n33 = graph()->NewNode(op, nil);
737 USE(n33);
738 op = js()->Subtract();
739 Node* n23 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
740 USE(n23);
741 op = common()->IfSuccess();
742 Node* n24 = graph()->NewNode(op, nil);
743 USE(n24);
744 op = common()->Start(4);
689 Node* n0 = graph()->NewNode(op); 745 Node* n0 = graph()->NewNode(op);
690 USE(n0); 746 USE(n0);
691 Node* nil = graph()->NewNode(common()->Dead()); 747 op = common()->StateValues(0);
692 op = common()->End(); 748 Node* n11 = graph()->NewNode(op);
693 Node* n23 = graph()->NewNode(op, nil); 749 USE(n11);
694 USE(n23); 750 op = common()->NumberConstant(0);
695 op = common()->Merge(2); 751 Node* n12 = graph()->NewNode(op);
696 Node* n22 = graph()->NewNode(op, nil, nil); 752 USE(n12);
753 op = common()->HeapConstant(unique_constant);
754 Node* n6 = graph()->NewNode(op);
755 USE(n6);
756 op = common()->Parameter(3);
757 Node* n4 = graph()->NewNode(op, nil);
758 USE(n4);
759 op = js()->LessThan();
760 Node* n15 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
761 USE(n15);
762 op = common()->IfFalse();
763 Node* n31 = graph()->NewNode(op, nil);
764 USE(n31);
765 op = js()->Add();
766 Node* n19 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
767 USE(n19);
768 op = js()->Multiply();
769 Node* n21 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
770 USE(n21);
771 op = common()->IfSuccess();
772 Node* n22 = graph()->NewNode(op, nil);
697 USE(n22); 773 USE(n22);
698 op = common()->Return(); 774 op = common()->Parameter(2);
699 Node* n16 = graph()->NewNode(op, nil, nil, nil); 775 Node* n3 = graph()->NewNode(op, nil);
700 USE(n16);
701 op = js()->Add();
702 Node* n15 = graph()->NewNode(op, nil, nil, nil, nil, nil);
703 USE(n15);
704 op = js()->Subtract();
705 Node* n14 = graph()->NewNode(op, nil, nil, nil, nil, nil);
706 USE(n14);
707 op = js()->Subtract();
708 Node* n13 = graph()->NewNode(op, nil, nil, nil, nil, nil);
709 USE(n13);
710 op = js()->Add();
711 Node* n11 = graph()->NewNode(op, nil, nil, nil, nil, nil);
712 USE(n11);
713 op = common()->Parameter(0);
714 Node* n2 = graph()->NewNode(op, n0);
715 USE(n2);
716 n11->ReplaceInput(0, n2);
717 op = common()->Parameter(0);
718 Node* n3 = graph()->NewNode(op, n0);
719 USE(n3); 776 USE(n3);
720 n11->ReplaceInput(1, n3); 777 op = js()->StackCheck();
721 op = &kHeapConstant; 778 Node* n9 = graph()->NewNode(op, nil, nil, nil, nil);
722 Node* n7 = graph()->NewNode(op); 779 USE(n9);
723 USE(n7); 780 op = common()->IfSuccess();
724 n11->ReplaceInput(2, n7);
725 op = js()->LessThan();
726 Node* n8 = graph()->NewNode(op, nil, nil, nil, nil, nil);
727 USE(n8);
728 n8->ReplaceInput(0, n2);
729 n8->ReplaceInput(1, n3);
730 n8->ReplaceInput(2, n7);
731 n8->ReplaceInput(3, n0);
732 n8->ReplaceInput(4, n0);
733 n11->ReplaceInput(3, n8);
734 op = common()->IfTrue();
735 Node* n10 = graph()->NewNode(op, nil); 781 Node* n10 = graph()->NewNode(op, nil);
736 USE(n10); 782 USE(n10);
737 op = common()->Branch(); 783 op = common()->Branch();
738 Node* n9 = graph()->NewNode(op, nil, nil); 784 Node* n17 = graph()->NewNode(op, nil, nil);
739 USE(n9); 785 USE(n17);
740 n9->ReplaceInput(0, n8); 786 op = common()->IfTrue();
741 n9->ReplaceInput(1, n0);
742 n10->ReplaceInput(0, n9);
743 n11->ReplaceInput(4, n10);
744 n13->ReplaceInput(0, n11);
745 op = js()->Multiply();
746 Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil);
747 USE(n12);
748 op = common()->Parameter(0);
749 Node* n4 = graph()->NewNode(op, n0);
750 USE(n4);
751 n12->ReplaceInput(0, n4);
752 n12->ReplaceInput(1, n4);
753 n12->ReplaceInput(2, n7);
754 n12->ReplaceInput(3, n11);
755 n12->ReplaceInput(4, n10);
756 n13->ReplaceInput(1, n12);
757 n13->ReplaceInput(2, n7);
758 n13->ReplaceInput(3, n12);
759 n13->ReplaceInput(4, n10);
760 n14->ReplaceInput(0, n13);
761 n14->ReplaceInput(1, n2);
762 n14->ReplaceInput(2, n7);
763 n14->ReplaceInput(3, n13);
764 n14->ReplaceInput(4, n10);
765 n15->ReplaceInput(0, n14);
766 op = common()->Parameter(0);
767 Node* n5 = graph()->NewNode(op, n0);
768 USE(n5);
769 n15->ReplaceInput(1, n5);
770 n15->ReplaceInput(2, n7);
771 n15->ReplaceInput(3, n14);
772 n15->ReplaceInput(4, n10);
773 n16->ReplaceInput(0, n15);
774 n16->ReplaceInput(1, n15);
775 n16->ReplaceInput(2, n10);
776 n22->ReplaceInput(0, n16);
777 op = common()->Return();
778 Node* n21 = graph()->NewNode(op, nil, nil, nil);
779 USE(n21);
780 op = js()->Subtract();
781 Node* n20 = graph()->NewNode(op, nil, nil, nil, nil, nil);
782 USE(n20);
783 op = js()->Multiply();
784 Node* n19 = graph()->NewNode(op, nil, nil, nil, nil, nil);
785 USE(n19);
786 n19->ReplaceInput(0, n4);
787 n19->ReplaceInput(1, n4);
788 n19->ReplaceInput(2, n7);
789 n19->ReplaceInput(3, n8);
790 op = common()->IfFalse();
791 Node* n18 = graph()->NewNode(op, nil); 787 Node* n18 = graph()->NewNode(op, nil);
792 USE(n18); 788 USE(n18);
793 n18->ReplaceInput(0, n9); 789 op = common()->IfSuccess();
794 n19->ReplaceInput(4, n18); 790 Node* n20 = graph()->NewNode(op, nil);
791 USE(n20);
792 op = common()->IfSuccess();
793 Node* n16 = graph()->NewNode(op, nil);
794 USE(n16);
795 n39->ReplaceInput(0, n37);
796 n37->ReplaceInput(0, n29);
797 n37->ReplaceInput(1, n36);
798 n29->ReplaceInput(0, n27);
799 n29->ReplaceInput(1, n27);
800 n29->ReplaceInput(2, n28);
801 n36->ReplaceInput(0, n34);
802 n36->ReplaceInput(1, n34);
803 n36->ReplaceInput(2, n35);
804 n27->ReplaceInput(0, n25);
805 n27->ReplaceInput(1, n5);
806 n27->ReplaceInput(2, n7);
807 n27->ReplaceInput(3, n13);
808 n27->ReplaceInput(4, n13);
809 n27->ReplaceInput(5, n25);
810 n27->ReplaceInput(6, n26);
811 n28->ReplaceInput(0, n27);
812 n34->ReplaceInput(0, n32);
813 n34->ReplaceInput(1, n2);
814 n34->ReplaceInput(2, n7);
815 n34->ReplaceInput(3, n13);
816 n34->ReplaceInput(4, n13);
817 n34->ReplaceInput(5, n32);
818 n34->ReplaceInput(6, n33);
819 n35->ReplaceInput(0, n34);
820 n25->ReplaceInput(0, n23);
821 n25->ReplaceInput(1, n2);
822 n25->ReplaceInput(2, n7);
823 n25->ReplaceInput(3, n13);
824 n25->ReplaceInput(4, n13);
825 n25->ReplaceInput(5, n23);
826 n25->ReplaceInput(6, n24);
827 n5->ReplaceInput(0, n0);
828 n7->ReplaceInput(0, n0);
829 n13->ReplaceInput(0, n11);
830 n13->ReplaceInput(1, n11);
831 n13->ReplaceInput(2, n11);
832 n13->ReplaceInput(3, n12);
833 n13->ReplaceInput(4, n6);
834 n26->ReplaceInput(0, n25);
835 n32->ReplaceInput(0, n4);
836 n32->ReplaceInput(1, n4);
837 n32->ReplaceInput(2, n7);
838 n32->ReplaceInput(3, n13);
839 n32->ReplaceInput(4, n13);
840 n32->ReplaceInput(5, n15);
841 n32->ReplaceInput(6, n31);
842 n2->ReplaceInput(0, n0);
843 n33->ReplaceInput(0, n32);
844 n23->ReplaceInput(0, n19);
845 n23->ReplaceInput(1, n21);
846 n23->ReplaceInput(2, n7);
847 n23->ReplaceInput(3, n13);
848 n23->ReplaceInput(4, n13);
849 n23->ReplaceInput(5, n21);
850 n23->ReplaceInput(6, n22);
851 n24->ReplaceInput(0, n23);
852 n4->ReplaceInput(0, n0);
853 n15->ReplaceInput(0, n2);
854 n15->ReplaceInput(1, n3);
855 n15->ReplaceInput(2, n7);
856 n15->ReplaceInput(3, n13);
857 n15->ReplaceInput(4, n9);
858 n15->ReplaceInput(5, n10);
859 n31->ReplaceInput(0, n17);
860 n19->ReplaceInput(0, n2);
861 n19->ReplaceInput(1, n3);
862 n19->ReplaceInput(2, n7);
863 n19->ReplaceInput(3, n13);
864 n19->ReplaceInput(4, n13);
865 n19->ReplaceInput(5, n15);
866 n19->ReplaceInput(6, n18);
867 n21->ReplaceInput(0, n4);
868 n21->ReplaceInput(1, n4);
869 n21->ReplaceInput(2, n7);
870 n21->ReplaceInput(3, n13);
871 n21->ReplaceInput(4, n13);
872 n21->ReplaceInput(5, n19);
873 n21->ReplaceInput(6, n20);
874 n22->ReplaceInput(0, n21);
875 n3->ReplaceInput(0, n0);
876 n9->ReplaceInput(0, n7);
877 n9->ReplaceInput(1, n13);
878 n9->ReplaceInput(2, n0);
879 n9->ReplaceInput(3, n0);
880 n10->ReplaceInput(0, n9);
881 n17->ReplaceInput(0, n15);
882 n17->ReplaceInput(1, n16);
883 n18->ReplaceInput(0, n17);
795 n20->ReplaceInput(0, n19); 884 n20->ReplaceInput(0, n19);
796 n20->ReplaceInput(1, n2); 885 n16->ReplaceInput(0, n15);
797 n20->ReplaceInput(2, n7);
798 n20->ReplaceInput(3, n19);
799 n20->ReplaceInput(4, n18);
800 n21->ReplaceInput(0, n20);
801 n21->ReplaceInput(1, n20);
802 n21->ReplaceInput(2, n18);
803 n22->ReplaceInput(1, n21);
804 n23->ReplaceInput(0, n22);
805 886
806 graph()->SetStart(n0); 887 graph()->SetStart(n0);
807 graph()->SetEnd(n23); 888 graph()->SetEnd(n39);
808 889
809 ComputeAndVerifySchedule(20); 890 ComputeAndVerifySchedule(34);
810 } 891 }
811 892
812 893
813 TEST_F(SchedulerTest, BuildScheduleSimpleLoop) { 894 TEST_F(SchedulerTest, BuildScheduleSimpleLoop) {
814 FLAG_turbo_deoptimization = false;
815
816 const Operator* op; 895 const Operator* op;
896 Unique<HeapObject> unique_constant =
897 Unique<HeapObject>::CreateImmovable(factory()->undefined_value());
817 898
818 // Manually transcripted code for: 899 // Manually transcripted code for:
819 // function turbo_fan_test(a, b) { 900 // function turbo_fan_test(a, b) {
820 // while (a < b) { 901 // while (a < b) {
821 // a++; 902 // a++;
822 // } 903 // }
823 // return a; 904 // return a;
824 // } 905 // }
825 op = common()->Start(0); 906 Node* nil = graph()->NewNode(common()->Dead());
907 op = common()->End();
908 Node* n34 = graph()->NewNode(op, nil);
909 USE(n34);
910 op = common()->Return();
911 Node* n32 = graph()->NewNode(op, nil, nil, nil);
912 USE(n32);
913 op = common()->Phi(kMachAnyTagged, 2);
914 Node* n13 = graph()->NewNode(op, nil, nil, nil);
915 USE(n13);
916 op = js()->LessThan();
917 Node* n16 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
918 USE(n16);
919 op = common()->IfFalse();
920 Node* n22 = graph()->NewNode(op, nil);
921 USE(n22);
922 op = common()->Parameter(1);
923 Node* n2 = graph()->NewNode(op, nil);
924 USE(n2);
925 op = js()->Add();
926 Node* n29 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
927 USE(n29);
928 op = common()->Loop(2);
929 Node* n12 = graph()->NewNode(op, nil, nil);
930 USE(n12);
931 op = common()->Parameter(2);
932 Node* n3 = graph()->NewNode(op, nil);
933 USE(n3);
934 op = common()->Parameter(3);
935 Node* n5 = graph()->NewNode(op, nil);
936 USE(n5);
937 op = common()->FrameState(JS_FRAME, BailoutId(-1),
938 OutputFrameStateCombine::Ignore());
939 Node* n11 = graph()->NewNode(op, nil, nil, nil, nil, nil);
940 USE(n11);
941 op = common()->EffectPhi(2);
942 Node* n14 = graph()->NewNode(op, nil, nil, nil);
943 USE(n14);
944 op = common()->Branch();
945 Node* n19 = graph()->NewNode(op, nil, nil);
946 USE(n19);
947 op = common()->Start(2);
826 Node* n0 = graph()->NewNode(op); 948 Node* n0 = graph()->NewNode(op);
827 USE(n0); 949 USE(n0);
828 Node* nil = graph()->NewNode(common()->Dead()); 950 op = js()->ToNumber();
829 op = common()->End(); 951 Node* n26 = graph()->NewNode(op, nil, nil, nil, nil, nil);
952 USE(n26);
953 op = common()->NumberConstant(1);
954 Node* n28 = graph()->NewNode(op);
955 USE(n28);
956 op = common()->IfSuccess();
957 Node* n27 = graph()->NewNode(op, nil);
958 USE(n27);
959 op = common()->IfSuccess();
960 Node* n8 = graph()->NewNode(op, nil);
961 USE(n8);
962 op = common()->IfSuccess();
963 Node* n30 = graph()->NewNode(op, nil);
964 USE(n30);
965 op = common()->StateValues(0);
966 Node* n9 = graph()->NewNode(op);
967 USE(n9);
968 op = common()->NumberConstant(0);
969 Node* n10 = graph()->NewNode(op);
970 USE(n10);
971 op = common()->HeapConstant(unique_constant);
972 Node* n4 = graph()->NewNode(op);
973 USE(n4);
974 op = js()->StackCheck();
975 Node* n7 = graph()->NewNode(op, nil, nil, nil, nil);
976 USE(n7);
977 op = js()->ToBoolean();
978 Node* n18 = graph()->NewNode(op, nil, nil);
979 USE(n18);
980 op = common()->IfSuccess();
981 Node* n17 = graph()->NewNode(op, nil);
982 USE(n17);
983 op = js()->StackCheck();
984 Node* n24 = graph()->NewNode(op, nil, nil, nil, nil);
985 USE(n24);
986 op = common()->IfSuccess();
987 Node* n25 = graph()->NewNode(op, nil);
988 USE(n25);
989 op = common()->IfTrue();
830 Node* n20 = graph()->NewNode(op, nil); 990 Node* n20 = graph()->NewNode(op, nil);
831 USE(n20); 991 USE(n20);
832 op = common()->Return(); 992 n34->ReplaceInput(0, n32);
833 Node* n19 = graph()->NewNode(op, nil, nil, nil); 993 n32->ReplaceInput(0, n13);
834 USE(n19); 994 n32->ReplaceInput(1, n16);
835 op = common()->Phi(kMachAnyTagged, 2); 995 n32->ReplaceInput(2, n22);
836 Node* n8 = graph()->NewNode(op, nil, nil, nil); 996 n13->ReplaceInput(0, n2);
837 USE(n8); 997 n13->ReplaceInput(1, n29);
838 op = common()->Parameter(0); 998 n13->ReplaceInput(2, n12);
839 Node* n2 = graph()->NewNode(op, n0); 999 n16->ReplaceInput(0, n13);
840 USE(n2); 1000 n16->ReplaceInput(1, n3);
841 n8->ReplaceInput(0, n2); 1001 n16->ReplaceInput(2, n5);
842 op = js()->Add(); 1002 n16->ReplaceInput(3, n11);
843 Node* n18 = graph()->NewNode(op, nil, nil, nil, nil, nil); 1003 n16->ReplaceInput(4, n14);
844 USE(n18); 1004 n16->ReplaceInput(5, n12);
845 op = js()->ToNumber(); 1005 n22->ReplaceInput(0, n19);
846 Node* n16 = graph()->NewNode(op, nil, nil, nil, nil); 1006 n2->ReplaceInput(0, n0);
847 USE(n16); 1007 n29->ReplaceInput(0, n26);
848 n16->ReplaceInput(0, n8); 1008 n29->ReplaceInput(1, n28);
849 op = &kHeapConstant; 1009 n29->ReplaceInput(2, n5);
850 Node* n5 = graph()->NewNode(op); 1010 n29->ReplaceInput(3, n11);
851 USE(n5); 1011 n29->ReplaceInput(4, n11);
852 n16->ReplaceInput(1, n5); 1012 n29->ReplaceInput(5, n26);
853 op = js()->LessThan(); 1013 n29->ReplaceInput(6, n27);
854 Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil);
855 USE(n12);
856 n12->ReplaceInput(0, n8); 1014 n12->ReplaceInput(0, n8);
857 op = common()->Phi(kMachAnyTagged, 2); 1015 n12->ReplaceInput(1, n30);
858 Node* n9 = graph()->NewNode(op, nil, nil, nil); 1016 n3->ReplaceInput(0, n0);
859 USE(n9); 1017 n5->ReplaceInput(0, n0);
860 op = common()->Parameter(0); 1018 n11->ReplaceInput(0, n9);
861 Node* n3 = graph()->NewNode(op, n0); 1019 n11->ReplaceInput(1, n9);
862 USE(n3); 1020 n11->ReplaceInput(2, n9);
863 n9->ReplaceInput(0, n3); 1021 n11->ReplaceInput(3, n10);
864 n9->ReplaceInput(1, n9); 1022 n11->ReplaceInput(4, n4);
865 op = common()->Loop(2); 1023 n14->ReplaceInput(0, n7);
866 Node* n6 = graph()->NewNode(op, nil, nil); 1024 n14->ReplaceInput(1, n29);
867 USE(n6); 1025 n14->ReplaceInput(2, n12);
868 n6->ReplaceInput(0, n0); 1026 n19->ReplaceInput(0, n18);
869 op = common()->IfTrue(); 1027 n19->ReplaceInput(1, n17);
870 Node* n14 = graph()->NewNode(op, nil); 1028 n26->ReplaceInput(0, n13);
871 USE(n14); 1029 n26->ReplaceInput(1, n5);
872 op = common()->Branch(); 1030 n26->ReplaceInput(2, n11);
873 Node* n13 = graph()->NewNode(op, nil, nil); 1031 n26->ReplaceInput(3, n24);
874 USE(n13); 1032 n26->ReplaceInput(4, n25);
875 n13->ReplaceInput(0, n12); 1033 n27->ReplaceInput(0, n26);
876 n13->ReplaceInput(1, n6); 1034 n8->ReplaceInput(0, n7);
877 n14->ReplaceInput(0, n13); 1035 n30->ReplaceInput(0, n29);
878 n6->ReplaceInput(1, n14); 1036 n7->ReplaceInput(0, n5);
879 n9->ReplaceInput(2, n6); 1037 n7->ReplaceInput(1, n11);
880 n12->ReplaceInput(1, n9); 1038 n7->ReplaceInput(2, n0);
881 n12->ReplaceInput(2, n5); 1039 n7->ReplaceInput(3, n0);
882 op = common()->Phi(kMachAnyTagged, 2);
883 Node* n10 = graph()->NewNode(op, nil, nil, nil);
884 USE(n10);
885 n10->ReplaceInput(0, n0);
886 n10->ReplaceInput(1, n18);
887 n10->ReplaceInput(2, n6);
888 n12->ReplaceInput(3, n10);
889 n12->ReplaceInput(4, n6);
890 n16->ReplaceInput(2, n12);
891 n16->ReplaceInput(3, n14);
892 n18->ReplaceInput(0, n16); 1040 n18->ReplaceInput(0, n16);
893 op = common()->NumberConstant(0); 1041 n18->ReplaceInput(1, n5);
894 Node* n17 = graph()->NewNode(op); 1042 n17->ReplaceInput(0, n16);
895 USE(n17); 1043 n24->ReplaceInput(0, n5);
896 n18->ReplaceInput(1, n17); 1044 n24->ReplaceInput(1, n11);
897 n18->ReplaceInput(2, n5); 1045 n24->ReplaceInput(2, n16);
898 n18->ReplaceInput(3, n16); 1046 n24->ReplaceInput(3, n20);
899 n18->ReplaceInput(4, n14); 1047 n25->ReplaceInput(0, n24);
900 n8->ReplaceInput(1, n18);
901 n8->ReplaceInput(2, n6);
902 n19->ReplaceInput(0, n8);
903 n19->ReplaceInput(1, n12);
904 op = common()->IfFalse();
905 Node* n15 = graph()->NewNode(op, nil);
906 USE(n15);
907 n15->ReplaceInput(0, n13);
908 n19->ReplaceInput(2, n15);
909 n20->ReplaceInput(0, n19); 1048 n20->ReplaceInput(0, n19);
910 1049
911 graph()->SetStart(n0); 1050 graph()->SetStart(n0);
912 graph()->SetEnd(n20); 1051 graph()->SetEnd(n34);
913 1052
914 ComputeAndVerifySchedule(19); 1053 ComputeAndVerifySchedule(30);
915 } 1054 }
916 1055
917 1056
918 TEST_F(SchedulerTest, BuildScheduleComplexLoops) { 1057 TEST_F(SchedulerTest, BuildScheduleComplexLoops) {
919 FLAG_turbo_deoptimization = false;
920
921 const Operator* op; 1058 const Operator* op;
1059 Unique<HeapObject> unique_constant =
1060 Unique<HeapObject>::CreateImmovable(factory()->undefined_value());
922 1061
923 // Manually transcripted code for: 1062 // Manually transcripted code for:
924 // function turbo_fan_test(a, b, c) { 1063 // function turbo_fan_test(a, b, c) {
925 // while (a < b) { 1064 // while (a < b) {
926 // a++; 1065 // a++;
927 // while (c < b) { 1066 // while (c < b) {
928 // c++; 1067 // c++;
929 // } 1068 // }
930 // } 1069 // }
931 // while (a < b) { 1070 // while (a < b) {
932 // a += 2; 1071 // a += 2;
933 // } 1072 // }
934 // return a; 1073 // return a;
935 // } 1074 // }
936 op = common()->Start(0); 1075 Node* nil = graph()->NewNode(common()->Dead());
1076 op = common()->End();
1077 Node* n71 = graph()->NewNode(op, nil);
1078 USE(n71);
1079 op = common()->Return();
1080 Node* n69 = graph()->NewNode(op, nil, nil, nil);
1081 USE(n69);
1082 op = common()->Phi(kMachAnyTagged, 2);
1083 Node* n53 = graph()->NewNode(op, nil, nil, nil);
1084 USE(n53);
1085 op = js()->LessThan();
1086 Node* n55 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1087 USE(n55);
1088 op = common()->IfFalse();
1089 Node* n61 = graph()->NewNode(op, nil);
1090 USE(n61);
1091 op = common()->Phi(kMachAnyTagged, 2);
1092 Node* n14 = graph()->NewNode(op, nil, nil, nil);
1093 USE(n14);
1094 op = js()->Add();
1095 Node* n66 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1096 USE(n66);
1097 op = common()->Loop(2);
1098 Node* n52 = graph()->NewNode(op, nil, nil);
1099 USE(n52);
1100 op = common()->Parameter(2);
1101 Node* n3 = graph()->NewNode(op, nil);
1102 USE(n3);
1103 op = common()->Parameter(4);
1104 Node* n6 = graph()->NewNode(op, nil);
1105 USE(n6);
1106 op = common()->FrameState(JS_FRAME, BailoutId(-1),
1107 OutputFrameStateCombine::Ignore());
1108 Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1109 USE(n12);
1110 op = common()->EffectPhi(2);
1111 Node* n54 = graph()->NewNode(op, nil, nil, nil);
1112 USE(n54);
1113 op = common()->Branch();
1114 Node* n58 = graph()->NewNode(op, nil, nil);
1115 USE(n58);
1116 op = common()->Parameter(1);
1117 Node* n2 = graph()->NewNode(op, nil);
1118 USE(n2);
1119 op = js()->Add();
1120 Node* n31 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1121 USE(n31);
1122 op = common()->Loop(2);
1123 Node* n13 = graph()->NewNode(op, nil, nil);
1124 USE(n13);
1125 op = common()->NumberConstant(2);
1126 Node* n65 = graph()->NewNode(op);
1127 USE(n65);
1128 op = js()->StackCheck();
1129 Node* n63 = graph()->NewNode(op, nil, nil, nil, nil);
1130 USE(n63);
1131 op = common()->IfSuccess();
1132 Node* n64 = graph()->NewNode(op, nil);
1133 USE(n64);
1134 op = common()->IfFalse();
1135 Node* n24 = graph()->NewNode(op, nil);
1136 USE(n24);
1137 op = common()->IfSuccess();
1138 Node* n67 = graph()->NewNode(op, nil);
1139 USE(n67);
1140 op = common()->Start(3);
937 Node* n0 = graph()->NewNode(op); 1141 Node* n0 = graph()->NewNode(op);
938 USE(n0); 1142 USE(n0);
939 Node* nil = graph()->NewNode(common()->Dead()); 1143 op = common()->StateValues(0);
940 op = common()->End(); 1144 Node* n10 = graph()->NewNode(op);
941 Node* n46 = graph()->NewNode(op, nil); 1145 USE(n10);
942 USE(n46); 1146 op = common()->NumberConstant(0);
943 op = common()->Return(); 1147 Node* n11 = graph()->NewNode(op);
944 Node* n45 = graph()->NewNode(op, nil, nil, nil); 1148 USE(n11);
945 USE(n45); 1149 op = common()->HeapConstant(unique_constant);
1150 Node* n5 = graph()->NewNode(op);
1151 USE(n5);
1152 op = js()->LessThan();
1153 Node* n18 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1154 USE(n18);
1155 op = js()->ToBoolean();
1156 Node* n57 = graph()->NewNode(op, nil, nil);
1157 USE(n57);
1158 op = common()->IfSuccess();
1159 Node* n56 = graph()->NewNode(op, nil);
1160 USE(n56);
1161 op = js()->ToNumber();
1162 Node* n28 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1163 USE(n28);
1164 op = common()->NumberConstant(1);
1165 Node* n30 = graph()->NewNode(op);
1166 USE(n30);
1167 op = common()->IfSuccess();
1168 Node* n29 = graph()->NewNode(op, nil);
1169 USE(n29);
1170 op = common()->IfSuccess();
1171 Node* n9 = graph()->NewNode(op, nil);
1172 USE(n9);
1173 op = common()->IfFalse();
1174 Node* n42 = graph()->NewNode(op, nil);
1175 USE(n42);
1176 op = common()->IfTrue();
1177 Node* n59 = graph()->NewNode(op, nil);
1178 USE(n59);
1179 op = common()->Branch();
1180 Node* n21 = graph()->NewNode(op, nil, nil);
1181 USE(n21);
1182 op = common()->EffectPhi(2);
1183 Node* n16 = graph()->NewNode(op, nil, nil, nil);
1184 USE(n16);
1185 op = js()->StackCheck();
1186 Node* n26 = graph()->NewNode(op, nil, nil, nil, nil);
1187 USE(n26);
1188 op = common()->IfSuccess();
1189 Node* n27 = graph()->NewNode(op, nil);
1190 USE(n27);
1191 op = js()->StackCheck();
1192 Node* n8 = graph()->NewNode(op, nil, nil, nil, nil);
1193 USE(n8);
1194 op = common()->Branch();
1195 Node* n39 = graph()->NewNode(op, nil, nil);
1196 USE(n39);
1197 op = js()->ToBoolean();
1198 Node* n20 = graph()->NewNode(op, nil, nil);
1199 USE(n20);
1200 op = common()->IfSuccess();
1201 Node* n19 = graph()->NewNode(op, nil);
1202 USE(n19);
1203 op = js()->LessThan();
1204 Node* n36 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1205 USE(n36);
1206 op = common()->IfTrue();
1207 Node* n22 = graph()->NewNode(op, nil);
1208 USE(n22);
1209 op = js()->ToBoolean();
1210 Node* n38 = graph()->NewNode(op, nil, nil);
1211 USE(n38);
1212 op = common()->IfSuccess();
1213 Node* n37 = graph()->NewNode(op, nil);
1214 USE(n37);
946 op = common()->Phi(kMachAnyTagged, 2); 1215 op = common()->Phi(kMachAnyTagged, 2);
1216 Node* n34 = graph()->NewNode(op, nil, nil, nil);
1217 USE(n34);
1218 op = common()->EffectPhi(2);
947 Node* n35 = graph()->NewNode(op, nil, nil, nil); 1219 Node* n35 = graph()->NewNode(op, nil, nil, nil);
948 USE(n35); 1220 USE(n35);
949 op = common()->Phi(kMachAnyTagged, 2);
950 Node* n9 = graph()->NewNode(op, nil, nil, nil);
951 USE(n9);
952 op = common()->Parameter(0);
953 Node* n2 = graph()->NewNode(op, n0);
954 USE(n2);
955 n9->ReplaceInput(0, n2);
956 op = common()->Phi(kMachAnyTagged, 2);
957 Node* n23 = graph()->NewNode(op, nil, nil, nil);
958 USE(n23);
959 op = js()->Add();
960 Node* n20 = graph()->NewNode(op, nil, nil, nil, nil, nil);
961 USE(n20);
962 op = js()->ToNumber();
963 Node* n18 = graph()->NewNode(op, nil, nil, nil, nil);
964 USE(n18);
965 n18->ReplaceInput(0, n9);
966 op = &kHeapConstant;
967 Node* n6 = graph()->NewNode(op);
968 USE(n6);
969 n18->ReplaceInput(1, n6);
970 op = js()->LessThan();
971 Node* n14 = graph()->NewNode(op, nil, nil, nil, nil, nil);
972 USE(n14);
973 n14->ReplaceInput(0, n9);
974 op = common()->Phi(kMachAnyTagged, 2);
975 Node* n10 = graph()->NewNode(op, nil, nil, nil);
976 USE(n10);
977 op = common()->Parameter(0);
978 Node* n3 = graph()->NewNode(op, n0);
979 USE(n3);
980 n10->ReplaceInput(0, n3);
981 op = common()->Phi(kMachAnyTagged, 2);
982 Node* n24 = graph()->NewNode(op, nil, nil, nil);
983 USE(n24);
984 n24->ReplaceInput(0, n10);
985 n24->ReplaceInput(1, n24);
986 op = common()->Loop(2);
987 Node* n21 = graph()->NewNode(op, nil, nil);
988 USE(n21);
989 op = common()->IfTrue();
990 Node* n16 = graph()->NewNode(op, nil);
991 USE(n16);
992 op = common()->Branch();
993 Node* n15 = graph()->NewNode(op, nil, nil);
994 USE(n15);
995 n15->ReplaceInput(0, n14);
996 op = common()->Loop(2);
997 Node* n7 = graph()->NewNode(op, nil, nil);
998 USE(n7);
999 n7->ReplaceInput(0, n0);
1000 op = common()->IfFalse();
1001 Node* n30 = graph()->NewNode(op, nil);
1002 USE(n30);
1003 op = common()->Branch();
1004 Node* n28 = graph()->NewNode(op, nil, nil);
1005 USE(n28);
1006 op = js()->LessThan();
1007 Node* n27 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1008 USE(n27);
1009 op = common()->Phi(kMachAnyTagged, 2);
1010 Node* n25 = graph()->NewNode(op, nil, nil, nil);
1011 USE(n25);
1012 op = common()->Phi(kMachAnyTagged, 2);
1013 Node* n11 = graph()->NewNode(op, nil, nil, nil);
1014 USE(n11);
1015 op = common()->Parameter(0);
1016 Node* n4 = graph()->NewNode(op, n0);
1017 USE(n4);
1018 n11->ReplaceInput(0, n4);
1019 n11->ReplaceInput(1, n25);
1020 n11->ReplaceInput(2, n7);
1021 n25->ReplaceInput(0, n11);
1022 op = js()->Add();
1023 Node* n32 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1024 USE(n32);
1025 op = js()->ToNumber();
1026 Node* n31 = graph()->NewNode(op, nil, nil, nil, nil);
1027 USE(n31);
1028 n31->ReplaceInput(0, n25);
1029 n31->ReplaceInput(1, n6);
1030 n31->ReplaceInput(2, n27);
1031 op = common()->IfTrue();
1032 Node* n29 = graph()->NewNode(op, nil);
1033 USE(n29);
1034 n29->ReplaceInput(0, n28);
1035 n31->ReplaceInput(3, n29);
1036 n32->ReplaceInput(0, n31);
1037 op = common()->NumberConstant(0);
1038 Node* n19 = graph()->NewNode(op);
1039 USE(n19);
1040 n32->ReplaceInput(1, n19);
1041 n32->ReplaceInput(2, n6);
1042 n32->ReplaceInput(3, n31);
1043 n32->ReplaceInput(4, n29);
1044 n25->ReplaceInput(1, n32);
1045 n25->ReplaceInput(2, n21);
1046 n27->ReplaceInput(0, n25);
1047 n27->ReplaceInput(1, n24);
1048 n27->ReplaceInput(2, n6);
1049 op = common()->Phi(kMachAnyTagged, 2);
1050 Node* n26 = graph()->NewNode(op, nil, nil, nil);
1051 USE(n26);
1052 n26->ReplaceInput(0, n20);
1053 n26->ReplaceInput(1, n32);
1054 n26->ReplaceInput(2, n21);
1055 n27->ReplaceInput(3, n26);
1056 n27->ReplaceInput(4, n21);
1057 n28->ReplaceInput(0, n27);
1058 n28->ReplaceInput(1, n21);
1059 n30->ReplaceInput(0, n28);
1060 n7->ReplaceInput(1, n30);
1061 n15->ReplaceInput(1, n7);
1062 n16->ReplaceInput(0, n15);
1063 n21->ReplaceInput(0, n16);
1064 n21->ReplaceInput(1, n29);
1065 n24->ReplaceInput(2, n21);
1066 n10->ReplaceInput(1, n24);
1067 n10->ReplaceInput(2, n7);
1068 n14->ReplaceInput(1, n10);
1069 n14->ReplaceInput(2, n6);
1070 op = common()->Phi(kMachAnyTagged, 2);
1071 Node* n12 = graph()->NewNode(op, nil, nil, nil);
1072 USE(n12);
1073 n12->ReplaceInput(0, n0);
1074 n12->ReplaceInput(1, n27);
1075 n12->ReplaceInput(2, n7);
1076 n14->ReplaceInput(3, n12);
1077 n14->ReplaceInput(4, n7);
1078 n18->ReplaceInput(2, n14);
1079 n18->ReplaceInput(3, n16);
1080 n20->ReplaceInput(0, n18);
1081 n20->ReplaceInput(1, n19);
1082 n20->ReplaceInput(2, n6);
1083 n20->ReplaceInput(3, n18);
1084 n20->ReplaceInput(4, n16);
1085 n23->ReplaceInput(0, n20);
1086 n23->ReplaceInput(1, n23);
1087 n23->ReplaceInput(2, n21);
1088 n9->ReplaceInput(1, n23);
1089 n9->ReplaceInput(2, n7);
1090 n35->ReplaceInput(0, n9);
1091 op = js()->Add();
1092 Node* n44 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1093 USE(n44);
1094 n44->ReplaceInput(0, n35);
1095 op = common()->NumberConstant(0);
1096 Node* n43 = graph()->NewNode(op);
1097 USE(n43);
1098 n44->ReplaceInput(1, n43);
1099 n44->ReplaceInput(2, n6);
1100 op = js()->LessThan();
1101 Node* n39 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1102 USE(n39);
1103 n39->ReplaceInput(0, n35);
1104 op = common()->Phi(kMachAnyTagged, 2);
1105 Node* n36 = graph()->NewNode(op, nil, nil, nil);
1106 USE(n36);
1107 n36->ReplaceInput(0, n10);
1108 n36->ReplaceInput(1, n36);
1109 op = common()->Loop(2); 1221 op = common()->Loop(2);
1110 Node* n33 = graph()->NewNode(op, nil, nil); 1222 Node* n33 = graph()->NewNode(op, nil, nil);
1111 USE(n33); 1223 USE(n33);
1112 op = common()->IfFalse(); 1224 op = common()->Phi(kMachAnyTagged, 2);
1113 Node* n17 = graph()->NewNode(op, nil); 1225 Node* n15 = graph()->NewNode(op, nil, nil, nil);
1114 USE(n17); 1226 USE(n15);
1115 n17->ReplaceInput(0, n15); 1227 op = js()->Add();
1116 n33->ReplaceInput(0, n17); 1228 Node* n48 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1229 USE(n48);
1230 op = common()->IfSuccess();
1231 Node* n32 = graph()->NewNode(op, nil);
1232 USE(n32);
1233 op = common()->IfSuccess();
1234 Node* n49 = graph()->NewNode(op, nil);
1235 USE(n49);
1236 op = common()->Parameter(3);
1237 Node* n4 = graph()->NewNode(op, nil);
1238 USE(n4);
1239 op = js()->ToNumber();
1240 Node* n46 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1241 USE(n46);
1242 op = common()->IfSuccess();
1243 Node* n47 = graph()->NewNode(op, nil);
1244 USE(n47);
1245 op = js()->StackCheck();
1246 Node* n44 = graph()->NewNode(op, nil, nil, nil, nil);
1247 USE(n44);
1248 op = common()->IfSuccess();
1249 Node* n45 = graph()->NewNode(op, nil);
1250 USE(n45);
1117 op = common()->IfTrue(); 1251 op = common()->IfTrue();
1118 Node* n41 = graph()->NewNode(op, nil); 1252 Node* n40 = graph()->NewNode(op, nil);
1119 USE(n41);
1120 op = common()->Branch();
1121 Node* n40 = graph()->NewNode(op, nil, nil);
1122 USE(n40); 1253 USE(n40);
1254 n71->ReplaceInput(0, n69);
1255 n69->ReplaceInput(0, n53);
1256 n69->ReplaceInput(1, n55);
1257 n69->ReplaceInput(2, n61);
1258 n53->ReplaceInput(0, n14);
1259 n53->ReplaceInput(1, n66);
1260 n53->ReplaceInput(2, n52);
1261 n55->ReplaceInput(0, n53);
1262 n55->ReplaceInput(1, n3);
1263 n55->ReplaceInput(2, n6);
1264 n55->ReplaceInput(3, n12);
1265 n55->ReplaceInput(4, n54);
1266 n55->ReplaceInput(5, n52);
1267 n61->ReplaceInput(0, n58);
1268 n14->ReplaceInput(0, n2);
1269 n14->ReplaceInput(1, n31);
1270 n14->ReplaceInput(2, n13);
1271 n66->ReplaceInput(0, n53);
1272 n66->ReplaceInput(1, n65);
1273 n66->ReplaceInput(2, n6);
1274 n66->ReplaceInput(3, n12);
1275 n66->ReplaceInput(4, n12);
1276 n66->ReplaceInput(5, n63);
1277 n66->ReplaceInput(6, n64);
1278 n52->ReplaceInput(0, n24);
1279 n52->ReplaceInput(1, n67);
1280 n3->ReplaceInput(0, n0);
1281 n6->ReplaceInput(0, n0);
1282 n12->ReplaceInput(0, n10);
1283 n12->ReplaceInput(1, n10);
1284 n12->ReplaceInput(2, n10);
1285 n12->ReplaceInput(3, n11);
1286 n12->ReplaceInput(4, n5);
1287 n54->ReplaceInput(0, n18);
1288 n54->ReplaceInput(1, n66);
1289 n54->ReplaceInput(2, n52);
1290 n58->ReplaceInput(0, n57);
1291 n58->ReplaceInput(1, n56);
1292 n2->ReplaceInput(0, n0);
1293 n31->ReplaceInput(0, n28);
1294 n31->ReplaceInput(1, n30);
1295 n31->ReplaceInput(2, n6);
1296 n31->ReplaceInput(3, n12);
1297 n31->ReplaceInput(4, n12);
1298 n31->ReplaceInput(5, n28);
1299 n31->ReplaceInput(6, n29);
1300 n13->ReplaceInput(0, n9);
1301 n13->ReplaceInput(1, n42);
1302 n63->ReplaceInput(0, n6);
1303 n63->ReplaceInput(1, n12);
1304 n63->ReplaceInput(2, n55);
1305 n63->ReplaceInput(3, n59);
1306 n64->ReplaceInput(0, n63);
1307 n24->ReplaceInput(0, n21);
1308 n67->ReplaceInput(0, n66);
1309 n18->ReplaceInput(0, n14);
1310 n18->ReplaceInput(1, n3);
1311 n18->ReplaceInput(2, n6);
1312 n18->ReplaceInput(3, n12);
1313 n18->ReplaceInput(4, n16);
1314 n18->ReplaceInput(5, n13);
1315 n57->ReplaceInput(0, n55);
1316 n57->ReplaceInput(1, n6);
1317 n56->ReplaceInput(0, n55);
1318 n28->ReplaceInput(0, n14);
1319 n28->ReplaceInput(1, n6);
1320 n28->ReplaceInput(2, n12);
1321 n28->ReplaceInput(3, n26);
1322 n28->ReplaceInput(4, n27);
1323 n29->ReplaceInput(0, n28);
1324 n9->ReplaceInput(0, n8);
1325 n42->ReplaceInput(0, n39);
1326 n59->ReplaceInput(0, n58);
1327 n21->ReplaceInput(0, n20);
1328 n21->ReplaceInput(1, n19);
1329 n16->ReplaceInput(0, n8);
1330 n16->ReplaceInput(1, n36);
1331 n16->ReplaceInput(2, n13);
1332 n26->ReplaceInput(0, n6);
1333 n26->ReplaceInput(1, n12);
1334 n26->ReplaceInput(2, n18);
1335 n26->ReplaceInput(3, n22);
1336 n27->ReplaceInput(0, n26);
1337 n8->ReplaceInput(0, n6);
1338 n8->ReplaceInput(1, n12);
1339 n8->ReplaceInput(2, n0);
1340 n8->ReplaceInput(3, n0);
1341 n39->ReplaceInput(0, n38);
1342 n39->ReplaceInput(1, n37);
1343 n20->ReplaceInput(0, n18);
1344 n20->ReplaceInput(1, n6);
1345 n19->ReplaceInput(0, n18);
1346 n36->ReplaceInput(0, n34);
1347 n36->ReplaceInput(1, n3);
1348 n36->ReplaceInput(2, n6);
1349 n36->ReplaceInput(3, n12);
1350 n36->ReplaceInput(4, n35);
1351 n36->ReplaceInput(5, n33);
1352 n22->ReplaceInput(0, n21);
1353 n38->ReplaceInput(0, n36);
1354 n38->ReplaceInput(1, n6);
1355 n37->ReplaceInput(0, n36);
1356 n34->ReplaceInput(0, n15);
1357 n34->ReplaceInput(1, n48);
1358 n34->ReplaceInput(2, n33);
1359 n35->ReplaceInput(0, n31);
1360 n35->ReplaceInput(1, n48);
1361 n35->ReplaceInput(2, n33);
1362 n33->ReplaceInput(0, n32);
1363 n33->ReplaceInput(1, n49);
1364 n15->ReplaceInput(0, n4);
1365 n15->ReplaceInput(1, n34);
1366 n15->ReplaceInput(2, n13);
1367 n48->ReplaceInput(0, n46);
1368 n48->ReplaceInput(1, n30);
1369 n48->ReplaceInput(2, n6);
1370 n48->ReplaceInput(3, n12);
1371 n48->ReplaceInput(4, n12);
1372 n48->ReplaceInput(5, n46);
1373 n48->ReplaceInput(6, n47);
1374 n32->ReplaceInput(0, n31);
1375 n49->ReplaceInput(0, n48);
1376 n4->ReplaceInput(0, n0);
1377 n46->ReplaceInput(0, n34);
1378 n46->ReplaceInput(1, n6);
1379 n46->ReplaceInput(2, n12);
1380 n46->ReplaceInput(3, n44);
1381 n46->ReplaceInput(4, n45);
1382 n47->ReplaceInput(0, n46);
1383 n44->ReplaceInput(0, n6);
1384 n44->ReplaceInput(1, n12);
1385 n44->ReplaceInput(2, n36);
1386 n44->ReplaceInput(3, n40);
1387 n45->ReplaceInput(0, n44);
1123 n40->ReplaceInput(0, n39); 1388 n40->ReplaceInput(0, n39);
1124 n40->ReplaceInput(1, n33);
1125 n41->ReplaceInput(0, n40);
1126 n33->ReplaceInput(1, n41);
1127 n36->ReplaceInput(2, n33);
1128 n39->ReplaceInput(1, n36);
1129 n39->ReplaceInput(2, n6);
1130 op = common()->Phi(kMachAnyTagged, 2);
1131 Node* n38 = graph()->NewNode(op, nil, nil, nil);
1132 USE(n38);
1133 n38->ReplaceInput(0, n14);
1134 n38->ReplaceInput(1, n44);
1135 n38->ReplaceInput(2, n33);
1136 n39->ReplaceInput(3, n38);
1137 n39->ReplaceInput(4, n33);
1138 n44->ReplaceInput(3, n39);
1139 n44->ReplaceInput(4, n41);
1140 n35->ReplaceInput(1, n44);
1141 n35->ReplaceInput(2, n33);
1142 n45->ReplaceInput(0, n35);
1143 n45->ReplaceInput(1, n39);
1144 op = common()->IfFalse();
1145 Node* n42 = graph()->NewNode(op, nil);
1146 USE(n42);
1147 n42->ReplaceInput(0, n40);
1148 n45->ReplaceInput(2, n42);
1149 n46->ReplaceInput(0, n45);
1150 1389
1151 graph()->SetStart(n0); 1390 graph()->SetStart(n0);
1152 graph()->SetEnd(n46); 1391 graph()->SetEnd(n71);
1153 1392
1154 ComputeAndVerifySchedule(46); 1393 ComputeAndVerifySchedule(65);
1155 } 1394 }
1156 1395
1157 1396
1158 TEST_F(SchedulerTest, BuildScheduleBreakAndContinue) { 1397 TEST_F(SchedulerTest, BuildScheduleBreakAndContinue) {
1159 FLAG_turbo_deoptimization = false;
1160
1161 const Operator* op; 1398 const Operator* op;
1399 Unique<HeapObject> unique_constant =
1400 Unique<HeapObject>::CreateImmovable(factory()->undefined_value());
1162 1401
1163 // Manually transcripted code for: 1402 // Manually transcripted code for:
1164 // function turbo_fan_test(a, b, c) { 1403 // function turbo_fan_test(a, b, c) {
1165 // var d = 0; 1404 // var d = 0;
1166 // while (a < b) { 1405 // while (a < b) {
1167 // a++; 1406 // a++;
1168 // while (c < b) { 1407 // while (c < b) {
1169 // c++; 1408 // c++;
1170 // if (d == 0) break; 1409 // if (d == 0) break;
1171 // a++; 1410 // a++;
1172 // } 1411 // }
1173 // if (a == 1) continue; 1412 // if (a == 1) continue;
1174 // d++; 1413 // d++;
1175 // } 1414 // }
1176 // return a + d; 1415 // return a + d;
1177 // } 1416 // }
1178 op = common()->Start(0); 1417 Node* nil = graph()->NewNode(common()->Dead());
1418 op = common()->End();
1419 Node* n86 = graph()->NewNode(op, nil);
1420 USE(n86);
1421 op = common()->Return();
1422 Node* n84 = graph()->NewNode(op, nil, nil, nil);
1423 USE(n84);
1424 op = js()->Add();
1425 Node* n82 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1426 USE(n82);
1427 op = common()->IfSuccess();
1428 Node* n83 = graph()->NewNode(op, nil);
1429 USE(n83);
1430 op = common()->Phi(kMachAnyTagged, 2);
1431 Node* n15 = graph()->NewNode(op, nil, nil, nil);
1432 USE(n15);
1433 op = common()->Phi(kMachAnyTagged, 2);
1434 Node* n17 = graph()->NewNode(op, nil, nil, nil);
1435 USE(n17);
1436 op = common()->Parameter(4);
1437 Node* n6 = graph()->NewNode(op, nil);
1438 USE(n6);
1439 op = common()->FrameState(JS_FRAME, BailoutId(-1),
1440 OutputFrameStateCombine::Ignore());
1441 Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1442 USE(n12);
1443 op = js()->LessThan();
1444 Node* n19 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1445 USE(n19);
1446 op = common()->IfFalse();
1447 Node* n25 = graph()->NewNode(op, nil);
1448 USE(n25);
1449 op = common()->Parameter(1);
1450 Node* n2 = graph()->NewNode(op, nil);
1451 USE(n2);
1452 op = common()->Phi(kMachAnyTagged, 2);
1453 Node* n35 = graph()->NewNode(op, nil, nil, nil);
1454 USE(n35);
1455 op = common()->Loop(2);
1456 Node* n14 = graph()->NewNode(op, nil, nil);
1457 USE(n14);
1458 op = common()->NumberConstant(0);
1459 Node* n11 = graph()->NewNode(op);
1460 USE(n11);
1461 op = common()->Phi(kMachAnyTagged, 2);
1462 Node* n81 = graph()->NewNode(op, nil, nil, nil);
1463 USE(n81);
1464 op = common()->Start(3);
1179 Node* n0 = graph()->NewNode(op); 1465 Node* n0 = graph()->NewNode(op);
1180 USE(n0); 1466 USE(n0);
1181 Node* nil = graph()->NewNode(common()->Dead()); 1467 op = common()->StateValues(0);
1182 op = common()->End(); 1468 Node* n10 = graph()->NewNode(op);
1183 Node* n58 = graph()->NewNode(op, nil); 1469 USE(n10);
1184 USE(n58); 1470 op = common()->HeapConstant(unique_constant);
1185 op = common()->Return(); 1471 Node* n5 = graph()->NewNode(op);
1472 USE(n5);
1473 op = common()->Parameter(2);
1474 Node* n3 = graph()->NewNode(op, nil);
1475 USE(n3);
1476 op = common()->EffectPhi(2);
1477 Node* n18 = graph()->NewNode(op, nil, nil, nil);
1478 USE(n18);
1479 op = common()->Branch();
1480 Node* n22 = graph()->NewNode(op, nil, nil);
1481 USE(n22);
1482 op = js()->Add();
1483 Node* n32 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1484 USE(n32);
1485 op = js()->Add();
1486 Node* n64 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1487 USE(n64);
1488 op = common()->Loop(2);
1489 Node* n34 = graph()->NewNode(op, nil, nil);
1490 USE(n34);
1491 op = common()->IfSuccess();
1492 Node* n9 = graph()->NewNode(op, nil);
1493 USE(n9);
1494 op = common()->Merge(2);
1495 Node* n72 = graph()->NewNode(op, nil, nil);
1496 USE(n72);
1497 op = js()->Add();
1498 Node* n78 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1499 USE(n78);
1500 op = js()->StackCheck();
1501 Node* n8 = graph()->NewNode(op, nil, nil, nil, nil);
1502 USE(n8);
1503 op = common()->EffectPhi(2);
1504 Node* n80 = graph()->NewNode(op, nil, nil, nil);
1505 USE(n80);
1506 op = js()->ToBoolean();
1507 Node* n21 = graph()->NewNode(op, nil, nil);
1508 USE(n21);
1509 op = common()->IfSuccess();
1510 Node* n20 = graph()->NewNode(op, nil);
1511 USE(n20);
1512 op = js()->ToNumber();
1513 Node* n29 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1514 USE(n29);
1515 op = common()->NumberConstant(1);
1516 Node* n31 = graph()->NewNode(op);
1517 USE(n31);
1518 op = common()->IfSuccess();
1519 Node* n30 = graph()->NewNode(op, nil);
1520 USE(n30);
1521 op = js()->ToNumber();
1522 Node* n62 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1523 USE(n62);
1524 op = common()->IfSuccess();
1525 Node* n63 = graph()->NewNode(op, nil);
1526 USE(n63);
1527 op = common()->IfSuccess();
1528 Node* n33 = graph()->NewNode(op, nil);
1529 USE(n33);
1530 op = common()->IfSuccess();
1531 Node* n65 = graph()->NewNode(op, nil);
1532 USE(n65);
1533 op = common()->IfTrue();
1534 Node* n71 = graph()->NewNode(op, nil);
1535 USE(n71);
1536 op = common()->IfSuccess();
1537 Node* n79 = graph()->NewNode(op, nil);
1538 USE(n79);
1539 op = js()->ToNumber();
1540 Node* n76 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1541 USE(n76);
1542 op = common()->IfSuccess();
1543 Node* n77 = graph()->NewNode(op, nil);
1544 USE(n77);
1545 op = js()->Equal();
1546 Node* n67 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1547 USE(n67);
1548 op = js()->StackCheck();
1549 Node* n27 = graph()->NewNode(op, nil, nil, nil, nil);
1550 USE(n27);
1551 op = common()->IfSuccess();
1552 Node* n28 = graph()->NewNode(op, nil);
1553 USE(n28);
1554 op = js()->Equal();
1555 Node* n52 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1556 USE(n52);
1557 op = common()->IfFalse();
1558 Node* n60 = graph()->NewNode(op, nil);
1559 USE(n60);
1560 op = common()->Branch();
1561 Node* n70 = graph()->NewNode(op, nil, nil);
1562 USE(n70);
1563 op = common()->IfFalse();
1564 Node* n74 = graph()->NewNode(op, nil);
1565 USE(n74);
1566 op = common()->EffectPhi(2);
1186 Node* n57 = graph()->NewNode(op, nil, nil, nil); 1567 Node* n57 = graph()->NewNode(op, nil, nil, nil);
1187 USE(n57); 1568 USE(n57);
1569 op = common()->Merge(2);
1570 Node* n45 = graph()->NewNode(op, nil, nil);
1571 USE(n45);
1572 op = common()->IfTrue();
1573 Node* n23 = graph()->NewNode(op, nil);
1574 USE(n23);
1188 op = js()->Add(); 1575 op = js()->Add();
1189 Node* n56 = graph()->NewNode(op, nil, nil, nil, nil, nil); 1576 Node* n50 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1577 USE(n50);
1578 op = common()->IfSuccess();
1579 Node* n51 = graph()->NewNode(op, nil);
1580 USE(n51);
1581 op = common()->Branch();
1582 Node* n55 = graph()->NewNode(op, nil, nil);
1583 USE(n55);
1584 op = js()->ToBoolean();
1585 Node* n69 = graph()->NewNode(op, nil, nil);
1586 USE(n69);
1587 op = common()->IfSuccess();
1588 Node* n68 = graph()->NewNode(op, nil);
1589 USE(n68);
1590 op = js()->LessThan();
1591 Node* n38 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1592 USE(n38);
1593 op = common()->IfFalse();
1594 Node* n44 = graph()->NewNode(op, nil);
1595 USE(n44);
1596 op = common()->IfTrue();
1597 Node* n56 = graph()->NewNode(op, nil);
1190 USE(n56); 1598 USE(n56);
1191 op = common()->Phi(kMachAnyTagged, 2);
1192 Node* n10 = graph()->NewNode(op, nil, nil, nil);
1193 USE(n10);
1194 op = common()->Parameter(0);
1195 Node* n2 = graph()->NewNode(op, n0);
1196 USE(n2);
1197 n10->ReplaceInput(0, n2);
1198 op = common()->Phi(kMachAnyTagged, 2);
1199 Node* n25 = graph()->NewNode(op, nil, nil, nil);
1200 USE(n25);
1201 op = js()->Add();
1202 Node* n22 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1203 USE(n22);
1204 op = js()->ToNumber(); 1599 op = js()->ToNumber();
1205 Node* n20 = graph()->NewNode(op, nil, nil, nil, nil); 1600 Node* n48 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1206 USE(n20); 1601 USE(n48);
1207 n20->ReplaceInput(0, n10); 1602 op = common()->IfSuccess();
1208 op = &kHeapConstant;
1209 Node* n6 = graph()->NewNode(op);
1210 USE(n6);
1211 n20->ReplaceInput(1, n6);
1212 op = js()->LessThan();
1213 Node* n16 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1214 USE(n16);
1215 n16->ReplaceInput(0, n10);
1216 op = common()->Phi(kMachAnyTagged, 2);
1217 Node* n11 = graph()->NewNode(op, nil, nil, nil);
1218 USE(n11);
1219 op = common()->Parameter(0);
1220 Node* n3 = graph()->NewNode(op, n0);
1221 USE(n3);
1222 n11->ReplaceInput(0, n3);
1223 op = common()->Phi(kMachAnyTagged, 2);
1224 Node* n26 = graph()->NewNode(op, nil, nil, nil);
1225 USE(n26);
1226 n26->ReplaceInput(0, n11);
1227 n26->ReplaceInput(1, n26);
1228 op = common()->Loop(2);
1229 Node* n23 = graph()->NewNode(op, nil, nil);
1230 USE(n23);
1231 op = common()->IfTrue();
1232 Node* n18 = graph()->NewNode(op, nil);
1233 USE(n18);
1234 op = common()->Branch();
1235 Node* n17 = graph()->NewNode(op, nil, nil);
1236 USE(n17);
1237 n17->ReplaceInput(0, n16);
1238 op = common()->Loop(2);
1239 Node* n8 = graph()->NewNode(op, nil, nil);
1240 USE(n8);
1241 n8->ReplaceInput(0, n0);
1242 op = common()->Merge(2);
1243 Node* n53 = graph()->NewNode(op, nil, nil);
1244 USE(n53);
1245 op = common()->IfTrue();
1246 Node* n49 = graph()->NewNode(op, nil); 1603 Node* n49 = graph()->NewNode(op, nil);
1247 USE(n49); 1604 USE(n49);
1605 op = js()->ToBoolean();
1606 Node* n54 = graph()->NewNode(op, nil, nil);
1607 USE(n54);
1608 op = common()->IfSuccess();
1609 Node* n53 = graph()->NewNode(op, nil);
1610 USE(n53);
1611 op = common()->Phi(kMachAnyTagged, 2);
1612 Node* n36 = graph()->NewNode(op, nil, nil, nil);
1613 USE(n36);
1614 op = common()->EffectPhi(2);
1615 Node* n37 = graph()->NewNode(op, nil, nil, nil);
1616 USE(n37);
1248 op = common()->Branch(); 1617 op = common()->Branch();
1249 Node* n48 = graph()->NewNode(op, nil, nil); 1618 Node* n41 = graph()->NewNode(op, nil, nil);
1250 USE(n48); 1619 USE(n41);
1251 op = js()->Equal(); 1620 op = js()->StackCheck();
1252 Node* n47 = graph()->NewNode(op, nil, nil, nil, nil, nil); 1621 Node* n46 = graph()->NewNode(op, nil, nil, nil, nil);
1622 USE(n46);
1623 op = common()->IfSuccess();
1624 Node* n47 = graph()->NewNode(op, nil);
1253 USE(n47); 1625 USE(n47);
1254 n47->ReplaceInput(0, n25); 1626 op = common()->Phi(kMachAnyTagged, 2);
1255 op = common()->NumberConstant(0); 1627 Node* n16 = graph()->NewNode(op, nil, nil, nil);
1256 Node* n46 = graph()->NewNode(op); 1628 USE(n16);
1257 USE(n46); 1629 op = js()->ToBoolean();
1258 n47->ReplaceInput(1, n46);
1259 n47->ReplaceInput(2, n6);
1260 op = common()->Phi(kMachAnyTagged, 2);
1261 Node* n42 = graph()->NewNode(op, nil, nil, nil);
1262 USE(n42);
1263 op = js()->LessThan();
1264 Node* n30 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1265 USE(n30);
1266 op = common()->Phi(kMachAnyTagged, 2);
1267 Node* n27 = graph()->NewNode(op, nil, nil, nil);
1268 USE(n27);
1269 op = common()->Phi(kMachAnyTagged, 2);
1270 Node* n12 = graph()->NewNode(op, nil, nil, nil);
1271 USE(n12);
1272 op = common()->Parameter(0);
1273 Node* n4 = graph()->NewNode(op, n0);
1274 USE(n4);
1275 n12->ReplaceInput(0, n4);
1276 op = common()->Phi(kMachAnyTagged, 2);
1277 Node* n41 = graph()->NewNode(op, nil, nil, nil);
1278 USE(n41);
1279 n41->ReplaceInput(0, n27);
1280 op = js()->Add();
1281 Node* n35 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1282 USE(n35);
1283 op = js()->ToNumber();
1284 Node* n34 = graph()->NewNode(op, nil, nil, nil, nil);
1285 USE(n34);
1286 n34->ReplaceInput(0, n27);
1287 n34->ReplaceInput(1, n6);
1288 n34->ReplaceInput(2, n30);
1289 op = common()->IfTrue();
1290 Node* n32 = graph()->NewNode(op, nil);
1291 USE(n32);
1292 op = common()->Branch();
1293 Node* n31 = graph()->NewNode(op, nil, nil);
1294 USE(n31);
1295 n31->ReplaceInput(0, n30);
1296 n31->ReplaceInput(1, n23);
1297 n32->ReplaceInput(0, n31);
1298 n34->ReplaceInput(3, n32);
1299 n35->ReplaceInput(0, n34);
1300 op = common()->NumberConstant(0);
1301 Node* n21 = graph()->NewNode(op);
1302 USE(n21);
1303 n35->ReplaceInput(1, n21);
1304 n35->ReplaceInput(2, n6);
1305 n35->ReplaceInput(3, n34);
1306 n35->ReplaceInput(4, n32);
1307 n41->ReplaceInput(1, n35);
1308 op = common()->Merge(2);
1309 Node* n40 = graph()->NewNode(op, nil, nil); 1630 Node* n40 = graph()->NewNode(op, nil, nil);
1310 USE(n40); 1631 USE(n40);
1311 op = common()->IfFalse(); 1632 op = common()->IfSuccess();
1312 Node* n33 = graph()->NewNode(op, nil);
1313 USE(n33);
1314 n33->ReplaceInput(0, n31);
1315 n40->ReplaceInput(0, n33);
1316 op = common()->IfTrue();
1317 Node* n39 = graph()->NewNode(op, nil); 1633 Node* n39 = graph()->NewNode(op, nil);
1318 USE(n39); 1634 USE(n39);
1319 op = common()->Branch(); 1635 op = common()->IfTrue();
1320 Node* n38 = graph()->NewNode(op, nil, nil); 1636 Node* n42 = graph()->NewNode(op, nil);
1321 USE(n38); 1637 USE(n42);
1322 op = js()->Equal(); 1638 op = common()->Parameter(3);
1323 Node* n37 = graph()->NewNode(op, nil, nil, nil, nil, nil); 1639 Node* n4 = graph()->NewNode(op, nil);
1324 USE(n37); 1640 USE(n4);
1325 op = common()->Phi(kMachAnyTagged, 2); 1641 op = common()->Phi(kMachAnyTagged, 2);
1326 Node* n28 = graph()->NewNode(op, nil, nil, nil); 1642 Node* n58 = graph()->NewNode(op, nil, nil, nil);
1327 USE(n28); 1643 USE(n58);
1328 op = common()->Phi(kMachAnyTagged, 2); 1644 n86->ReplaceInput(0, n84);
1329 Node* n13 = graph()->NewNode(op, nil, nil, nil); 1645 n84->ReplaceInput(0, n82);
1330 USE(n13); 1646 n84->ReplaceInput(1, n82);
1331 op = common()->NumberConstant(0); 1647 n84->ReplaceInput(2, n83);
1332 Node* n7 = graph()->NewNode(op); 1648 n82->ReplaceInput(0, n15);
1333 USE(n7); 1649 n82->ReplaceInput(1, n17);
1334 n13->ReplaceInput(0, n7); 1650 n82->ReplaceInput(2, n6);
1335 op = common()->Phi(kMachAnyTagged, 2); 1651 n82->ReplaceInput(3, n12);
1336 Node* n54 = graph()->NewNode(op, nil, nil, nil); 1652 n82->ReplaceInput(4, n12);
1337 USE(n54); 1653 n82->ReplaceInput(5, n19);
1338 n54->ReplaceInput(0, n28); 1654 n82->ReplaceInput(6, n25);
1339 op = js()->Add(); 1655 n83->ReplaceInput(0, n82);
1340 Node* n52 = graph()->NewNode(op, nil, nil, nil, nil, nil); 1656 n15->ReplaceInput(0, n2);
1341 USE(n52); 1657 n15->ReplaceInput(1, n35);
1342 op = js()->ToNumber(); 1658 n15->ReplaceInput(2, n14);
1343 Node* n51 = graph()->NewNode(op, nil, nil, nil, nil); 1659 n17->ReplaceInput(0, n11);
1344 USE(n51); 1660 n17->ReplaceInput(1, n81);
1345 n51->ReplaceInput(0, n28); 1661 n17->ReplaceInput(2, n14);
1346 n51->ReplaceInput(1, n6); 1662 n6->ReplaceInput(0, n0);
1347 n51->ReplaceInput(2, n47); 1663 n12->ReplaceInput(0, n10);
1348 op = common()->IfFalse(); 1664 n12->ReplaceInput(1, n10);
1349 Node* n50 = graph()->NewNode(op, nil); 1665 n12->ReplaceInput(2, n10);
1350 USE(n50); 1666 n12->ReplaceInput(3, n11);
1667 n12->ReplaceInput(4, n5);
1668 n19->ReplaceInput(0, n15);
1669 n19->ReplaceInput(1, n3);
1670 n19->ReplaceInput(2, n6);
1671 n19->ReplaceInput(3, n12);
1672 n19->ReplaceInput(4, n18);
1673 n19->ReplaceInput(5, n14);
1674 n25->ReplaceInput(0, n22);
1675 n2->ReplaceInput(0, n0);
1676 n35->ReplaceInput(0, n32);
1677 n35->ReplaceInput(1, n64);
1678 n35->ReplaceInput(2, n34);
1679 n14->ReplaceInput(0, n9);
1680 n14->ReplaceInput(1, n72);
1681 n81->ReplaceInput(0, n17);
1682 n81->ReplaceInput(1, n78);
1683 n81->ReplaceInput(2, n72);
1684 n3->ReplaceInput(0, n0);
1685 n18->ReplaceInput(0, n8);
1686 n18->ReplaceInput(1, n80);
1687 n18->ReplaceInput(2, n14);
1688 n22->ReplaceInput(0, n21);
1689 n22->ReplaceInput(1, n20);
1690 n32->ReplaceInput(0, n29);
1691 n32->ReplaceInput(1, n31);
1692 n32->ReplaceInput(2, n6);
1693 n32->ReplaceInput(3, n12);
1694 n32->ReplaceInput(4, n12);
1695 n32->ReplaceInput(5, n29);
1696 n32->ReplaceInput(6, n30);
1697 n64->ReplaceInput(0, n62);
1698 n64->ReplaceInput(1, n31);
1699 n64->ReplaceInput(2, n6);
1700 n64->ReplaceInput(3, n12);
1701 n64->ReplaceInput(4, n12);
1702 n64->ReplaceInput(5, n62);
1703 n64->ReplaceInput(6, n63);
1704 n34->ReplaceInput(0, n33);
1705 n34->ReplaceInput(1, n65);
1706 n9->ReplaceInput(0, n8);
1707 n72->ReplaceInput(0, n71);
1708 n72->ReplaceInput(1, n79);
1709 n78->ReplaceInput(0, n76);
1710 n78->ReplaceInput(1, n31);
1711 n78->ReplaceInput(2, n6);
1712 n78->ReplaceInput(3, n12);
1713 n78->ReplaceInput(4, n12);
1714 n78->ReplaceInput(5, n76);
1715 n78->ReplaceInput(6, n77);
1716 n8->ReplaceInput(0, n6);
1717 n8->ReplaceInput(1, n12);
1718 n8->ReplaceInput(2, n0);
1719 n8->ReplaceInput(3, n0);
1720 n80->ReplaceInput(0, n67);
1721 n80->ReplaceInput(1, n78);
1722 n80->ReplaceInput(2, n72);
1723 n21->ReplaceInput(0, n19);
1724 n21->ReplaceInput(1, n6);
1725 n20->ReplaceInput(0, n19);
1726 n29->ReplaceInput(0, n15);
1727 n29->ReplaceInput(1, n6);
1728 n29->ReplaceInput(2, n12);
1729 n29->ReplaceInput(3, n27);
1730 n29->ReplaceInput(4, n28);
1731 n30->ReplaceInput(0, n29);
1732 n62->ReplaceInput(0, n35);
1733 n62->ReplaceInput(1, n6);
1734 n62->ReplaceInput(2, n12);
1735 n62->ReplaceInput(3, n52);
1736 n62->ReplaceInput(4, n60);
1737 n63->ReplaceInput(0, n62);
1738 n33->ReplaceInput(0, n32);
1739 n65->ReplaceInput(0, n64);
1740 n71->ReplaceInput(0, n70);
1741 n79->ReplaceInput(0, n78);
1742 n76->ReplaceInput(0, n17);
1743 n76->ReplaceInput(1, n6);
1744 n76->ReplaceInput(2, n12);
1745 n76->ReplaceInput(3, n67);
1746 n76->ReplaceInput(4, n74);
1747 n77->ReplaceInput(0, n76);
1748 n67->ReplaceInput(0, n35);
1749 n67->ReplaceInput(1, n31);
1750 n67->ReplaceInput(2, n6);
1751 n67->ReplaceInput(3, n12);
1752 n67->ReplaceInput(4, n57);
1753 n67->ReplaceInput(5, n45);
1754 n27->ReplaceInput(0, n6);
1755 n27->ReplaceInput(1, n12);
1756 n27->ReplaceInput(2, n19);
1757 n27->ReplaceInput(3, n23);
1758 n28->ReplaceInput(0, n27);
1759 n52->ReplaceInput(0, n17);
1760 n52->ReplaceInput(1, n11);
1761 n52->ReplaceInput(2, n6);
1762 n52->ReplaceInput(3, n12);
1763 n52->ReplaceInput(4, n50);
1764 n52->ReplaceInput(5, n51);
1765 n60->ReplaceInput(0, n55);
1766 n70->ReplaceInput(0, n69);
1767 n70->ReplaceInput(1, n68);
1768 n74->ReplaceInput(0, n70);
1769 n57->ReplaceInput(0, n38);
1770 n57->ReplaceInput(1, n52);
1771 n57->ReplaceInput(2, n45);
1772 n45->ReplaceInput(0, n44);
1773 n45->ReplaceInput(1, n56);
1774 n23->ReplaceInput(0, n22);
1351 n50->ReplaceInput(0, n48); 1775 n50->ReplaceInput(0, n48);
1352 n51->ReplaceInput(3, n50); 1776 n50->ReplaceInput(1, n31);
1353 n52->ReplaceInput(0, n51); 1777 n50->ReplaceInput(2, n6);
1354 n52->ReplaceInput(1, n21); 1778 n50->ReplaceInput(3, n12);
1355 n52->ReplaceInput(2, n6); 1779 n50->ReplaceInput(4, n12);
1356 n52->ReplaceInput(3, n51); 1780 n50->ReplaceInput(5, n48);
1357 n52->ReplaceInput(4, n50); 1781 n50->ReplaceInput(6, n49);
1358 n54->ReplaceInput(1, n52); 1782 n51->ReplaceInput(0, n50);
1359 n54->ReplaceInput(2, n53); 1783 n55->ReplaceInput(0, n54);
1360 n13->ReplaceInput(1, n54); 1784 n55->ReplaceInput(1, n53);
1361 n13->ReplaceInput(2, n8); 1785 n69->ReplaceInput(0, n67);
1362 n28->ReplaceInput(0, n13); 1786 n69->ReplaceInput(1, n6);
1363 n28->ReplaceInput(1, n28); 1787 n68->ReplaceInput(0, n67);
1364 n28->ReplaceInput(2, n23); 1788 n38->ReplaceInput(0, n36);
1365 n37->ReplaceInput(0, n28); 1789 n38->ReplaceInput(1, n3);
1366 op = common()->NumberConstant(0); 1790 n38->ReplaceInput(2, n6);
1367 Node* n36 = graph()->NewNode(op); 1791 n38->ReplaceInput(3, n12);
1368 USE(n36); 1792 n38->ReplaceInput(4, n37);
1369 n37->ReplaceInput(1, n36); 1793 n38->ReplaceInput(5, n34);
1370 n37->ReplaceInput(2, n6); 1794 n44->ReplaceInput(0, n41);
1371 n37->ReplaceInput(3, n35); 1795 n56->ReplaceInput(0, n55);
1372 n37->ReplaceInput(4, n32); 1796 n48->ReplaceInput(0, n36);
1373 n38->ReplaceInput(0, n37); 1797 n48->ReplaceInput(1, n6);
1374 n38->ReplaceInput(1, n32); 1798 n48->ReplaceInput(2, n12);
1799 n48->ReplaceInput(3, n46);
1800 n48->ReplaceInput(4, n47);
1801 n49->ReplaceInput(0, n48);
1802 n54->ReplaceInput(0, n52);
1803 n54->ReplaceInput(1, n6);
1804 n53->ReplaceInput(0, n52);
1805 n36->ReplaceInput(0, n16);
1806 n36->ReplaceInput(1, n50);
1807 n36->ReplaceInput(2, n34);
1808 n37->ReplaceInput(0, n32);
1809 n37->ReplaceInput(1, n64);
1810 n37->ReplaceInput(2, n34);
1811 n41->ReplaceInput(0, n40);
1812 n41->ReplaceInput(1, n39);
1813 n46->ReplaceInput(0, n6);
1814 n46->ReplaceInput(1, n12);
1815 n46->ReplaceInput(2, n38);
1816 n46->ReplaceInput(3, n42);
1817 n47->ReplaceInput(0, n46);
1818 n16->ReplaceInput(0, n4);
1819 n16->ReplaceInput(1, n58);
1820 n16->ReplaceInput(2, n14);
1821 n40->ReplaceInput(0, n38);
1822 n40->ReplaceInput(1, n6);
1375 n39->ReplaceInput(0, n38); 1823 n39->ReplaceInput(0, n38);
1376 n40->ReplaceInput(1, n39); 1824 n42->ReplaceInput(0, n41);
1377 n41->ReplaceInput(2, n40); 1825 n4->ReplaceInput(0, n0);
1378 n12->ReplaceInput(1, n41); 1826 n58->ReplaceInput(0, n36);
1379 n12->ReplaceInput(2, n8); 1827 n58->ReplaceInput(1, n50);
1380 n27->ReplaceInput(0, n12); 1828 n58->ReplaceInput(2, n45);
1381 n27->ReplaceInput(1, n35);
1382 n27->ReplaceInput(2, n23);
1383 n30->ReplaceInput(0, n27);
1384 n30->ReplaceInput(1, n26);
1385 n30->ReplaceInput(2, n6);
1386 op = common()->Phi(kMachAnyTagged, 2);
1387 Node* n29 = graph()->NewNode(op, nil, nil, nil);
1388 USE(n29);
1389 n29->ReplaceInput(0, n22);
1390 op = js()->Add();
1391 Node* n45 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1392 USE(n45);
1393 op = js()->ToNumber();
1394 Node* n44 = graph()->NewNode(op, nil, nil, nil, nil);
1395 USE(n44);
1396 n44->ReplaceInput(0, n25);
1397 n44->ReplaceInput(1, n6);
1398 n44->ReplaceInput(2, n37);
1399 op = common()->IfFalse();
1400 Node* n43 = graph()->NewNode(op, nil);
1401 USE(n43);
1402 n43->ReplaceInput(0, n38);
1403 n44->ReplaceInput(3, n43);
1404 n45->ReplaceInput(0, n44);
1405 n45->ReplaceInput(1, n21);
1406 n45->ReplaceInput(2, n6);
1407 n45->ReplaceInput(3, n44);
1408 n45->ReplaceInput(4, n43);
1409 n29->ReplaceInput(1, n45);
1410 n29->ReplaceInput(2, n23);
1411 n30->ReplaceInput(3, n29);
1412 n30->ReplaceInput(4, n23);
1413 n42->ReplaceInput(0, n30);
1414 n42->ReplaceInput(1, n37);
1415 n42->ReplaceInput(2, n40);
1416 n47->ReplaceInput(3, n42);
1417 n47->ReplaceInput(4, n40);
1418 n48->ReplaceInput(0, n47);
1419 n48->ReplaceInput(1, n40);
1420 n49->ReplaceInput(0, n48);
1421 n53->ReplaceInput(0, n49);
1422 n53->ReplaceInput(1, n50);
1423 n8->ReplaceInput(1, n53);
1424 n17->ReplaceInput(1, n8);
1425 n18->ReplaceInput(0, n17);
1426 n23->ReplaceInput(0, n18);
1427 n23->ReplaceInput(1, n43);
1428 n26->ReplaceInput(2, n23);
1429 n11->ReplaceInput(1, n26);
1430 n11->ReplaceInput(2, n8);
1431 n16->ReplaceInput(1, n11);
1432 n16->ReplaceInput(2, n6);
1433 op = common()->Phi(kMachAnyTagged, 2);
1434 Node* n14 = graph()->NewNode(op, nil, nil, nil);
1435 USE(n14);
1436 n14->ReplaceInput(0, n0);
1437 op = common()->Phi(kMachAnyTagged, 2);
1438 Node* n55 = graph()->NewNode(op, nil, nil, nil);
1439 USE(n55);
1440 n55->ReplaceInput(0, n47);
1441 n55->ReplaceInput(1, n52);
1442 n55->ReplaceInput(2, n53);
1443 n14->ReplaceInput(1, n55);
1444 n14->ReplaceInput(2, n8);
1445 n16->ReplaceInput(3, n14);
1446 n16->ReplaceInput(4, n8);
1447 n20->ReplaceInput(2, n16);
1448 n20->ReplaceInput(3, n18);
1449 n22->ReplaceInput(0, n20);
1450 n22->ReplaceInput(1, n21);
1451 n22->ReplaceInput(2, n6);
1452 n22->ReplaceInput(3, n20);
1453 n22->ReplaceInput(4, n18);
1454 n25->ReplaceInput(0, n22);
1455 n25->ReplaceInput(1, n45);
1456 n25->ReplaceInput(2, n23);
1457 n10->ReplaceInput(1, n25);
1458 n10->ReplaceInput(2, n8);
1459 n56->ReplaceInput(0, n10);
1460 n56->ReplaceInput(1, n13);
1461 n56->ReplaceInput(2, n6);
1462 n56->ReplaceInput(3, n16);
1463 op = common()->IfFalse();
1464 Node* n19 = graph()->NewNode(op, nil);
1465 USE(n19);
1466 n19->ReplaceInput(0, n17);
1467 n56->ReplaceInput(4, n19);
1468 n57->ReplaceInput(0, n56);
1469 n57->ReplaceInput(1, n56);
1470 n57->ReplaceInput(2, n19);
1471 n58->ReplaceInput(0, n57);
1472 1829
1473 graph()->SetStart(n0); 1830 graph()->SetStart(n0);
1474 graph()->SetEnd(n58); 1831 graph()->SetEnd(n86);
1475 1832
1476 ComputeAndVerifySchedule(62); 1833 ComputeAndVerifySchedule(83);
1477 } 1834 }
1478 1835
1479 1836
1480 TEST_F(SchedulerTest, BuildScheduleSimpleLoopWithCodeMotion) { 1837 TEST_F(SchedulerTest, BuildScheduleSimpleLoopWithCodeMotion) {
1481 FLAG_turbo_deoptimization = false;
1482
1483 const Operator* op; 1838 const Operator* op;
1839 Unique<HeapObject> unique_constant =
1840 Unique<HeapObject>::CreateImmovable(factory()->undefined_value());
1484 1841
1485 // Manually transcripted code for: 1842 // Manually transcripted code for:
1486 // function turbo_fan_test(a, b, c) { 1843 // function turbo_fan_test(a, b, c) {
1487 // while (a < b) { 1844 // while (a < b) {
1488 // a += b + c; 1845 // a += b + c;
1489 // } 1846 // }
1490 // return a; 1847 // return a;
1491 // } 1848 // }
1492 op = common()->Start(0); 1849 Node* nil = graph()->NewNode(common()->Dead());
1850 op = common()->End();
1851 Node* n34 = graph()->NewNode(op, nil);
1852 USE(n34);
1853 op = common()->Return();
1854 Node* n32 = graph()->NewNode(op, nil, nil, nil);
1855 USE(n32);
1856 op = common()->Phi(kMachAnyTagged, 2);
1857 Node* n14 = graph()->NewNode(op, nil, nil, nil);
1858 USE(n14);
1859 op = js()->LessThan();
1860 Node* n17 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil);
1861 USE(n17);
1862 op = common()->IfFalse();
1863 Node* n23 = graph()->NewNode(op, nil);
1864 USE(n23);
1865 op = common()->Parameter(1);
1866 Node* n2 = graph()->NewNode(op, nil);
1867 USE(n2);
1868 op = js()->Add();
1869 Node* n29 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1870 USE(n29);
1871 op = common()->Loop(2);
1872 Node* n13 = graph()->NewNode(op, nil, nil);
1873 USE(n13);
1874 op = common()->Parameter(2);
1875 Node* n3 = graph()->NewNode(op, nil);
1876 USE(n3);
1877 op = common()->Parameter(4);
1878 Node* n6 = graph()->NewNode(op, nil);
1879 USE(n6);
1880 op = common()->FrameState(JS_FRAME, BailoutId(-1),
1881 OutputFrameStateCombine::Ignore());
1882 Node* n12 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1883 USE(n12);
1884 op = common()->EffectPhi(2);
1885 Node* n15 = graph()->NewNode(op, nil, nil, nil);
1886 USE(n15);
1887 op = common()->Branch();
1888 Node* n20 = graph()->NewNode(op, nil, nil);
1889 USE(n20);
1890 op = common()->Start(3);
1493 Node* n0 = graph()->NewNode(op); 1891 Node* n0 = graph()->NewNode(op);
1494 USE(n0); 1892 USE(n0);
1495 Node* nil = graph()->NewNode(common()->Dead()); 1893 op = js()->Add();
1496 op = common()->End(); 1894 Node* n27 = graph()->NewNode(op, nil, nil, nil, nil, nil, nil, nil);
1497 Node* n22 = graph()->NewNode(op, nil); 1895 USE(n27);
1498 USE(n22); 1896 op = common()->IfSuccess();
1499 op = common()->Return(); 1897 Node* n28 = graph()->NewNode(op, nil);
1500 Node* n21 = graph()->NewNode(op, nil, nil, nil); 1898 USE(n28);
1501 USE(n21); 1899 op = common()->IfSuccess();
1502 op = common()->Phi(kMachAnyTagged, 2); 1900 Node* n9 = graph()->NewNode(op, nil);
1503 Node* n9 = graph()->NewNode(op, nil, nil, nil);
1504 USE(n9); 1901 USE(n9);
1505 op = common()->Parameter(0); 1902 op = common()->IfSuccess();
1506 Node* n2 = graph()->NewNode(op, n0); 1903 Node* n30 = graph()->NewNode(op, nil);
1507 USE(n2); 1904 USE(n30);
1508 n9->ReplaceInput(0, n2); 1905 op = common()->StateValues(0);
1509 op = js()->Add(); 1906 Node* n10 = graph()->NewNode(op);
1510 Node* n20 = graph()->NewNode(op, nil, nil, nil, nil, nil); 1907 USE(n10);
1511 USE(n20); 1908 op = common()->NumberConstant(0);
1512 n20->ReplaceInput(0, n9); 1909 Node* n11 = graph()->NewNode(op);
1513 op = &kIntAdd; 1910 USE(n11);
1911 op = common()->HeapConstant(unique_constant);
1912 Node* n5 = graph()->NewNode(op);
1913 USE(n5);
1914 op = js()->StackCheck();
1915 Node* n8 = graph()->NewNode(op, nil, nil, nil, nil);
1916 USE(n8);
1917 op = js()->ToBoolean();
1514 Node* n19 = graph()->NewNode(op, nil, nil); 1918 Node* n19 = graph()->NewNode(op, nil, nil);
1515 USE(n19); 1919 USE(n19);
1516 op = common()->Phi(kMachAnyTagged, 2); 1920 op = common()->IfSuccess();
1517 Node* n10 = graph()->NewNode(op, nil, nil, nil);
1518 USE(n10);
1519 op = common()->Parameter(0);
1520 Node* n3 = graph()->NewNode(op, n0);
1521 USE(n3);
1522 n10->ReplaceInput(0, n3);
1523 n10->ReplaceInput(1, n10);
1524 op = common()->Loop(2);
1525 Node* n7 = graph()->NewNode(op, nil, nil);
1526 USE(n7);
1527 n7->ReplaceInput(0, n0);
1528 op = common()->IfTrue();
1529 Node* n17 = graph()->NewNode(op, nil);
1530 USE(n17);
1531 op = common()->Branch();
1532 Node* n16 = graph()->NewNode(op, nil, nil);
1533 USE(n16);
1534 op = js()->ToBoolean();
1535 Node* n15 = graph()->NewNode(op, nil, nil, nil, nil);
1536 USE(n15);
1537 op = js()->LessThan();
1538 Node* n14 = graph()->NewNode(op, nil, nil, nil, nil, nil);
1539 USE(n14);
1540 n14->ReplaceInput(0, n9);
1541 n14->ReplaceInput(1, n10);
1542 op = &kHeapConstant;
1543 Node* n6 = graph()->NewNode(op);
1544 USE(n6);
1545 n14->ReplaceInput(2, n6);
1546 op = common()->Phi(kMachAnyTagged, 2);
1547 Node* n12 = graph()->NewNode(op, nil, nil, nil);
1548 USE(n12);
1549 n12->ReplaceInput(0, n0);
1550 n12->ReplaceInput(1, n20);
1551 n12->ReplaceInput(2, n7);
1552 n14->ReplaceInput(3, n12);
1553 n14->ReplaceInput(4, n7);
1554 n15->ReplaceInput(0, n14);
1555 n15->ReplaceInput(1, n6);
1556 n15->ReplaceInput(2, n14);
1557 n15->ReplaceInput(3, n7);
1558 n16->ReplaceInput(0, n15);
1559 n16->ReplaceInput(1, n7);
1560 n17->ReplaceInput(0, n16);
1561 n7->ReplaceInput(1, n17);
1562 n10->ReplaceInput(2, n7);
1563 n19->ReplaceInput(0, n2);
1564 op = common()->Phi(kMachAnyTagged, 2);
1565 Node* n11 = graph()->NewNode(op, nil, nil, nil);
1566 USE(n11);
1567 op = common()->Parameter(0);
1568 Node* n4 = graph()->NewNode(op, n0);
1569 USE(n4);
1570 n11->ReplaceInput(0, n4);
1571 n11->ReplaceInput(1, n11);
1572 n11->ReplaceInput(2, n7);
1573 n19->ReplaceInput(1, n3);
1574 n20->ReplaceInput(1, n19);
1575 n20->ReplaceInput(2, n6);
1576 n20->ReplaceInput(3, n19);
1577 n20->ReplaceInput(4, n17);
1578 n9->ReplaceInput(1, n20);
1579 n9->ReplaceInput(2, n7);
1580 n21->ReplaceInput(0, n9);
1581 n21->ReplaceInput(1, n15);
1582 op = common()->IfFalse();
1583 Node* n18 = graph()->NewNode(op, nil); 1921 Node* n18 = graph()->NewNode(op, nil);
1584 USE(n18); 1922 USE(n18);
1585 n18->ReplaceInput(0, n16); 1923 op = common()->Parameter(3);
1586 n21->ReplaceInput(2, n18); 1924 Node* n4 = graph()->NewNode(op, nil);
1587 n22->ReplaceInput(0, n21); 1925 USE(n4);
1926 op = js()->StackCheck();
1927 Node* n25 = graph()->NewNode(op, nil, nil, nil, nil);
1928 USE(n25);
1929 op = common()->IfSuccess();
1930 Node* n26 = graph()->NewNode(op, nil);
1931 USE(n26);
1932 op = common()->IfTrue();
1933 Node* n21 = graph()->NewNode(op, nil);
1934 USE(n21);
1935 n34->ReplaceInput(0, n32);
1936 n32->ReplaceInput(0, n14);
1937 n32->ReplaceInput(1, n17);
1938 n32->ReplaceInput(2, n23);
1939 n14->ReplaceInput(0, n2);
1940 n14->ReplaceInput(1, n29);
1941 n14->ReplaceInput(2, n13);
1942 n17->ReplaceInput(0, n14);
1943 n17->ReplaceInput(1, n3);
1944 n17->ReplaceInput(2, n6);
1945 n17->ReplaceInput(3, n12);
1946 n17->ReplaceInput(4, n15);
1947 n17->ReplaceInput(5, n13);
1948 n23->ReplaceInput(0, n20);
1949 n2->ReplaceInput(0, n0);
1950 n29->ReplaceInput(0, n14);
1951 n29->ReplaceInput(1, n27);
1952 n29->ReplaceInput(2, n6);
1953 n29->ReplaceInput(3, n12);
1954 n29->ReplaceInput(4, n12);
1955 n29->ReplaceInput(5, n27);
1956 n29->ReplaceInput(6, n28);
1957 n13->ReplaceInput(0, n9);
1958 n13->ReplaceInput(1, n30);
1959 n3->ReplaceInput(0, n0);
1960 n6->ReplaceInput(0, n0);
1961 n12->ReplaceInput(0, n10);
1962 n12->ReplaceInput(1, n10);
1963 n12->ReplaceInput(2, n10);
1964 n12->ReplaceInput(3, n11);
1965 n12->ReplaceInput(4, n5);
1966 n15->ReplaceInput(0, n8);
1967 n15->ReplaceInput(1, n29);
1968 n15->ReplaceInput(2, n13);
1969 n20->ReplaceInput(0, n19);
1970 n20->ReplaceInput(1, n18);
1971 n27->ReplaceInput(0, n3);
1972 n27->ReplaceInput(1, n4);
1973 n27->ReplaceInput(2, n6);
1974 n27->ReplaceInput(3, n12);
1975 n27->ReplaceInput(4, n12);
1976 n27->ReplaceInput(5, n25);
1977 n27->ReplaceInput(6, n26);
1978 n28->ReplaceInput(0, n27);
1979 n9->ReplaceInput(0, n8);
1980 n30->ReplaceInput(0, n29);
1981 n8->ReplaceInput(0, n6);
1982 n8->ReplaceInput(1, n12);
1983 n8->ReplaceInput(2, n0);
1984 n8->ReplaceInput(3, n0);
1985 n19->ReplaceInput(0, n17);
1986 n19->ReplaceInput(1, n6);
1987 n18->ReplaceInput(0, n17);
1988 n4->ReplaceInput(0, n0);
1989 n25->ReplaceInput(0, n6);
1990 n25->ReplaceInput(1, n12);
1991 n25->ReplaceInput(2, n17);
1992 n25->ReplaceInput(3, n21);
1993 n26->ReplaceInput(0, n25);
1994 n21->ReplaceInput(0, n20);
1588 1995
1589 graph()->SetStart(n0); 1996 graph()->SetStart(n0);
1590 graph()->SetEnd(n22); 1997 graph()->SetEnd(n34);
1591 1998
1592 ComputeAndVerifySchedule(19); 1999 ComputeAndVerifySchedule(30);
1593 } 2000 }
1594 2001
1595 2002
1596 namespace { 2003 namespace {
1597 2004
1598 Node* CreateDiamond(Graph* graph, CommonOperatorBuilder* common, Node* cond) { 2005 Node* CreateDiamond(Graph* graph, CommonOperatorBuilder* common, Node* cond) {
1599 Node* tv = graph->NewNode(common->Int32Constant(6)); 2006 Node* tv = graph->NewNode(common->Int32Constant(6));
1600 Node* fv = graph->NewNode(common->Int32Constant(7)); 2007 Node* fv = graph->NewNode(common->Int32Constant(7));
1601 Node* br = graph->NewNode(common->Branch(), cond, graph->start()); 2008 Node* br = graph->NewNode(common->Branch(), cond, graph->start());
1602 Node* t = graph->NewNode(common->IfTrue(), br); 2009 Node* t = graph->NewNode(common->IfTrue(), br);
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 Node* end = graph()->NewNode(common()->End(), ret); 2447 Node* end = graph()->NewNode(common()->End(), ret);
2041 2448
2042 graph()->SetEnd(end); 2449 graph()->SetEnd(end);
2043 2450
2044 ComputeAndVerifySchedule(16); 2451 ComputeAndVerifySchedule(16);
2045 } 2452 }
2046 2453
2047 } // namespace compiler 2454 } // namespace compiler
2048 } // namespace internal 2455 } // namespace internal
2049 } // namespace v8 2456 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698