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

Side by Side Diff: src/compiler/js-graph.cc

Issue 2006353003: [turbofan] Avoid unnecessary copying of nodes during inlining. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't use one EmptyFrameState cross functions, that gets mutated during inlining. 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-graph.h ('k') | src/compiler/js-inlining.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/typer.h" 8 #include "src/compiler/typer.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 216
217 Node* JSGraph::ExternalConstant(Runtime::FunctionId function_id) { 217 Node* JSGraph::ExternalConstant(Runtime::FunctionId function_id) {
218 return ExternalConstant(ExternalReference(function_id, isolate())); 218 return ExternalConstant(ExternalReference(function_id, isolate()));
219 } 219 }
220 220
221 221
222 Node* JSGraph::EmptyFrameState() { 222 Node* JSGraph::EmptyFrameState() {
223 Node* empty_frame_state = cached_nodes_[kEmptyFrameState]; 223 Node* empty_frame_state = cached_nodes_[kEmptyFrameState];
224 if (!empty_frame_state || empty_frame_state->IsDead()) { 224 if (!empty_frame_state || empty_frame_state->IsDead()) {
225 Node* state_values = graph()->NewNode(common()->StateValues(0));
226 empty_frame_state = graph()->NewNode( 225 empty_frame_state = graph()->NewNode(
227 common()->FrameState(BailoutId::None(), 226 common()->FrameState(BailoutId::None(),
228 OutputFrameStateCombine::Ignore(), nullptr), 227 OutputFrameStateCombine::Ignore(), nullptr),
229 state_values, state_values, state_values, NoContextConstant(), 228 EmptyStateValues(), EmptyStateValues(), EmptyStateValues(),
230 UndefinedConstant(), graph()->start()); 229 NoContextConstant(), UndefinedConstant(), graph()->start());
231 cached_nodes_[kEmptyFrameState] = empty_frame_state; 230 cached_nodes_[kEmptyFrameState] = empty_frame_state;
232 } 231 }
233 return empty_frame_state; 232 return empty_frame_state;
234 } 233 }
235 234
235 Node* JSGraph::EmptyStateValues() {
236 return CACHED(kEmptyStateValues, graph()->NewNode(common()->StateValues(0)));
237 }
236 238
237 Node* JSGraph::Dead() { 239 Node* JSGraph::Dead() {
238 return CACHED(kDead, graph()->NewNode(common()->Dead())); 240 return CACHED(kDead, graph()->NewNode(common()->Dead()));
239 } 241 }
240 242
241 243
242 void JSGraph::GetCachedNodes(NodeVector* nodes) { 244 void JSGraph::GetCachedNodes(NodeVector* nodes) {
243 cache_.GetCachedNodes(nodes); 245 cache_.GetCachedNodes(nodes);
244 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { 246 for (size_t i = 0; i < arraysize(cached_nodes_); i++) {
245 if (Node* node = cached_nodes_[i]) { 247 if (Node* node = cached_nodes_[i]) {
246 if (!node->IsDead()) nodes->push_back(node); 248 if (!node->IsDead()) nodes->push_back(node);
247 } 249 }
248 } 250 }
249 } 251 }
250 252
251 } // namespace compiler 253 } // namespace compiler
252 } // namespace internal 254 } // namespace internal
253 } // namespace v8 255 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-graph.h ('k') | src/compiler/js-inlining.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698