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

Unified Diff: src/compiler/escape-analysis-reducer.cc

Issue 1984203002: [turbofan] Simplify escape analysis VerifyReplacement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-escape-sidechannel
Patch Set: Created 4 years, 7 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/escape-analysis-reducer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/escape-analysis-reducer.cc
diff --git a/src/compiler/escape-analysis-reducer.cc b/src/compiler/escape-analysis-reducer.cc
index 3533426a434b365cbf28bef19a0183cc136720bf..8402366aec2a6be813aa4e9738087e4168f5683b 100644
--- a/src/compiler/escape-analysis-reducer.cc
+++ b/src/compiler/escape-analysis-reducer.cc
@@ -4,6 +4,7 @@
#include "src/compiler/escape-analysis-reducer.h"
+#include "src/compiler/all-nodes.h"
#include "src/compiler/js-graph.h"
#include "src/counters.h"
@@ -104,7 +105,7 @@ Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) {
fully_reduced_.Add(node->id());
}
if (Node* rep = escape_analysis()->GetReplacement(node)) {
- counters()->turbo_escape_loads_replaced()->Increment();
+ isolate()->counters()->turbo_escape_loads_replaced()->Increment();
TRACE("Replaced #%d (%s) with #%d (%s)\n", node->id(),
node->op()->mnemonic(), rep->id(), rep->op()->mnemonic());
ReplaceWithValue(node, rep);
@@ -137,7 +138,7 @@ Reduction EscapeAnalysisReducer::ReduceAllocate(Node* node) {
}
if (escape_analysis()->IsVirtual(node)) {
RelaxEffectsAndControls(node);
- counters()->turbo_escape_allocs_replaced()->Increment();
+ isolate()->counters()->turbo_escape_allocs_replaced()->Increment();
TRACE("Removed allocate #%d from effect chain\n", node->id());
return Changed(node);
}
@@ -327,40 +328,19 @@ Node* EscapeAnalysisReducer::ReduceStateValueInput(Node* node, int node_index,
}
-Counters* EscapeAnalysisReducer::counters() const {
- return jsgraph_->isolate()->counters();
-}
-
-
-class EscapeAnalysisVerifier final : public AdvancedReducer {
- public:
- EscapeAnalysisVerifier(Editor* editor, EscapeAnalysis* escape_analysis)
- : AdvancedReducer(editor), escape_analysis_(escape_analysis) {}
-
- Reduction Reduce(Node* node) final {
- switch (node->opcode()) {
- case IrOpcode::kAllocate:
- CHECK(!escape_analysis_->IsVirtual(node));
- break;
- default:
- break;
- }
- return NoChange();
- }
-
- private:
- EscapeAnalysis* escape_analysis_;
-};
-
void EscapeAnalysisReducer::VerifyReplacement() const {
#ifdef DEBUG
- GraphReducer graph_reducer(zone(), jsgraph()->graph());
- EscapeAnalysisVerifier verifier(&graph_reducer, escape_analysis());
- graph_reducer.AddReducer(&verifier);
- graph_reducer.ReduceGraph();
+ AllNodes all(zone(), jsgraph()->graph());
+ for (Node* node : all.live) {
+ if (node->opcode() == IrOpcode::kAllocate) {
+ CHECK(!escape_analysis_->IsVirtual(node));
+ }
+ }
#endif // DEBUG
}
+Isolate* EscapeAnalysisReducer::isolate() const { return jsgraph_->isolate(); }
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/escape-analysis-reducer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698