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

Unified Diff: src/compiler/node-properties.cc

Issue 1367423002: [turbofan] Move node verification methods to the Verifier class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 5 years, 3 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/node-properties.h ('k') | src/compiler/verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-properties.cc
diff --git a/src/compiler/node-properties.cc b/src/compiler/node-properties.cc
index fffd4da6a4df123385647c5b01443e65fdc4a941..0d061a36c4f67e89b4b17ad782946b532841d1b5 100644
--- a/src/compiler/node-properties.cc
+++ b/src/compiler/node-properties.cc
@@ -6,6 +6,7 @@
#include "src/compiler/graph.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
+#include "src/compiler/verifier.h"
namespace v8 {
namespace internal {
@@ -198,10 +199,7 @@ void NodeProperties::ReplaceUses(Node* node, Node* value, Node* effect,
// static
void NodeProperties::ChangeOp(Node* node, const Operator* new_op) {
node->set_op(new_op);
-
-#ifdef DEBUG
- Verify(node);
-#endif // DEBUG
+ Verifier::VerifyNode(node);
}
@@ -271,51 +269,6 @@ void NodeProperties::CollectControlProjections(Node* node, Node** projections,
// static
-void NodeProperties::Verify(Node* node) {
- CHECK_EQ(OperatorProperties::GetTotalInputCount(node->op()),
- node->InputCount());
- // If this node has no effect or no control outputs,
- // we check that no its uses are effect or control inputs.
- bool check_no_control = node->op()->ControlOutputCount() == 0;
- bool check_no_effect = node->op()->EffectOutputCount() == 0;
- bool check_no_frame_state = node->opcode() != IrOpcode::kFrameState;
- if (check_no_effect || check_no_control) {
- for (Edge edge : node->use_edges()) {
- Node* const user = edge.from();
- CHECK(!user->IsDead());
- if (NodeProperties::IsControlEdge(edge)) {
- CHECK(!check_no_control);
- } else if (NodeProperties::IsEffectEdge(edge)) {
- CHECK(!check_no_effect);
- } else if (NodeProperties::IsFrameStateEdge(edge)) {
- CHECK(!check_no_frame_state);
- }
- }
- }
- // Frame state inputs should be frame states (or sentinels).
- for (int i = 0; i < OperatorProperties::GetFrameStateInputCount(node->op());
- i++) {
- Node* input = NodeProperties::GetFrameStateInput(node, i);
- CHECK(input->opcode() == IrOpcode::kFrameState ||
- input->opcode() == IrOpcode::kStart ||
- input->opcode() == IrOpcode::kDead);
- }
- // Effect inputs should be effect-producing nodes (or sentinels).
- for (int i = 0; i < node->op()->EffectInputCount(); i++) {
- Node* input = NodeProperties::GetEffectInput(node, i);
- CHECK(input->op()->EffectOutputCount() > 0 ||
- input->opcode() == IrOpcode::kDead);
- }
- // Control inputs should be control-producing nodes (or sentinels).
- for (int i = 0; i < node->op()->ControlInputCount(); i++) {
- Node* input = NodeProperties::GetControlInput(node, i);
- CHECK(input->op()->ControlOutputCount() > 0 ||
- input->opcode() == IrOpcode::kDead);
- }
-}
-
-
-// static
bool NodeProperties::AllValueInputsAreTyped(Node* node) {
int input_count = node->op()->ValueInputCount();
for (int index = 0; index < input_count; ++index) {
« no previous file with comments | « src/compiler/node-properties.h ('k') | src/compiler/verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698