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

Side by Side Diff: test/cctest/compiler/test-scheduler.cc

Issue 651843004: Add Terminate operator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case for scheduler. Created 6 years, 1 month 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 | Annotate | Revision Log
« src/compiler/common-operator.cc ('K') | « src/compiler/verifier.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 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/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/generic-node-inl.h" 10 #include "src/compiler/generic-node-inl.h"
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 Node* end = graph.NewNode(common.End(), ret, start); 1881 Node* end = graph.NewNode(common.End(), ret, start);
1882 1882
1883 graph.SetEnd(end); 1883 graph.SetEnd(end);
1884 1884
1885 Schedule* schedule = ComputeAndVerifySchedule(13, &graph); 1885 Schedule* schedule = ComputeAndVerifySchedule(13, &graph);
1886 // Make sure the true block is marked as deferred. 1886 // Make sure the true block is marked as deferred.
1887 CHECK(schedule->block(t)->deferred()); 1887 CHECK(schedule->block(t)->deferred());
1888 CHECK(!schedule->block(f)->deferred()); 1888 CHECK(!schedule->block(f)->deferred());
1889 } 1889 }
1890 1890
1891
1892 TEST(ScheduleTerminate) {
1893 HandleAndZoneScope scope;
1894 Graph graph(scope.main_zone());
1895 CommonOperatorBuilder common(scope.main_zone());
1896
1897 Node* start = graph.NewNode(common.Start(1));
1898 graph.SetStart(start);
1899
1900 Node* loop = graph.NewNode(common.Loop(2), start, start);
1901 loop->ReplaceInput(1, loop); // self loop, NTL.
1902
1903 Node* effect = graph.NewNode(common.EffectPhi(1), start, loop);
1904 effect->ReplaceInput(0, effect);
1905
1906 Node* terminate = graph.NewNode(common.Terminate(1), effect, loop);
1907 Node* end = graph.NewNode(common.End(), terminate);
1908
1909 graph.SetEnd(end);
1910
1911 Schedule* schedule = ComputeAndVerifySchedule(5, &graph);
1912 BasicBlock* block = schedule->block(loop);
1913 CHECK_NE(NULL, loop);
1914 CHECK_EQ(block, schedule->block(effect));
1915 CHECK_GE(block->rpo_number(), 0);
1916 }
1917
1891 #endif 1918 #endif
OLDNEW
« src/compiler/common-operator.cc ('K') | « src/compiler/verifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698