| OLD | NEW | 
|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" | 
| 6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" | 
| 7 | 7 | 
| 8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" | 
| 9 #include "src/compiler/generic-node-inl.h" | 9 #include "src/compiler/generic-node-inl.h" | 
| 10 #include "src/compiler/generic-node.h" | 10 #include "src/compiler/generic-node.h" | 
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 673 | 673 | 
| 674 | 674 | 
| 675 TEST(BuildScheduleIfSplitWithEffects) { | 675 TEST(BuildScheduleIfSplitWithEffects) { | 
| 676   HandleAndZoneScope scope; | 676   HandleAndZoneScope scope; | 
| 677   Isolate* isolate = scope.main_isolate(); | 677   Isolate* isolate = scope.main_isolate(); | 
| 678   Graph graph(scope.main_zone()); | 678   Graph graph(scope.main_zone()); | 
| 679   CommonOperatorBuilder common_builder(scope.main_zone()); | 679   CommonOperatorBuilder common_builder(scope.main_zone()); | 
| 680   JSOperatorBuilder js_builder(scope.main_zone()); | 680   JSOperatorBuilder js_builder(scope.main_zone()); | 
| 681   const Operator* op; | 681   const Operator* op; | 
| 682 | 682 | 
| 683   Handle<Object> object = | 683   Handle<HeapObject> object = | 
| 684       Handle<Object>(isolate->heap()->undefined_value(), isolate); | 684       Handle<HeapObject>(isolate->heap()->undefined_value(), isolate); | 
| 685   Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object); | 685   Unique<HeapObject> unique_constant = | 
|  | 686       Unique<HeapObject>::CreateUninitialized(object); | 
| 686 | 687 | 
| 687   // Manually transcripted code for: | 688   // Manually transcripted code for: | 
| 688   // function turbo_fan_test(a, b, c, y) { | 689   // function turbo_fan_test(a, b, c, y) { | 
| 689   //   if (a < b) { | 690   //   if (a < b) { | 
| 690   //     return a + b - c * c - a + y; | 691   //     return a + b - c * c - a + y; | 
| 691   //   } else { | 692   //   } else { | 
| 692   //     return c * c - a; | 693   //     return c * c - a; | 
| 693   //   } | 694   //   } | 
| 694   // } | 695   // } | 
| 695   op = common_builder.Start(0); | 696   op = common_builder.Start(0); | 
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 818 | 819 | 
| 819 | 820 | 
| 820 TEST(BuildScheduleSimpleLoop) { | 821 TEST(BuildScheduleSimpleLoop) { | 
| 821   HandleAndZoneScope scope; | 822   HandleAndZoneScope scope; | 
| 822   Isolate* isolate = scope.main_isolate(); | 823   Isolate* isolate = scope.main_isolate(); | 
| 823   Graph graph(scope.main_zone()); | 824   Graph graph(scope.main_zone()); | 
| 824   CommonOperatorBuilder common_builder(scope.main_zone()); | 825   CommonOperatorBuilder common_builder(scope.main_zone()); | 
| 825   JSOperatorBuilder js_builder(scope.main_zone()); | 826   JSOperatorBuilder js_builder(scope.main_zone()); | 
| 826   const Operator* op; | 827   const Operator* op; | 
| 827 | 828 | 
| 828   Handle<Object> object = | 829   Handle<HeapObject> object = | 
| 829       Handle<Object>(isolate->heap()->undefined_value(), isolate); | 830       Handle<HeapObject>(isolate->heap()->undefined_value(), isolate); | 
| 830   Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object); | 831   Unique<HeapObject> unique_constant = | 
|  | 832       Unique<HeapObject>::CreateUninitialized(object); | 
| 831 | 833 | 
| 832   // Manually transcripted code for: | 834   // Manually transcripted code for: | 
| 833   // function turbo_fan_test(a, b) { | 835   // function turbo_fan_test(a, b) { | 
| 834   //   while (a < b) { | 836   //   while (a < b) { | 
| 835   //     a++; | 837   //     a++; | 
| 836   //   } | 838   //   } | 
| 837   //   return a; | 839   //   return a; | 
| 838   // } | 840   // } | 
| 839   op = common_builder.Start(0); | 841   op = common_builder.Start(0); | 
| 840   Node* n0 = graph.NewNode(op); | 842   Node* n0 = graph.NewNode(op); | 
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 930 | 932 | 
| 931 | 933 | 
| 932 TEST(BuildScheduleComplexLoops) { | 934 TEST(BuildScheduleComplexLoops) { | 
| 933   HandleAndZoneScope scope; | 935   HandleAndZoneScope scope; | 
| 934   Isolate* isolate = scope.main_isolate(); | 936   Isolate* isolate = scope.main_isolate(); | 
| 935   Graph graph(scope.main_zone()); | 937   Graph graph(scope.main_zone()); | 
| 936   CommonOperatorBuilder common_builder(scope.main_zone()); | 938   CommonOperatorBuilder common_builder(scope.main_zone()); | 
| 937   JSOperatorBuilder js_builder(scope.main_zone()); | 939   JSOperatorBuilder js_builder(scope.main_zone()); | 
| 938   const Operator* op; | 940   const Operator* op; | 
| 939 | 941 | 
| 940   Handle<Object> object = | 942   Handle<HeapObject> object = | 
| 941       Handle<Object>(isolate->heap()->undefined_value(), isolate); | 943       Handle<HeapObject>(isolate->heap()->undefined_value(), isolate); | 
| 942   Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object); | 944   Unique<HeapObject> unique_constant = | 
|  | 945       Unique<HeapObject>::CreateUninitialized(object); | 
| 943 | 946 | 
| 944   // Manually transcripted code for: | 947   // Manually transcripted code for: | 
| 945   // function turbo_fan_test(a, b, c) { | 948   // function turbo_fan_test(a, b, c) { | 
| 946   //   while (a < b) { | 949   //   while (a < b) { | 
| 947   //     a++; | 950   //     a++; | 
| 948   //     while (c < b) { | 951   //     while (c < b) { | 
| 949   //       c++; | 952   //       c++; | 
| 950   //     } | 953   //     } | 
| 951   //   } | 954   //   } | 
| 952   //   while (a < b) { | 955   //   while (a < b) { | 
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1177 | 1180 | 
| 1178 | 1181 | 
| 1179 TEST(BuildScheduleBreakAndContinue) { | 1182 TEST(BuildScheduleBreakAndContinue) { | 
| 1180   HandleAndZoneScope scope; | 1183   HandleAndZoneScope scope; | 
| 1181   Isolate* isolate = scope.main_isolate(); | 1184   Isolate* isolate = scope.main_isolate(); | 
| 1182   Graph graph(scope.main_zone()); | 1185   Graph graph(scope.main_zone()); | 
| 1183   CommonOperatorBuilder common_builder(scope.main_zone()); | 1186   CommonOperatorBuilder common_builder(scope.main_zone()); | 
| 1184   JSOperatorBuilder js_builder(scope.main_zone()); | 1187   JSOperatorBuilder js_builder(scope.main_zone()); | 
| 1185   const Operator* op; | 1188   const Operator* op; | 
| 1186 | 1189 | 
| 1187   Handle<Object> object = | 1190   Handle<HeapObject> object = | 
| 1188       Handle<Object>(isolate->heap()->undefined_value(), isolate); | 1191       Handle<HeapObject>(isolate->heap()->undefined_value(), isolate); | 
| 1189   Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object); | 1192   Unique<HeapObject> unique_constant = | 
|  | 1193       Unique<HeapObject>::CreateUninitialized(object); | 
| 1190 | 1194 | 
| 1191   // Manually transcripted code for: | 1195   // Manually transcripted code for: | 
| 1192   // function turbo_fan_test(a, b, c) { | 1196   // function turbo_fan_test(a, b, c) { | 
| 1193   //   var d = 0; | 1197   //   var d = 0; | 
| 1194   //   while (a < b) { | 1198   //   while (a < b) { | 
| 1195   //     a++; | 1199   //     a++; | 
| 1196   //     while (c < b) { | 1200   //     while (c < b) { | 
| 1197   //       c++; | 1201   //       c++; | 
| 1198   //       if (d == 0) break; | 1202   //       if (d == 0) break; | 
| 1199   //       a++; | 1203   //       a++; | 
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1507 | 1511 | 
| 1508 TEST(BuildScheduleSimpleLoopWithCodeMotion) { | 1512 TEST(BuildScheduleSimpleLoopWithCodeMotion) { | 
| 1509   HandleAndZoneScope scope; | 1513   HandleAndZoneScope scope; | 
| 1510   Isolate* isolate = scope.main_isolate(); | 1514   Isolate* isolate = scope.main_isolate(); | 
| 1511   Graph graph(scope.main_zone()); | 1515   Graph graph(scope.main_zone()); | 
| 1512   CommonOperatorBuilder common_builder(scope.main_zone()); | 1516   CommonOperatorBuilder common_builder(scope.main_zone()); | 
| 1513   JSOperatorBuilder js_builder(scope.main_zone()); | 1517   JSOperatorBuilder js_builder(scope.main_zone()); | 
| 1514   MachineOperatorBuilder machine_builder; | 1518   MachineOperatorBuilder machine_builder; | 
| 1515   const Operator* op; | 1519   const Operator* op; | 
| 1516 | 1520 | 
| 1517   Handle<Object> object = | 1521   Handle<HeapObject> object = | 
| 1518       Handle<Object>(isolate->heap()->undefined_value(), isolate); | 1522       Handle<HeapObject>(isolate->heap()->undefined_value(), isolate); | 
| 1519   Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object); | 1523   Unique<HeapObject> unique_constant = | 
|  | 1524       Unique<HeapObject>::CreateUninitialized(object); | 
| 1520 | 1525 | 
| 1521   // Manually transcripted code for: | 1526   // Manually transcripted code for: | 
| 1522   // function turbo_fan_test(a, b, c) { | 1527   // function turbo_fan_test(a, b, c) { | 
| 1523   //   while (a < b) { | 1528   //   while (a < b) { | 
| 1524   //     a += b + c; | 1529   //     a += b + c; | 
| 1525   //   } | 1530   //   } | 
| 1526   //   return a; | 1531   //   return a; | 
| 1527   // } | 1532   // } | 
| 1528   op = common_builder.Start(0); | 1533   op = common_builder.Start(0); | 
| 1529   Node* n0 = graph.NewNode(op); | 1534   Node* n0 = graph.NewNode(op); | 
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1706   Node* d3 = CreateDiamond(&graph, &common, add); | 1711   Node* d3 = CreateDiamond(&graph, &common, add); | 
| 1707   Node* ret = graph.NewNode(common.Return(), d3, start, start); | 1712   Node* ret = graph.NewNode(common.Return(), d3, start, start); | 
| 1708   Node* end = graph.NewNode(common.End(), ret, start); | 1713   Node* end = graph.NewNode(common.End(), ret, start); | 
| 1709 | 1714 | 
| 1710   graph.SetEnd(end); | 1715   graph.SetEnd(end); | 
| 1711 | 1716 | 
| 1712   ComputeAndVerifySchedule(33, &graph); | 1717   ComputeAndVerifySchedule(33, &graph); | 
| 1713 } | 1718 } | 
| 1714 | 1719 | 
| 1715 #endif | 1720 #endif | 
| OLD | NEW | 
|---|