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/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 } else { | 542 } else { |
543 TRACE( | 543 TRACE( |
544 "Inlining %s into %s regardless of surrounding try-block to catcher " | 544 "Inlining %s into %s regardless of surrounding try-block to catcher " |
545 "#%d:%s\n", | 545 "#%d:%s\n", |
546 shared_info->DebugName()->ToCString().get(), | 546 shared_info->DebugName()->ToCString().get(), |
547 info_->shared_info()->DebugName()->ToCString().get(), | 547 info_->shared_info()->DebugName()->ToCString().get(), |
548 exception_target->id(), exception_target->op()->mnemonic()); | 548 exception_target->id(), exception_target->op()->mnemonic()); |
549 } | 549 } |
550 } | 550 } |
551 | 551 |
552 Zone zone(info_->isolate()->allocator(), ZONE_NAME); | 552 ParseInfo parse_info(shared_info); |
553 ParseInfo parse_info(&zone, shared_info); | |
554 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); | 553 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); |
555 if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled(); | 554 if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled(); |
556 info.MarkAsOptimizeFromBytecode(); | 555 info.MarkAsOptimizeFromBytecode(); |
557 | 556 |
558 if (!Compiler::EnsureBytecode(&info)) { | 557 if (!Compiler::EnsureBytecode(&info)) { |
559 TRACE("Not inlining %s into %s because bytecode generation failed\n", | 558 TRACE("Not inlining %s into %s because bytecode generation failed\n", |
560 shared_info->DebugName()->ToCString().get(), | 559 shared_info->DebugName()->ToCString().get(), |
561 info_->shared_info()->DebugName()->ToCString().get()); | 560 info_->shared_info()->DebugName()->ToCString().get()); |
562 if (info_->isolate()->has_pending_exception()) { | 561 if (info_->isolate()->has_pending_exception()) { |
563 info_->isolate()->clear_pending_exception(); | 562 info_->isolate()->clear_pending_exception(); |
(...skipping 20 matching lines...) Expand all Loading... |
584 Handle<TypeFeedbackVector> feedback_vector; | 583 Handle<TypeFeedbackVector> feedback_vector; |
585 DetermineCallContext(node, context, feedback_vector); | 584 DetermineCallContext(node, context, feedback_vector); |
586 | 585 |
587 // Create the subgraph for the inlinee. | 586 // Create the subgraph for the inlinee. |
588 Node* start; | 587 Node* start; |
589 Node* end; | 588 Node* end; |
590 { | 589 { |
591 // Run the BytecodeGraphBuilder to create the subgraph. | 590 // Run the BytecodeGraphBuilder to create the subgraph. |
592 Graph::SubgraphScope scope(graph()); | 591 Graph::SubgraphScope scope(graph()); |
593 BytecodeGraphBuilder graph_builder( | 592 BytecodeGraphBuilder graph_builder( |
594 &zone, shared_info, feedback_vector, BailoutId::None(), jsgraph(), | 593 parse_info.zone(), shared_info, feedback_vector, BailoutId::None(), |
595 call.frequency(), source_positions_, inlining_id); | 594 jsgraph(), call.frequency(), source_positions_, inlining_id); |
596 graph_builder.CreateGraph(false); | 595 graph_builder.CreateGraph(false); |
597 | 596 |
598 // Extract the inlinee start/end nodes. | 597 // Extract the inlinee start/end nodes. |
599 start = graph()->start(); | 598 start = graph()->start(); |
600 end = graph()->end(); | 599 end = graph()->end(); |
601 } | 600 } |
602 | 601 |
603 if (exception_target != nullptr) { | 602 if (exception_target != nullptr) { |
604 // Find all uncaught 'calls' in the inlinee. | 603 // Find all uncaught 'calls' in the inlinee. |
605 AllNodes inlined_nodes(local_zone_, end, graph()); | 604 AllNodes inlined_nodes(local_zone_, end, graph()); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 | 725 |
727 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } | 726 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
728 | 727 |
729 SimplifiedOperatorBuilder* JSInliner::simplified() const { | 728 SimplifiedOperatorBuilder* JSInliner::simplified() const { |
730 return jsgraph()->simplified(); | 729 return jsgraph()->simplified(); |
731 } | 730 } |
732 | 731 |
733 } // namespace compiler | 732 } // namespace compiler |
734 } // namespace internal | 733 } // namespace internal |
735 } // namespace v8 | 734 } // namespace v8 |
OLD | NEW |