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

Unified Diff: src/compiler/instruction-selector.cc

Issue 646393002: [turbofan] remove some of the dependency of Instruction on Schedule (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « src/compiler/instruction.cc ('k') | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index d62e253ab1b8c066880b7796110bec59e5eddeff..0cfd950acdef9ac65c97ce814fcfdefa810c6766 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -55,11 +55,11 @@ void InstructionSelector::SelectInstructions() {
// Schedule the selected instructions.
for (BasicBlockVectorIter i = blocks->begin(); i != blocks->end(); ++i) {
BasicBlock* block = *i;
- size_t end = block->code_end();
- size_t start = block->code_start();
+ size_t end = sequence()->code_end(block);
+ size_t start = sequence()->code_start(block);
sequence()->StartBlock(block);
while (start-- > end) {
- sequence()->AddInstruction(instructions_[start], block);
+ sequence()->AddInstruction(instructions_[start]);
}
sequence()->EndBlock(block);
}
@@ -141,8 +141,7 @@ Instruction* InstructionSelector::Emit(Instruction* instr) {
bool InstructionSelector::IsNextInAssemblyOrder(const BasicBlock* block) const {
- return block->rpo_number() == (current_block_->rpo_number() + 1) &&
- block->deferred() == current_block_->deferred();
+ return current_block_->GetRpoNumber().IsNext(block->GetRpoNumber());
}
@@ -384,9 +383,8 @@ void InstructionSelector::VisitBlock(BasicBlock* block) {
}
// We're done with the block.
- // TODO(bmeurer): We should not mutate the schedule.
- block->set_code_start(static_cast<int>(instructions_.size()));
- block->set_code_end(current_block_end);
+ sequence()->set_code_start(block, static_cast<int>(instructions_.size()));
+ sequence()->set_code_end(block, current_block_end);
current_block_ = NULL;
}
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698