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

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

Issue 1168693002: [turbofan] Allow ReplaceWithValue to kill control. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 6 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/graph-reducer.cc ('k') | src/compiler/pipeline.cc » ('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/compiler/js-inlining.h" 5 #include "src/compiler/js-inlining.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/compiler/all-nodes.h" 9 #include "src/compiler/all-nodes.h"
10 #include "src/compiler/ast-graph-builder.h" 10 #include "src/compiler/ast-graph-builder.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 JSGraph jsgraph(info.isolate(), &graph, jsgraph_->common(), 270 JSGraph jsgraph(info.isolate(), &graph, jsgraph_->common(),
271 jsgraph_->javascript(), jsgraph_->machine()); 271 jsgraph_->javascript(), jsgraph_->machine());
272 272
273 // The inlinee specializes to the context from the JSFunction object. 273 // The inlinee specializes to the context from the JSFunction object.
274 // TODO(turbofan): We might want to load the context from the JSFunction at 274 // TODO(turbofan): We might want to load the context from the JSFunction at
275 // runtime in case we only know the SharedFunctionInfo once we have dynamic 275 // runtime in case we only know the SharedFunctionInfo once we have dynamic
276 // type feedback in the compiler. 276 // type feedback in the compiler.
277 AstGraphBuilder graph_builder(local_zone_, &info, &jsgraph); 277 AstGraphBuilder graph_builder(local_zone_, &info, &jsgraph);
278 graph_builder.CreateGraph(true, false); 278 graph_builder.CreateGraph(true, false);
279 JSContextSpecializer context_specializer(&jsgraph); 279 JSContextSpecializer context_specializer(&jsgraph);
280 GraphReducer graph_reducer(&graph, local_zone_); 280 GraphReducer graph_reducer(local_zone_, &graph);
281 graph_reducer.AddReducer(&context_specializer); 281 graph_reducer.AddReducer(&context_specializer);
282 graph_reducer.ReduceGraph(); 282 graph_reducer.ReduceGraph();
283 283
284 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone()); 284 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone());
285 visitor.CopyGraph(); 285 visitor.CopyGraph();
286 286
287 Node* start = visitor.GetCopy(graph.start()); 287 Node* start = visitor.GetCopy(graph.start());
288 Node* end = visitor.GetCopy(graph.end()); 288 Node* end = visitor.GetCopy(graph.end());
289 289
290 Node* frame_state = call.frame_state(); 290 Node* frame_state = call.frame_state();
291 size_t const inlinee_formal_parameters = start->op()->ValueOutputCount() - 3; 291 size_t const inlinee_formal_parameters = start->op()->ValueOutputCount() - 3;
292 // Insert argument adaptor frame if required. 292 // Insert argument adaptor frame if required.
293 if (call.formal_arguments() != inlinee_formal_parameters) { 293 if (call.formal_arguments() != inlinee_formal_parameters) {
294 // In strong mode, in case of too few arguments we need to throw a 294 // In strong mode, in case of too few arguments we need to throw a
295 // TypeError so we must not inline this call. 295 // TypeError so we must not inline this call.
296 if (is_strong(info.language_mode()) && 296 if (is_strong(info.language_mode()) &&
297 call.formal_arguments() < inlinee_formal_parameters) { 297 call.formal_arguments() < inlinee_formal_parameters) {
298 return NoChange(); 298 return NoChange();
299 } 299 }
300 frame_state = CreateArgumentsAdaptorFrameState(&call, info.zone()); 300 frame_state = CreateArgumentsAdaptorFrameState(&call, info.zone());
301 } 301 }
302 302
303 return InlineCall(node, frame_state, start, end); 303 return InlineCall(node, frame_state, start, end);
304 } 304 }
305 305
306 } // namespace compiler 306 } // namespace compiler
307 } // namespace internal 307 } // namespace internal
308 } // namespace v8 308 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/graph-reducer.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698