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() {} |