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

Unified Diff: src/compiler/js-graph.cc

Issue 1101273002: [turbofan] Ignore dead cached nodes in the JSGraph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | test/mjsunit/regress/regress-crbug-480807.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-graph.cc
diff --git a/src/compiler/js-graph.cc b/src/compiler/js-graph.cc
index 8171f1b9a808a6fe72d9997c556db411ce78b8ed..9363268513a034d0304870243ee8b942afb3a004 100644
--- a/src/compiler/js-graph.cc
+++ b/src/compiler/js-graph.cc
@@ -184,15 +184,17 @@ Node* JSGraph::ExternalConstant(ExternalReference reference) {
Node* JSGraph::EmptyFrameState() {
- if (cached_nodes_[kEmptyFrameState] == nullptr) {
- Node* values = graph()->NewNode(common()->StateValues(0));
- Node* state_node = graph()->NewNode(
+ Node* empty_frame_state = cached_nodes_[kEmptyFrameState];
+ if (!empty_frame_state || empty_frame_state->IsDead()) {
+ Node* state_values = graph()->NewNode(common()->StateValues(0));
+ empty_frame_state = graph()->NewNode(
common()->FrameState(JS_FRAME, BailoutId::None(),
OutputFrameStateCombine::Ignore()),
- values, values, values, NoContextConstant(), UndefinedConstant());
- cached_nodes_[kEmptyFrameState] = state_node;
+ state_values, state_values, state_values, NoContextConstant(),
+ UndefinedConstant());
+ cached_nodes_[kEmptyFrameState] = empty_frame_state;
}
- return cached_nodes_[kEmptyFrameState];
+ return empty_frame_state;
}
@@ -204,7 +206,9 @@ Node* JSGraph::DeadControl() {
void JSGraph::GetCachedNodes(NodeVector* nodes) {
cache_.GetCachedNodes(nodes);
for (size_t i = 0; i < arraysize(cached_nodes_); i++) {
- if (cached_nodes_[i]) nodes->push_back(cached_nodes_[i]);
+ if (Node* node = cached_nodes_[i]) {
+ if (!node->IsDead()) nodes->push_back(node);
+ }
}
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-480807.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698