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

Unified Diff: src/compiler/instruction.h

Issue 710323002: [turbofan] put gaps before instructions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index 1740dfbf25b970054417d75c533ba95e8ea65366..19d50a530aa0b33a474b85efe81ea1dac1a68f68 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -495,9 +495,7 @@ class Instruction : public ZoneObject {
bool NeedsPointerMap() const { return IsCall(); }
bool HasPointerMap() const { return pointer_map_ != NULL; }
- bool IsGapMoves() const {
- return opcode() == kGapInstruction || opcode() == kBlockStartInstruction;
- }
+ bool IsGapMoves() const { return opcode() == kGapInstruction; }
bool IsBlockStart() const { return opcode() == kBlockStartInstruction; }
bool IsSourcePosition() const {
return opcode() == kSourcePositionInstruction;
@@ -601,7 +599,7 @@ class GapInstruction : public Instruction {
static GapInstruction* New(Zone* zone) {
void* buffer = zone->New(sizeof(GapInstruction));
- return new (buffer) GapInstruction(kGapInstruction);
+ return new (buffer) GapInstruction();
}
static GapInstruction* cast(Instruction* instr) {
@@ -614,24 +612,22 @@ class GapInstruction : public Instruction {
return static_cast<const GapInstruction*>(instr);
}
- protected:
- explicit GapInstruction(InstructionCode opcode) : Instruction(opcode) {
+ private:
+ GapInstruction() : Instruction(kGapInstruction) {
parallel_moves_[BEFORE] = NULL;
parallel_moves_[START] = NULL;
parallel_moves_[END] = NULL;
parallel_moves_[AFTER] = NULL;
}
- private:
friend std::ostream& operator<<(std::ostream& os,
const PrintableInstruction& instr);
ParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
};
-// This special kind of gap move instruction represents the beginning of a
-// block of code.
-class BlockStartInstruction FINAL : public GapInstruction {
+// This is a placeholder instruction marking the start of a block.
+class BlockStartInstruction FINAL : public Instruction {
public:
static BlockStartInstruction* New(Zone* zone) {
void* buffer = zone->New(sizeof(BlockStartInstruction));
@@ -649,7 +645,7 @@ class BlockStartInstruction FINAL : public GapInstruction {
}
private:
- BlockStartInstruction() : GapInstruction(kBlockStartInstruction) {}
+ BlockStartInstruction() : Instruction(kBlockStartInstruction) {}
};
@@ -957,7 +953,7 @@ class InstructionSequence FINAL : public ZoneObject {
void AddGapMove(int index, InstructionOperand* from, InstructionOperand* to);
- BlockStartInstruction* GetBlockStart(BasicBlock::RpoNumber rpo) const;
+ const BlockStartInstruction* GetBlockStart(BasicBlock::RpoNumber rpo) const;
typedef InstructionDeque::const_iterator const_iterator;
const_iterator begin() const { return instructions_.begin(); }
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698