Revision: 24545
Author: [email protected]
Date: Mon Oct 13 08:09:27 2014 UTC
Log: [turbofan] remove graph from InstructionSequence
[email protected]
BUG=
Review URL: https://codereview.chromium.org/652643002
https://code.google.com/p/v8/source/detail?r=24545
Modified:
/branches/bleeding_edge/src/compiler/code-generator.h
/branches/bleeding_edge/src/compiler/instruction-selector-impl.h
/branches/bleeding_edge/src/compiler/instruction-selector.cc
/branches/bleeding_edge/src/compiler/instruction-selector.h
/branches/bleeding_edge/src/compiler/instruction.cc
/branches/bleeding_edge/src/compiler/instruction.h
/branches/bleeding_edge/test/cctest/compiler/test-instruction.cc
=======================================
--- /branches/bleeding_edge/src/compiler/code-generator.h Wed Oct 8
08:47:29 2014 UTC
+++ /branches/bleeding_edge/src/compiler/code-generator.h Mon Oct 13
08:09:27 2014 UTC
@@ -27,7 +27,6 @@
InstructionSequence* code() const { return code_; }
Frame* frame() const { return code()->frame(); }
- Graph* graph() const { return code()->graph(); }
Isolate* isolate() const { return zone()->isolate(); }
Linkage* linkage() const { return code()->linkage(); }
Schedule* schedule() const { return code()->schedule(); }
=======================================
--- /branches/bleeding_edge/src/compiler/instruction-selector-impl.h Mon
Oct 6 13:03:04 2014 UTC
+++ /branches/bleeding_edge/src/compiler/instruction-selector-impl.h Mon
Oct 13 08:09:27 2014 UTC
@@ -134,7 +134,6 @@
}
protected:
- Graph* graph() const { return selector()->graph(); }
InstructionSelector* selector() const { return selector_; }
InstructionSequence* sequence() const { return selector()->sequence(); }
Isolate* isolate() const { return zone()->isolate(); }
=======================================
--- /branches/bleeding_edge/src/compiler/instruction-selector.cc Wed Oct 8
08:47:29 2014 UTC
+++ /branches/bleeding_edge/src/compiler/instruction-selector.cc Mon Oct 13
08:09:27 2014 UTC
@@ -22,8 +22,8 @@
features_(features),
current_block_(NULL),
instructions_(zone()),
- defined_(graph()->NodeCount(), false, zone()),
- used_(graph()->NodeCount(), false, zone()) {}
+ defined_(sequence->node_count(), false, zone()),
+ used_(sequence->node_count(), false, zone()) {}
void InstructionSelector::SelectInstructions() {
=======================================
--- /branches/bleeding_edge/src/compiler/instruction-selector.h Wed Oct 8
08:47:29 2014 UTC
+++ /branches/bleeding_edge/src/compiler/instruction-selector.h Mon Oct 13
08:09:27 2014 UTC
@@ -193,7 +193,6 @@
//
===========================================================================
- Graph* graph() const { return sequence()->graph(); }
Linkage* linkage() const { return sequence()->linkage(); }
Schedule* schedule() const { return sequence()->schedule(); }
InstructionSequence* sequence() const { return sequence_; }
=======================================
--- /branches/bleeding_edge/src/compiler/instruction.cc Wed Oct 8 08:47:29
2014 UTC
+++ /branches/bleeding_edge/src/compiler/instruction.cc Mon Oct 13 08:09:27
2014 UTC
@@ -318,8 +318,9 @@
InstructionSequence::InstructionSequence(Linkage* linkage, Graph* graph,
Schedule* schedule)
- : graph_(graph),
- node_map_(zone()->NewArray<int>(graph->NodeCount())),
+ : zone_(schedule->zone()),
+ node_count_(graph->NodeCount()),
+ node_map_(zone()->NewArray<int>(node_count_)),
linkage_(linkage),
schedule_(schedule),
constants_(ConstantMap::key_compare(),
@@ -331,7 +332,7 @@
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) {
+ for (int i = 0; i < node_count_; ++i) {
node_map_[i] = -1;
}
}
=======================================
--- /branches/bleeding_edge/src/compiler/instruction.h Wed Oct 8 08:47:29
2014 UTC
+++ /branches/bleeding_edge/src/compiler/instruction.h Mon Oct 13 08:09:27
2014 UTC
@@ -767,7 +767,7 @@
int NextVirtualRegister() { return next_virtual_register_++; }
int VirtualRegisterCount() const { return next_virtual_register_; }
- int ValueCount() const { return graph_->NodeCount(); }
+ int node_count() const { return node_count_; }
int BasicBlockCount() const {
return static_cast<int>(schedule_->rpo_order()->size());
@@ -815,12 +815,11 @@
}
Frame* frame() { return &frame_; }
- Graph* graph() const { return graph_; }
Isolate* isolate() const { return zone()->isolate(); }
Linkage* linkage() const { return linkage_; }
Schedule* schedule() const { return schedule_; }
const PointerMapDeque* pointer_maps() const { return &pointer_maps_; }
- Zone* zone() const { return graph_->zone(); }
+ Zone* zone() const { return zone_; }
// Used by the code generator while adding instructions.
int AddInstruction(Instruction* instr, BasicBlock* block);
@@ -874,7 +873,8 @@
typedef std::set<int, std::less<int>, ZoneIntAllocator>
VirtualRegisterSet;
- Graph* graph_;
+ Zone* zone_;
+ int node_count_;
int* node_map_;
Linkage* linkage_;
Schedule* schedule_;
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-instruction.cc Fri
Sep 12 11:59:26 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/test-instruction.cc Mon
Oct 13 08:09:27 2014 UTC
@@ -112,7 +112,7 @@
R.allocCode();
- CHECK_EQ(R.graph.NodeCount(), R.code->ValueCount());
+ CHECK_EQ(R.graph.NodeCount(), R.code->node_count());
BasicBlockVector* blocks = R.schedule.rpo_order();
CHECK_EQ(static_cast<int>(blocks->size()), R.code->BasicBlockCount());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.