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