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

Unified Diff: src/compiler/verifier.cc

Issue 1912853003: [turbofan] Add the Verifier to the pipeline for code stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/verifier.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/verifier.cc
diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc
index 8c7b01d5fe4b67e4f7fa358281d2c00cbc52aa8b..7bf3249c1e43b0a89b24e037bc6b06d7bca9e6c6 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -42,12 +42,14 @@ static bool IsUseDefChainLinkPresent(Node* def, Node* use) {
class Verifier::Visitor {
public:
- Visitor(Zone* z, Typing typed) : zone(z), typing(typed) {}
+ Visitor(Zone* z, Typing typed, CheckInputs check_inputs)
+ : zone(z), typing(typed), check_inputs(check_inputs) {}
void Check(Node* node);
Zone* zone;
Typing typing;
+ CheckInputs check_inputs;
private:
void CheckNotTyped(Node* node) {
@@ -114,8 +116,10 @@ void Verifier::Visitor::Check(Node* node) {
int control_count = node->op()->ControlInputCount();
// Verify number of inputs matches up.
- int input_count = value_count + context_count + frame_state_count +
- effect_count + control_count;
+ int input_count = value_count + context_count + frame_state_count;
+ if (check_inputs == kAll) {
+ input_count += effect_count + control_count;
+ }
CHECK_EQ(input_count, node->InputCount());
// Verify that frame state has been inserted for the nodes that need it.
@@ -150,20 +154,23 @@ void Verifier::Visitor::Check(Node* node) {
CHECK(IsUseDefChainLinkPresent(context, node));
}
- // Verify all effect inputs actually have an effect.
- for (int i = 0; i < effect_count; ++i) {
- Node* effect = NodeProperties::GetEffectInput(node);
- CheckOutput(effect, node, effect->op()->EffectOutputCount(), "effect");
- CHECK(IsDefUseChainLinkPresent(effect, node));
- CHECK(IsUseDefChainLinkPresent(effect, node));
- }
+ if (check_inputs == kAll) {
+ // Verify all effect inputs actually have an effect.
+ for (int i = 0; i < effect_count; ++i) {
+ Node* effect = NodeProperties::GetEffectInput(node);
+ CheckOutput(effect, node, effect->op()->EffectOutputCount(), "effect");
+ CHECK(IsDefUseChainLinkPresent(effect, node));
+ CHECK(IsUseDefChainLinkPresent(effect, node));
+ }
- // Verify all control inputs are control nodes.
- for (int i = 0; i < control_count; ++i) {
- Node* control = NodeProperties::GetControlInput(node, i);
- CheckOutput(control, node, control->op()->ControlOutputCount(), "control");
- CHECK(IsDefUseChainLinkPresent(control, node));
- CHECK(IsUseDefChainLinkPresent(control, node));
+ // Verify all control inputs are control nodes.
+ for (int i = 0; i < control_count; ++i) {
+ Node* control = NodeProperties::GetControlInput(node, i);
+ CheckOutput(control, node, control->op()->ControlOutputCount(),
+ "control");
+ CHECK(IsDefUseChainLinkPresent(control, node));
+ CHECK(IsUseDefChainLinkPresent(control, node));
+ }
}
switch (node->opcode()) {
@@ -1010,12 +1017,11 @@ void Verifier::Visitor::Check(Node* node) {
}
} // NOLINT(readability/fn_size)
-
-void Verifier::Run(Graph* graph, Typing typing) {
+void Verifier::Run(Graph* graph, Typing typing, CheckInputs check_inputs) {
CHECK_NOT_NULL(graph->start());
CHECK_NOT_NULL(graph->end());
Zone zone(graph->zone()->allocator());
- Visitor visitor(&zone, typing);
+ Visitor visitor(&zone, typing, check_inputs);
AllNodes all(&zone, graph);
for (Node* node : all.live) visitor.Check(node);
« no previous file with comments | « src/compiler/verifier.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698