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

Unified Diff: src/compiler/instruction.cc

Issue 623313003: [turbofan] map vregs early (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.h ('k') | src/compiler/instruction-selector.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 280dd6e7df8e5d5838d4ebb4de31fd3b31af25de..e19a905531fbfaa08628cdfd65d841638a17558b 100644
--- a/src/compiler/instruction.cc
+++ b/src/compiler/instruction.cc
@@ -316,6 +316,35 @@ std::ostream& operator<<(std::ostream& os, const Constant& constant) {
}
+InstructionSequence::InstructionSequence(Linkage* linkage, Graph* graph,
+ Schedule* schedule)
+ : graph_(graph),
+ node_map_(zone()->NewArray<int>(graph->NodeCount())),
+ linkage_(linkage),
+ schedule_(schedule),
+ constants_(ConstantMap::key_compare(),
+ ConstantMap::allocator_type(zone())),
+ immediates_(zone()),
+ instructions_(zone()),
+ next_virtual_register_(0),
+ pointer_maps_(zone()),
+ doubles_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())),
+ references_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())),
+ deoptimization_entries_(zone()) {
+ for (int i = 0; i < graph->NodeCount(); ++i) {
+ node_map_[i] = -1;
+ }
+}
+
+
+int InstructionSequence::GetVirtualRegister(const Node* node) {
+ if (node_map_[node->id()] == -1) {
+ node_map_[node->id()] = NextVirtualRegister();
+ }
+ return node_map_[node->id()];
+}
+
+
Label* InstructionSequence::GetLabel(BasicBlock* block) {
return GetBlockStart(block)->label();
}
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698