OLD | NEW |
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 GraphReducer graph_reducer(&graph, local_zone_); | 353 GraphReducer graph_reducer(&graph, local_zone_); |
354 graph_reducer.AddReducer(&context_specializer); | 354 graph_reducer.AddReducer(&context_specializer); |
355 graph_reducer.ReduceGraph(); | 355 graph_reducer.ReduceGraph(); |
356 Inlinee::UnifyReturn(&jsgraph); | 356 Inlinee::UnifyReturn(&jsgraph); |
357 | 357 |
358 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone()); | 358 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone()); |
359 visitor.CopyGraph(); | 359 visitor.CopyGraph(); |
360 | 360 |
361 Inlinee inlinee(visitor.GetCopy(graph.start()), visitor.GetCopy(graph.end())); | 361 Inlinee inlinee(visitor.GetCopy(graph.start()), visitor.GetCopy(graph.end())); |
362 | 362 |
363 if (FLAG_turbo_deoptimization) { | 363 Node* outer_frame_state = call.frame_state(); |
364 Node* outer_frame_state = call.frame_state(); | 364 // Insert argument adaptor frame if required. |
365 // Insert argument adaptor frame if required. | 365 if (call.formal_arguments() != inlinee.formal_parameters()) { |
366 if (call.formal_arguments() != inlinee.formal_parameters()) { | 366 outer_frame_state = |
367 outer_frame_state = | 367 CreateArgumentsAdaptorFrameState(&call, function, info.zone()); |
368 CreateArgumentsAdaptorFrameState(&call, function, info.zone()); | 368 } |
369 } | |
370 | 369 |
371 for (Node* node : visitor.copies()) { | 370 for (Node* node : visitor.copies()) { |
372 if (node && node->opcode() == IrOpcode::kFrameState) { | 371 if (node && node->opcode() == IrOpcode::kFrameState) { |
373 DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op())); | 372 DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op())); |
374 AddClosureToFrameState(node, function); | 373 AddClosureToFrameState(node, function); |
375 NodeProperties::ReplaceFrameStateInput(node, 0, outer_frame_state); | 374 NodeProperties::ReplaceFrameStateInput(node, 0, outer_frame_state); |
376 } | |
377 } | 375 } |
378 } | 376 } |
379 | 377 |
380 return inlinee.InlineAtCall(jsgraph_, node); | 378 return inlinee.InlineAtCall(jsgraph_, node); |
381 } | 379 } |
382 | 380 |
383 } // namespace compiler | 381 } // namespace compiler |
384 } // namespace internal | 382 } // namespace internal |
385 } // namespace v8 | 383 } // namespace v8 |
OLD | NEW |