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

Unified Diff: src/compiler/instruction.h

Issue 664123002: [turbofan] cleanup InstructionSequence (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/ia32/code-generator-ia32.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 7359356b11f9718cbdc5e269f388c4674e486b5a..fddc225f8a23286a9b8a59a070248c9a3d0843e9 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -838,21 +838,23 @@ typedef ZoneDeque<Instruction*> InstructionDeque;
typedef ZoneDeque<PointerMap*> PointerMapDeque;
typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector;
typedef ZoneVector<InstructionBlock*> InstructionBlocks;
+typedef IntVector NodeToVregMap;
// Represents architecture-specific generated code before, during, and after
// register allocation.
// TODO(titzer): s/IsDouble/IsFloat64/
class InstructionSequence FINAL {
public:
- InstructionSequence(Zone* zone, Linkage* linkage, const Graph* graph,
- const Schedule* schedule);
+ static const int kNodeUnmapped = -1;
+
+ InstructionSequence(Zone* zone, const Graph* graph, const Schedule* schedule);
int NextVirtualRegister() { return next_virtual_register_++; }
int VirtualRegisterCount() const { return next_virtual_register_; }
- int node_count() const { return node_count_; }
+ int node_count() const { return static_cast<int>(node_map_.size()); }
- int BasicBlockCount() const {
+ int InstructionBlockCount() const {
return static_cast<int>(instruction_blocks_.size());
}
@@ -865,19 +867,10 @@ class InstructionSequence FINAL {
return instruction_blocks_[rpo_number.ToSize()];
}
- // TODO(dcarney): move to register allocator.
- const InstructionBlock* GetContainingLoop(
- const InstructionBlock* block) const {
- BasicBlock::RpoNumber index = block->loop_header();
- if (!index.IsValid()) return NULL;
- return instruction_blocks_[index.ToInt()];
- }
-
const InstructionBlock* GetInstructionBlock(int instruction_index) const;
int GetVirtualRegister(const Node* node);
- // TODO(dcarney): find a way to remove this.
- const int* GetNodeMapForTesting() const { return node_map_; }
+ const NodeToVregMap& GetNodeMapForTesting() const { return node_map_; }
bool IsReference(int virtual_register) const;
bool IsDouble(int virtual_register) const;
@@ -904,9 +897,7 @@ class InstructionSequence FINAL {
return instructions_[index];
}
- Frame* frame() { return &frame_; }
Isolate* isolate() const { return zone()->isolate(); }
- Linkage* linkage() const { return linkage_; }
const PointerMapDeque* pointer_maps() const { return &pointer_maps_; }
Zone* zone() const { return zone_; }
@@ -962,11 +953,9 @@ class InstructionSequence FINAL {
typedef std::set<int, std::less<int>, ZoneIntAllocator> VirtualRegisterSet;
- Zone* zone_;
- int node_count_;
- int* node_map_;
+ Zone* const zone_;
+ NodeToVregMap node_map_;
InstructionBlocks instruction_blocks_;
- Linkage* linkage_;
ConstantMap constants_;
ConstantDeque immediates_;
InstructionDeque instructions_;
@@ -974,7 +963,6 @@ class InstructionSequence FINAL {
PointerMapDeque pointer_maps_;
VirtualRegisterSet doubles_;
VirtualRegisterSet references_;
- Frame frame_;
DeoptimizationVector deoptimization_entries_;
};
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698