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

Unified Diff: src/compiler/instruction.cc

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/instruction.h ('k') | src/compiler/instruction-selector.h » ('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 0f041af989cf465e8e5afdae6bb993da2a1b7a09..363e7909cf99bf9f00dc9a75518fb04b8c770607 100644
--- a/src/compiler/instruction.cc
+++ b/src/compiler/instruction.cc
@@ -381,14 +381,12 @@ static void InitializeInstructionBlocks(Zone* zone, const Schedule* schedule,
InstructionSequence::InstructionSequence(Zone* instruction_zone,
- Linkage* linkage, const Graph* graph,
+ const Graph* graph,
const Schedule* schedule)
: zone_(instruction_zone),
- node_count_(graph->NodeCount()),
- node_map_(zone()->NewArray<int>(node_count_)),
+ node_map_(graph->NodeCount(), kNodeUnmapped, zone()),
instruction_blocks_(static_cast<int>(schedule->rpo_order()->size()), NULL,
zone()),
- linkage_(linkage),
constants_(ConstantMap::key_compare(),
ConstantMap::allocator_type(zone())),
immediates_(zone()),
@@ -398,15 +396,12 @@ InstructionSequence::InstructionSequence(Zone* instruction_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 < node_count_; ++i) {
- node_map_[i] = -1;
- }
InitializeInstructionBlocks(zone(), schedule, &instruction_blocks_);
}
int InstructionSequence::GetVirtualRegister(const Node* node) {
- if (node_map_[node->id()] == -1) {
+ if (node_map_[node->id()] == kNodeUnmapped) {
node_map_[node->id()] = NextVirtualRegister();
}
return node_map_[node->id()];
@@ -604,7 +599,7 @@ std::ostream& operator<<(std::ostream& os, const InstructionSequence& code) {
it != code.constants_.end(); ++i, ++it) {
os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n";
}
- for (int i = 0; i < code.BasicBlockCount(); i++) {
+ for (int i = 0; i < code.InstructionBlockCount(); i++) {
BasicBlock::RpoNumber rpo = BasicBlock::RpoNumber::FromInt(i);
const InstructionBlock* block = code.InstructionBlockAt(rpo);
CHECK(block->rpo_number() == rpo);
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/instruction-selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698