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/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); | 350 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); |
351 PrintF("Inlining %s into %s\n", name.get(), | 351 PrintF("Inlining %s into %s\n", name.get(), |
352 info_->shared_info()->DebugName()->ToCString().get()); | 352 info_->shared_info()->DebugName()->ToCString().get()); |
353 } | 353 } |
354 | 354 |
355 Graph graph(info.zone()); | 355 Graph graph(info.zone()); |
356 JSGraph jsgraph(info.isolate(), &graph, jsgraph_->common(), | 356 JSGraph jsgraph(info.isolate(), &graph, jsgraph_->common(), |
357 jsgraph_->javascript(), jsgraph_->machine()); | 357 jsgraph_->javascript(), jsgraph_->machine()); |
358 | 358 |
359 AstGraphBuilder graph_builder(local_zone_, &info, &jsgraph); | 359 AstGraphBuilder graph_builder(local_zone_, &info, &jsgraph); |
360 graph_builder.CreateGraph(false); | 360 graph_builder.CreateGraph(false, false); |
361 Inlinee::UnifyReturn(&jsgraph); | 361 Inlinee::UnifyReturn(&jsgraph); |
362 | 362 |
363 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone()); | 363 CopyVisitor visitor(&graph, jsgraph_->graph(), info.zone()); |
364 visitor.CopyGraph(); | 364 visitor.CopyGraph(); |
365 | 365 |
366 Inlinee inlinee(visitor.GetCopy(graph.start()), visitor.GetCopy(graph.end())); | 366 Inlinee inlinee(visitor.GetCopy(graph.start()), visitor.GetCopy(graph.end())); |
367 | 367 |
368 if (FLAG_turbo_deoptimization) { | 368 if (FLAG_turbo_deoptimization) { |
369 Node* outer_frame_state = call.frame_state(); | 369 Node* outer_frame_state = call.frame_state(); |
370 // Insert argument adaptor frame if required. | 370 // Insert argument adaptor frame if required. |
371 if (call.formal_arguments() != inlinee.formal_parameters()) { | 371 if (call.formal_arguments() != inlinee.formal_parameters()) { |
372 outer_frame_state = | 372 outer_frame_state = |
373 CreateArgumentsAdaptorFrameState(&call, function, info.zone()); | 373 CreateArgumentsAdaptorFrameState(&call, function, info.zone()); |
374 } | 374 } |
375 | 375 |
376 for (Node* node : visitor.copies()) { | 376 for (Node* node : visitor.copies()) { |
377 if (node && node->opcode() == IrOpcode::kFrameState) { | 377 if (node && node->opcode() == IrOpcode::kFrameState) { |
378 AddClosureToFrameState(node, function); | 378 AddClosureToFrameState(node, function); |
379 NodeProperties::ReplaceFrameStateInput(node, outer_frame_state); | 379 NodeProperties::ReplaceFrameStateInput(node, outer_frame_state); |
380 } | 380 } |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 return inlinee.InlineAtCall(jsgraph_, node); | 384 return inlinee.InlineAtCall(jsgraph_, node); |
385 } | 385 } |
386 | 386 |
387 } // namespace compiler | 387 } // namespace compiler |
388 } // namespace internal | 388 } // namespace internal |
389 } // namespace v8 | 389 } // namespace v8 |
OLD | NEW |