| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
| 8 #include "vm/block_scheduler.h" | 8 #include "vm/block_scheduler.h" |
| 9 #include "vm/branch_optimizer.h" | 9 #include "vm/branch_optimizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer); | 725 CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer); |
| 726 parsed_function = GetParsedFunction(function, &in_cache); | 726 parsed_function = GetParsedFunction(function, &in_cache); |
| 727 } | 727 } |
| 728 | 728 |
| 729 if (Compiler::IsBackgroundCompilation()) { | 729 if (Compiler::IsBackgroundCompilation()) { |
| 730 if (isolate->IsTopLevelParsing() || | 730 if (isolate->IsTopLevelParsing() || |
| 731 (loading_invalidation_gen_at_start != | 731 (loading_invalidation_gen_at_start != |
| 732 isolate->loading_invalidation_gen())) { | 732 isolate->loading_invalidation_gen())) { |
| 733 // Loading occured while parsing. We need to abort here because | 733 // Loading occured while parsing. We need to abort here because |
| 734 // state changed while compiling. | 734 // state changed while compiling. |
| 735 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); | 735 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId, |
| 736 "Loading occured while parsing in inliner"); |
| 736 } | 737 } |
| 737 } | 738 } |
| 738 | 739 |
| 739 // Load IC data for the callee. | 740 // Load IC data for the callee. |
| 740 ZoneGrowableArray<const ICData*>* ic_data_array = | 741 ZoneGrowableArray<const ICData*>* ic_data_array = |
| 741 new(Z) ZoneGrowableArray<const ICData*>(); | 742 new(Z) ZoneGrowableArray<const ICData*>(); |
| 742 const bool clone_ic_data = Compiler::IsBackgroundCompilation(); | 743 const bool clone_ic_data = Compiler::IsBackgroundCompilation(); |
| 743 function.RestoreICDataMap(ic_data_array, clone_ic_data); | 744 function.RestoreICDataMap(ic_data_array, clone_ic_data); |
| 744 if (Compiler::IsBackgroundCompilation() && | 745 if (Compiler::IsBackgroundCompilation() && |
| 745 (function.ic_data_array() == Array::null())) { | 746 (function.ic_data_array() == Array::null())) { |
| 746 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); | 747 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId, |
| 748 "ICData cleared while inlining"); |
| 747 } | 749 } |
| 748 | 750 |
| 749 // Build the callee graph. | 751 // Build the callee graph. |
| 750 InlineExitCollector* exit_collector = | 752 InlineExitCollector* exit_collector = |
| 751 new(Z) InlineExitCollector(caller_graph_, call); | 753 new(Z) InlineExitCollector(caller_graph_, call); |
| 752 FlowGraphBuilder builder(*parsed_function, | 754 FlowGraphBuilder builder(*parsed_function, |
| 753 *ic_data_array, | 755 *ic_data_array, |
| 754 exit_collector, | 756 exit_collector, |
| 755 Compiler::kNoOSRDeoptId); | 757 Compiler::kNoOSRDeoptId); |
| 756 builder.SetInitialBlockId(caller_graph_->max_block_id()); | 758 builder.SetInitialBlockId(caller_graph_->max_block_id()); |
| (...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3109 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last); | 3111 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last); |
| 3110 case MethodRecognizer::kDoubleDiv: | 3112 case MethodRecognizer::kDoubleDiv: |
| 3111 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last); | 3113 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last); |
| 3112 default: | 3114 default: |
| 3113 return false; | 3115 return false; |
| 3114 } | 3116 } |
| 3115 } | 3117 } |
| 3116 | 3118 |
| 3117 | 3119 |
| 3118 } // namespace dart | 3120 } // namespace dart |
| OLD | NEW |