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

Unified Diff: src/compiler/code-assembler.cc

Issue 2574353002: [turbofan] Added --csa-trap-on-node option that helps debugging graph verification issues. (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/code-assembler.h ('k') | src/compiler/machine-graph-verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-assembler.cc
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc
index 38f208c8a4e229c51532bf681f98dc5e56de304f..b6095d96b6974dfb6246aa437973594cf9487477 100644
--- a/src/compiler/code-assembler.cc
+++ b/src/compiler/code-assembler.cc
@@ -65,6 +65,28 @@ CodeAssemblerState::~CodeAssemblerState() {}
CodeAssembler::~CodeAssembler() {}
+class BreakOnNodeDecorator final : public GraphDecorator {
+ public:
+ explicit BreakOnNodeDecorator(NodeId node_id) : node_id_(node_id) {}
+
+ void Decorate(Node* node) final {
+ if (node->id() == node_id_) {
+ base::OS::DebugBreak();
+ }
+ }
+
+ private:
+ NodeId node_id_;
+};
+
+void CodeAssembler::BreakOnNode(int node_id) {
+ Graph* graph = raw_assembler()->graph();
+ Zone* zone = graph->zone();
+ GraphDecorator* decorator =
+ new (zone) BreakOnNodeDecorator(static_cast<NodeId>(node_id));
+ graph->AddDecorator(decorator);
+}
+
void CodeAssembler::CallPrologue() {}
void CodeAssembler::CallEpilogue() {}
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/machine-graph-verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698