Commit c00f7dff authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Remove deprecated code from RawMachineAssembler.

This mostly removes dead code and obsolete special cases from the
RawMachineAssembler::MakeNode helper, that shouldn't be necessary
anymore.

R=rmcilroy@chromium.org

Review URL: https://codereview.chromium.org/1243253005

Cr-Commit-Position: refs/heads/master@{#29817}
parent ea056cbf
......@@ -22,7 +22,7 @@ RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph,
machine_(zone(), word, flags),
common_(zone()),
call_descriptor_(call_descriptor),
parameters_(NULL),
parameters_(nullptr),
current_block_(schedule()->start()) {
int param_count = static_cast<int>(parameter_count());
Node* s = graph->NewNode(common_.Start(param_count));
......@@ -42,7 +42,7 @@ Schedule* RawMachineAssembler::Export() {
Scheduler::ComputeSpecialRPO(zone(), schedule_);
// Invalidate RawMachineAssembler.
Schedule* schedule = schedule_;
schedule_ = NULL;
schedule_ = nullptr;
return schedule;
}
......@@ -56,7 +56,7 @@ Node* RawMachineAssembler::Parameter(size_t index) {
void RawMachineAssembler::Goto(Label* label) {
DCHECK(current_block_ != schedule()->end());
schedule()->AddGoto(CurrentBlock(), Use(label));
current_block_ = NULL;
current_block_ = nullptr;
}
......@@ -65,7 +65,7 @@ void RawMachineAssembler::Branch(Node* condition, Label* true_val,
DCHECK(current_block_ != schedule()->end());
Node* branch = NewNode(common()->Branch(), condition);
schedule()->AddBranch(CurrentBlock(), branch, Use(true_val), Use(false_val));
current_block_ = NULL;
current_block_ = nullptr;
}
......@@ -94,9 +94,9 @@ void RawMachineAssembler::Switch(Node* index, Label* default_label,
void RawMachineAssembler::Return(Node* value) {
Node* ret = NewNode(common()->Return(), value);
Node* ret = graph()->NewNode(common()->Return(), value);
schedule()->AddReturn(CurrentBlock(), ret);
current_block_ = NULL;
current_block_ = nullptr;
}
......@@ -217,7 +217,7 @@ Node* RawMachineAssembler::CallCFunction8(
void RawMachineAssembler::Bind(Label* label) {
DCHECK(current_block_ == NULL);
DCHECK(current_block_ == nullptr);
DCHECK(!label->bound_);
label->bound_ = true;
current_block_ = EnsureBlock(label);
......@@ -231,7 +231,7 @@ BasicBlock* RawMachineAssembler::Use(Label* label) {
BasicBlock* RawMachineAssembler::EnsureBlock(Label* label) {
if (label->block_ == NULL) label->block_ = schedule()->NewBasicBlock();
if (label->block_ == nullptr) label->block_ = schedule()->NewBasicBlock();
return label->block_;
}
......@@ -245,13 +245,9 @@ BasicBlock* RawMachineAssembler::CurrentBlock() {
Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
Node** inputs) {
DCHECK_NOT_NULL(schedule_);
DCHECK(current_block_ != NULL);
DCHECK(current_block_ != nullptr);
Node* node = graph()->NewNode(op, input_count, inputs);
BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start()
: CurrentBlock();
if (op->opcode() != IrOpcode::kReturn) {
schedule()->AddNode(block, node);
}
schedule()->AddNode(CurrentBlock(), node);
return node;
}
......
......@@ -34,13 +34,7 @@ class RawMachineAssembler {
Label() : block_(NULL), used_(false), bound_(false) {}
~Label() { DCHECK(bound_ || !used_); }
BasicBlock* block() { return block_; }
private:
// Private constructor for exit label.
explicit Label(BasicBlock* block)
: block_(block), used_(false), bound_(false) {}
BasicBlock* block_;
bool used_;
bool bound_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment