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

Unified Diff: src/compiler/machine-graph-verifier.cc

Issue 2573573004: [stubs] Enable graph verification for builtins. (Closed)
Patch Set: Created 4 years 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-selector.cc ('k') | src/ic/accessor-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-graph-verifier.cc
diff --git a/src/compiler/machine-graph-verifier.cc b/src/compiler/machine-graph-verifier.cc
index acfa2bc276bf9c8de0658d2de8e41713cf6696ec..c0eea6528fe97bb1ad86af92403dd55e7be0b9a9 100644
--- a/src/compiler/machine-graph-verifier.cc
+++ b/src/compiler/machine-graph-verifier.cc
@@ -30,6 +30,10 @@ class MachineRepresentationInferrer {
Run();
}
+ CallDescriptor* call_descriptor() const {
+ return linkage_->GetIncomingDescriptor();
+ }
+
MachineRepresentation GetRepresentation(Node const* node) const {
return representation_vector_.at(node->id());
}
@@ -94,6 +98,11 @@ class MachineRepresentationInferrer {
linkage_->GetParameterType(ParameterIndexOf(node->op()))
.representation();
break;
+ case IrOpcode::kReturn: {
+ representation_vector_[node->id()] = PromoteRepresentation(
+ linkage_->GetReturnType().representation());
+ break;
+ }
case IrOpcode::kProjection: {
representation_vector_[node->id()] = GetProjectionType(node);
} break;
@@ -136,6 +145,9 @@ class MachineRepresentationInferrer {
break;
}
case IrOpcode::kAtomicStore:
+ representation_vector_[node->id()] =
+ PromoteRepresentation(AtomicStoreRepresentationOf(node->op()));
+ break;
case IrOpcode::kStore:
case IrOpcode::kProtectedStore:
representation_vector_[node->id()] = PromoteRepresentation(
@@ -456,6 +468,11 @@ class MachineRepresentationChecker {
CheckValueInputIsTagged(node, i);
}
break;
+ case MachineRepresentation::kWord32:
+ for (int i = 0; i < node->op()->ValueInputCount(); ++i) {
+ CheckValueInputForInt32Op(node, i);
+ }
+ break;
default:
for (int i = 0; i < node->op()->ValueInputCount(); ++i) {
CheckValueInputRepresentationIs(
@@ -468,10 +485,33 @@ class MachineRepresentationChecker {
case IrOpcode::kSwitch:
CheckValueInputForInt32Op(node, 0);
break;
- case IrOpcode::kReturn:
- // TODO(epertoso): use the linkage to determine which tipe we
- // should have here.
+ case IrOpcode::kReturn: {
+ // TODO(ishell): enable once the pop count parameter type becomes
+ // MachineType::PointerRepresentation(). Currently it's int32 or
+ // word-size.
+ // CheckValueInputRepresentationIs(
+ // node, 0, MachineType::PointerRepresentation()); // Pop count
+ size_t return_count = inferrer_->call_descriptor()->ReturnCount();
+ for (size_t i = 0; i < return_count; i++) {
+ MachineType type = inferrer_->call_descriptor()->GetReturnType(i);
+ int input_index = static_cast<int>(i + 1);
+ switch (type.representation()) {
+ case MachineRepresentation::kTagged:
+ case MachineRepresentation::kTaggedPointer:
+ case MachineRepresentation::kTaggedSigned:
+ CheckValueInputIsTagged(node, input_index);
+ break;
+ case MachineRepresentation::kWord32:
+ CheckValueInputForInt32Op(node, input_index);
+ break;
+ default:
+ CheckValueInputRepresentationIs(
+ node, 2, inferrer_->GetRepresentation(node));
+ }
+ break;
Nico 2017/09/15 19:28:25 This break is probably supposed to go in the defau
Igor Sheludko 2017/09/20 15:15:20 Nice catch! Thank you! The fix: https://chromium-r
+ }
break;
+ }
case IrOpcode::kTypedStateValues:
case IrOpcode::kFrameState:
break;
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/ic/accessor-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698