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

Unified Diff: test/unittests/compiler/instruction-sequence-unittest.cc

Issue 1116923002: [test] make instruction sequence test emit cfgs more like the scheduler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/unittests/compiler/move-optimizer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/instruction-sequence-unittest.cc
diff --git a/test/unittests/compiler/instruction-sequence-unittest.cc b/test/unittests/compiler/instruction-sequence-unittest.cc
index abc53940efe4c45aafb228e10892bc8af992c29d..f659b07887fbcbf02e4ff400abb15030f3a7c3d1 100644
--- a/test/unittests/compiler/instruction-sequence-unittest.cc
+++ b/test/unittests/compiler/instruction-sequence-unittest.cc
@@ -109,7 +109,7 @@ Instruction* InstructionSequenceTest::EndBlock(BlockCompletion completion) {
case kBlockEnd:
break;
case kFallThrough:
- result = EmitFallThrough();
+ result = EmitJump();
break;
case kJump:
CHECK(!block_returns_);
@@ -441,11 +441,20 @@ InstructionBlock* InstructionSequenceTest::NewBlock() {
void InstructionSequenceTest::WireBlocks() {
CHECK(!current_block());
CHECK(instruction_blocks_.size() == completions_.size());
+ CHECK(loop_blocks_.empty());
+ // Wire in end block to look like a scheduler produced cfg.
+ auto end_block = NewBlock();
+ current_block_ = nullptr;
+ sequence()->EndBlock(end_block->rpo_number());
size_t offset = 0;
for (const auto& completion : completions_) {
switch (completion.type_) {
- case kBlockEnd:
+ case kBlockEnd: {
+ auto block = instruction_blocks_[offset];
+ block->successors().push_back(end_block->rpo_number());
+ end_block->predecessors().push_back(block->rpo_number());
break;
+ }
case kFallThrough: // Fallthrough.
case kJump:
WireBlock(offset, completion.offset_0_);
« no previous file with comments | « no previous file | test/unittests/compiler/move-optimizer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698