Commit a105dafa authored by epertoso's avatar epertoso Committed by Commit bot

[turbofan] Renames variables in machine-graph-verifier.cc to make them consistent.

R=jarin@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2401553002
Cr-Commit-Position: refs/heads/master@{#40035}
parent 84b81f8c
...@@ -25,7 +25,8 @@ class MachineRepresentationInferrer { ...@@ -25,7 +25,8 @@ class MachineRepresentationInferrer {
Linkage* linkage, Zone* zone) Linkage* linkage, Zone* zone)
: schedule_(schedule), : schedule_(schedule),
linkage_(linkage), linkage_(linkage),
representation_vector_(graph->NodeCount(), zone) { representation_vector_(graph->NodeCount(), MachineRepresentation::kNone,
zone) {
Run(); Run();
} }
...@@ -234,9 +235,10 @@ class MachineRepresentationInferrer { ...@@ -234,9 +235,10 @@ class MachineRepresentationInferrer {
class MachineRepresentationChecker { class MachineRepresentationChecker {
public: public:
MachineRepresentationChecker(Schedule const* const schedule, MachineRepresentationChecker(
MachineRepresentationInferrer const* const typer) Schedule const* const schedule,
: schedule_(schedule), typer_(typer) {} MachineRepresentationInferrer const* const inferrer)
: schedule_(schedule), inferrer_(inferrer) {}
void Run() { void Run() {
BasicBlockVector const* blocks = schedule_->all_blocks(); BasicBlockVector const* blocks = schedule_->all_blocks();
...@@ -255,11 +257,11 @@ class MachineRepresentationChecker { ...@@ -255,11 +257,11 @@ class MachineRepresentationChecker {
break; break;
case IrOpcode::kChangeBitToTagged: case IrOpcode::kChangeBitToTagged:
CHECK_EQ(MachineRepresentation::kBit, CHECK_EQ(MachineRepresentation::kBit,
typer_->GetRepresentation(node->InputAt(0))); inferrer_->GetRepresentation(node->InputAt(0)));
break; break;
case IrOpcode::kChangeTaggedToBit: case IrOpcode::kChangeTaggedToBit:
CHECK_EQ(MachineRepresentation::kTagged, CHECK_EQ(MachineRepresentation::kTagged,
typer_->GetRepresentation(node->InputAt(0))); inferrer_->GetRepresentation(node->InputAt(0)));
break; break;
case IrOpcode::kRoundInt64ToFloat64: case IrOpcode::kRoundInt64ToFloat64:
case IrOpcode::kRoundUint64ToFloat64: case IrOpcode::kRoundUint64ToFloat64:
...@@ -290,7 +292,7 @@ class MachineRepresentationChecker { ...@@ -290,7 +292,7 @@ class MachineRepresentationChecker {
case IrOpcode::kWord64Equal: case IrOpcode::kWord64Equal:
CheckValueInputIsTaggedOrPointer(node, 0); CheckValueInputIsTaggedOrPointer(node, 0);
CheckValueInputRepresentationIs( CheckValueInputRepresentationIs(
node, 1, typer_->GetRepresentation(node->InputAt(0))); node, 1, inferrer_->GetRepresentation(node->InputAt(0)));
break; break;
case IrOpcode::kInt64LessThan: case IrOpcode::kInt64LessThan:
case IrOpcode::kInt64LessThanOrEqual: case IrOpcode::kInt64LessThanOrEqual:
...@@ -400,7 +402,7 @@ class MachineRepresentationChecker { ...@@ -400,7 +402,7 @@ class MachineRepresentationChecker {
} }
break; break;
case IrOpcode::kPhi: case IrOpcode::kPhi:
switch (typer_->GetRepresentation(node)) { switch (inferrer_->GetRepresentation(node)) {
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
case MachineRepresentation::kTaggedPointer: case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTaggedSigned: case MachineRepresentation::kTaggedSigned:
...@@ -411,7 +413,7 @@ class MachineRepresentationChecker { ...@@ -411,7 +413,7 @@ class MachineRepresentationChecker {
default: default:
for (int i = 0; i < node->op()->ValueInputCount(); ++i) { for (int i = 0; i < node->op()->ValueInputCount(); ++i) {
CheckValueInputRepresentationIs( CheckValueInputRepresentationIs(
node, i, typer_->GetRepresentation(node)); node, i, inferrer_->GetRepresentation(node));
} }
break; break;
} }
...@@ -444,7 +446,7 @@ class MachineRepresentationChecker { ...@@ -444,7 +446,7 @@ class MachineRepresentationChecker {
void CheckValueInputRepresentationIs(Node const* node, int index, void CheckValueInputRepresentationIs(Node const* node, int index,
MachineRepresentation representation) { MachineRepresentation representation) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
if (typer_->GetRepresentation(input) != representation) { if (inferrer_->GetRepresentation(input) != representation) {
std::stringstream str; std::stringstream str;
str << "TypeError: node #" << node->id() << ":" << *node->op() str << "TypeError: node #" << node->id() << ":" << *node->op()
<< " uses node #" << input->id() << ":" << *input->op() << " uses node #" << input->id() << ":" << *input->op()
...@@ -456,7 +458,7 @@ class MachineRepresentationChecker { ...@@ -456,7 +458,7 @@ class MachineRepresentationChecker {
void CheckValueInputIsTagged(Node const* node, int index) { void CheckValueInputIsTagged(Node const* node, int index) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
switch (typer_->GetRepresentation(input)) { switch (inferrer_->GetRepresentation(input)) {
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
case MachineRepresentation::kTaggedPointer: case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTaggedSigned: case MachineRepresentation::kTaggedSigned:
...@@ -473,7 +475,7 @@ class MachineRepresentationChecker { ...@@ -473,7 +475,7 @@ class MachineRepresentationChecker {
void CheckValueInputIsTaggedOrPointer(Node const* node, int index) { void CheckValueInputIsTaggedOrPointer(Node const* node, int index) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
switch (typer_->GetRepresentation(input)) { switch (inferrer_->GetRepresentation(input)) {
case MachineRepresentation::kTagged: case MachineRepresentation::kTagged:
case MachineRepresentation::kTaggedPointer: case MachineRepresentation::kTaggedPointer:
case MachineRepresentation::kTaggedSigned: case MachineRepresentation::kTaggedSigned:
...@@ -481,7 +483,7 @@ class MachineRepresentationChecker { ...@@ -481,7 +483,7 @@ class MachineRepresentationChecker {
default: default:
break; break;
} }
if (typer_->GetRepresentation(input) != if (inferrer_->GetRepresentation(input) !=
MachineType::PointerRepresentation()) { MachineType::PointerRepresentation()) {
std::ostringstream str; std::ostringstream str;
str << "TypeError: node #" << node->id() << ":" << *node->op() str << "TypeError: node #" << node->id() << ":" << *node->op()
...@@ -493,7 +495,7 @@ class MachineRepresentationChecker { ...@@ -493,7 +495,7 @@ class MachineRepresentationChecker {
void CheckValueInputForInt32Op(Node const* node, int index) { void CheckValueInputForInt32Op(Node const* node, int index) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
switch (typer_->GetRepresentation(input)) { switch (inferrer_->GetRepresentation(input)) {
case MachineRepresentation::kBit: case MachineRepresentation::kBit:
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
case MachineRepresentation::kWord16: case MachineRepresentation::kWord16:
...@@ -518,7 +520,7 @@ class MachineRepresentationChecker { ...@@ -518,7 +520,7 @@ class MachineRepresentationChecker {
void CheckValueInputForInt64Op(Node const* node, int index) { void CheckValueInputForInt64Op(Node const* node, int index) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
switch (typer_->GetRepresentation(input)) { switch (inferrer_->GetRepresentation(input)) {
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
return; return;
case MachineRepresentation::kNone: { case MachineRepresentation::kNone: {
...@@ -541,7 +543,8 @@ class MachineRepresentationChecker { ...@@ -541,7 +543,8 @@ class MachineRepresentationChecker {
void CheckValueInputForFloat32Op(Node const* node, int index) { void CheckValueInputForFloat32Op(Node const* node, int index) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
if (MachineRepresentation::kFloat32 == typer_->GetRepresentation(input)) { if (MachineRepresentation::kFloat32 ==
inferrer_->GetRepresentation(input)) {
return; return;
} }
std::ostringstream str; std::ostringstream str;
...@@ -553,7 +556,8 @@ class MachineRepresentationChecker { ...@@ -553,7 +556,8 @@ class MachineRepresentationChecker {
void CheckValueInputForFloat64Op(Node const* node, int index) { void CheckValueInputForFloat64Op(Node const* node, int index) {
Node const* input = node->InputAt(index); Node const* input = node->InputAt(index);
if (MachineRepresentation::kFloat64 == typer_->GetRepresentation(input)) { if (MachineRepresentation::kFloat64 ==
inferrer_->GetRepresentation(input)) {
return; return;
} }
std::ostringstream str; std::ostringstream str;
...@@ -569,7 +573,8 @@ class MachineRepresentationChecker { ...@@ -569,7 +573,8 @@ class MachineRepresentationChecker {
bool should_log_error = false; bool should_log_error = false;
for (size_t i = 0; i < desc->InputCount(); ++i) { for (size_t i = 0; i < desc->InputCount(); ++i) {
Node const* input = node->InputAt(static_cast<int>(i)); Node const* input = node->InputAt(static_cast<int>(i));
MachineRepresentation const input_type = typer_->GetRepresentation(input); MachineRepresentation const input_type =
inferrer_->GetRepresentation(input);
MachineRepresentation const expected_input_type = MachineRepresentation const expected_input_type =
desc->GetInputType(i).representation(); desc->GetInputType(i).representation();
if (!IsCompatible(expected_input_type, input_type)) { if (!IsCompatible(expected_input_type, input_type)) {
...@@ -649,7 +654,7 @@ class MachineRepresentationChecker { ...@@ -649,7 +654,7 @@ class MachineRepresentationChecker {
} }
Schedule const* const schedule_; Schedule const* const schedule_;
MachineRepresentationInferrer const* const typer_; MachineRepresentationInferrer const* const inferrer_;
}; };
} // namespace } // namespace
......
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