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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-assembler.h" 5 #include "src/compiler/code-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 InstructionSelector::AlignmentRequirements())), 58 InstructionSelector::AlignmentRequirements())),
59 flags_(flags), 59 flags_(flags),
60 name_(name), 60 name_(name),
61 code_generated_(false), 61 code_generated_(false),
62 variables_(zone) {} 62 variables_(zone) {}
63 63
64 CodeAssemblerState::~CodeAssemblerState() {} 64 CodeAssemblerState::~CodeAssemblerState() {}
65 65
66 CodeAssembler::~CodeAssembler() {} 66 CodeAssembler::~CodeAssembler() {}
67 67
68 class BreakOnNodeDecorator final : public GraphDecorator {
69 public:
70 explicit BreakOnNodeDecorator(NodeId node_id) : node_id_(node_id) {}
71
72 void Decorate(Node* node) final {
73 if (node->id() == node_id_) {
74 base::OS::DebugBreak();
75 }
76 }
77
78 private:
79 NodeId node_id_;
80 };
81
82 void CodeAssembler::BreakOnNode(int node_id) {
83 Graph* graph = raw_assembler()->graph();
84 Zone* zone = graph->zone();
85 GraphDecorator* decorator =
86 new (zone) BreakOnNodeDecorator(static_cast<NodeId>(node_id));
87 graph->AddDecorator(decorator);
88 }
89
68 void CodeAssembler::CallPrologue() {} 90 void CodeAssembler::CallPrologue() {}
69 91
70 void CodeAssembler::CallEpilogue() {} 92 void CodeAssembler::CallEpilogue() {}
71 93
72 // static 94 // static
73 Handle<Code> CodeAssembler::GenerateCode(CodeAssemblerState* state, 95 Handle<Code> CodeAssembler::GenerateCode(CodeAssemblerState* state,
74 bool verify_graph) { 96 bool verify_graph) {
75 // TODO(ishell): Remove verify_graph parameter and always enable the 97 // TODO(ishell): Remove verify_graph parameter and always enable the
76 // verification once all the issues are fixed. 98 // verification once all the issues are fixed.
77 DCHECK(!state->code_generated_); 99 DCHECK(!state->code_generated_);
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 } 1216 }
1195 } 1217 }
1196 } 1218 }
1197 1219
1198 bound_ = true; 1220 bound_ = true;
1199 } 1221 }
1200 1222
1201 } // namespace compiler 1223 } // namespace compiler
1202 } // namespace internal 1224 } // namespace internal
1203 } // namespace v8 1225 } // namespace v8
OLDNEW
« 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