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

Side by Side Diff: src/compiler/escape-analysis.cc

Issue 2578133002: [turbofan] fixed escape analysis bug: missing copy of virtual state (Closed)
Patch Set: addressed comments 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 | « no previous file | test/mjsunit/compiler/escape-analysis-framestate-use-at-branchpoint.js » ('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/escape-analysis.h" 5 #include "src/compiler/escape-analysis.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/flags.h" 9 #include "src/base/flags.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 case IrOpcode::kEffectPhi: 1076 case IrOpcode::kEffectPhi:
1077 return ProcessEffectPhi(node); 1077 return ProcessEffectPhi(node);
1078 break; 1078 break;
1079 default: 1079 default:
1080 if (node->op()->EffectInputCount() > 0) { 1080 if (node->op()->EffectInputCount() > 0) {
1081 ForwardVirtualState(node); 1081 ForwardVirtualState(node);
1082 } 1082 }
1083 ProcessAllocationUsers(node); 1083 ProcessAllocationUsers(node);
1084 break; 1084 break;
1085 } 1085 }
1086 if (OperatorProperties::HasFrameStateInput(node->op())) {
1087 virtual_states_[node->id()]->SetCopyRequired();
1088 }
1086 return true; 1089 return true;
1087 } 1090 }
1088 1091
1089 void EscapeAnalysis::ProcessAllocationUsers(Node* node) { 1092 void EscapeAnalysis::ProcessAllocationUsers(Node* node) {
1090 for (Edge edge : node->input_edges()) { 1093 for (Edge edge : node->input_edges()) {
1091 Node* input = edge.to(); 1094 Node* input = edge.to();
1092 Node* use = edge.from(); 1095 Node* use = edge.from();
1093 if (edge.index() >= use->op()->ValueInputCount() + 1096 if (edge.index() >= use->op()->ValueInputCount() +
1094 OperatorProperties::GetContextInputCount(use->op())) 1097 OperatorProperties::GetContextInputCount(use->op()))
1095 continue; 1098 continue;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 DCHECK_NOT_NULL(virtual_states_[effect->id()]); 1172 DCHECK_NOT_NULL(virtual_states_[effect->id()]);
1170 if (virtual_states_[node->id()]) { 1173 if (virtual_states_[node->id()]) {
1171 virtual_states_[node->id()]->UpdateFrom(virtual_states_[effect->id()], 1174 virtual_states_[node->id()]->UpdateFrom(virtual_states_[effect->id()],
1172 zone()); 1175 zone());
1173 } else { 1176 } else {
1174 virtual_states_[node->id()] = virtual_states_[effect->id()]; 1177 virtual_states_[node->id()] = virtual_states_[effect->id()];
1175 TRACE("Forwarding object state %p from %s#%d to %s#%d", 1178 TRACE("Forwarding object state %p from %s#%d to %s#%d",
1176 static_cast<void*>(virtual_states_[effect->id()]), 1179 static_cast<void*>(virtual_states_[effect->id()]),
1177 effect->op()->mnemonic(), effect->id(), node->op()->mnemonic(), 1180 effect->op()->mnemonic(), effect->id(), node->op()->mnemonic(),
1178 node->id()); 1181 node->id());
1179 if (status_analysis_->IsEffectBranchPoint(effect) || 1182 if (status_analysis_->IsEffectBranchPoint(effect)) {
1180 OperatorProperties::HasFrameStateInput(node->op())) {
1181 virtual_states_[node->id()]->SetCopyRequired(); 1183 virtual_states_[node->id()]->SetCopyRequired();
1182 TRACE(", effect input %s#%d is branch point", effect->op()->mnemonic(), 1184 TRACE(", effect input %s#%d is branch point", effect->op()->mnemonic(),
1183 effect->id()); 1185 effect->id());
1184 } 1186 }
1185 TRACE("\n"); 1187 TRACE("\n");
1186 } 1188 }
1187 } 1189 }
1188 1190
1189 void EscapeAnalysis::ProcessStart(Node* node) { 1191 void EscapeAnalysis::ProcessStart(Node* node) {
1190 DCHECK_EQ(node->opcode(), IrOpcode::kStart); 1192 DCHECK_EQ(node->opcode(), IrOpcode::kStart);
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 } 1687 }
1686 } 1688 }
1687 return false; 1689 return false;
1688 } 1690 }
1689 1691
1690 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } 1692 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); }
1691 1693
1692 } // namespace compiler 1694 } // namespace compiler
1693 } // namespace internal 1695 } // namespace internal
1694 } // namespace v8 1696 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/escape-analysis-framestate-use-at-branchpoint.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698