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

Unified Diff: src/compiler/instruction.cc

Issue 854703002: Reland "[turbofan] simplify gap ordering" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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.h ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.cc
diff --git a/src/compiler/instruction.cc b/src/compiler/instruction.cc
index 5ca0f12661847747e69e5abb8e09cba6870a2f36..9d6d5e2ec5e663854a39fc5d5e6a652405e310c3 100644
--- a/src/compiler/instruction.cc
+++ b/src/compiler/instruction.cc
@@ -279,7 +279,7 @@ std::ostream& operator<<(std::ostream& os,
if (instr.IsGapMoves()) {
const GapInstruction* gap = GapInstruction::cast(&instr);
- os << (instr.IsBlockStart() ? " block-start" : "gap ");
+ os << "gap ";
for (int i = GapInstruction::FIRST_INNER_POSITION;
i <= GapInstruction::LAST_INNER_POSITION; i++) {
os << "(";
@@ -457,10 +457,10 @@ int InstructionSequence::NextVirtualRegister() {
}
-BlockStartInstruction* InstructionSequence::GetBlockStart(
+GapInstruction* InstructionSequence::GetBlockStart(
BasicBlock::RpoNumber rpo) const {
const InstructionBlock* block = InstructionBlockAt(rpo);
- return BlockStartInstruction::cast(InstructionAt(block->code_start()));
+ return GapInstruction::cast(InstructionAt(block->code_start()));
}
@@ -470,26 +470,26 @@ void InstructionSequence::StartBlock(BasicBlock::RpoNumber rpo) {
int code_start = static_cast<int>(instructions_.size());
block->set_code_start(code_start);
block_starts_.push_back(code_start);
- BlockStartInstruction* block_start = BlockStartInstruction::New(zone());
- AddInstruction(block_start);
}
void InstructionSequence::EndBlock(BasicBlock::RpoNumber rpo) {
int end = static_cast<int>(instructions_.size());
InstructionBlock* block = InstructionBlockAt(rpo);
+ if (block->code_start() == end) { // Empty block. Insert a nop.
+ AddInstruction(Instruction::New(zone(), kArchNop));
+ end = static_cast<int>(instructions_.size());
+ }
DCHECK(block->code_start() >= 0 && block->code_start() < end);
block->set_code_end(end);
}
int InstructionSequence::AddInstruction(Instruction* instr) {
- // TODO(titzer): the order of these gaps is a holdover from Lithium.
GapInstruction* gap = GapInstruction::New(zone());
- if (instr->IsControl()) instructions_.push_back(gap);
+ instructions_.push_back(gap);
int index = static_cast<int>(instructions_.size());
instructions_.push_back(instr);
- if (!instr->IsControl()) instructions_.push_back(gap);
if (instr->NeedsPointerMap()) {
DCHECK(instr->pointer_map() == NULL);
PointerMap* pointer_map = new (zone()) PointerMap(zone());
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698