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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
687 } | 687 } |
688 | 688 |
689 // Save and clear deopt id. | 689 // Save and clear deopt id. |
690 const intptr_t prev_deopt_id = thread()->deopt_id(); | 690 const intptr_t prev_deopt_id = thread()->deopt_id(); |
691 thread()->set_deopt_id(0); | 691 thread()->set_deopt_id(0); |
692 Error& error = Error::Handle(); | 692 Error& error = Error::Handle(); |
693 { | 693 { |
694 // Install bailout jump. | 694 // Install bailout jump. |
695 LongJumpScope jump; | 695 LongJumpScope jump; |
696 if (setjmp(*jump.Set()) == 0) { | 696 if (setjmp(*jump.Set()) == 0) { |
697 Isolate* isolate = Isolate::Current(); | |
698 // Makes sure no classes are loaded during parsing in background. | |
699 const uint32_t loading_invalidation_gen_at_start = | |
700 isolate->loading_invalidation_gen(); | |
697 // Parse the callee function. | 701 // Parse the callee function. |
698 bool in_cache; | 702 bool in_cache; |
699 ParsedFunction* parsed_function; | 703 ParsedFunction* parsed_function; |
700 { | 704 { |
701 CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer); | 705 CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer); |
702 parsed_function = GetParsedFunction(function, &in_cache); | 706 parsed_function = GetParsedFunction(function, &in_cache); |
703 } | 707 } |
704 | 708 |
709 if (Compiler::IsBackgroundCompilation()) { | |
710 if (isolate->top_level_parsing() || | |
siva
2016/03/28 17:20:14
This value is set in the mutator thread and access
srdjan
2016/03/28 19:54:54
dito
| |
711 (loading_invalidation_gen_at_start != | |
712 isolate->loading_invalidation_gen())) { | |
713 // Loading occured while parsing. We need to abort here because | |
714 // state changed while compiling. | |
715 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); | |
716 } | |
717 } | |
718 | |
705 // Load IC data for the callee. | 719 // Load IC data for the callee. |
706 ZoneGrowableArray<const ICData*>* ic_data_array = | 720 ZoneGrowableArray<const ICData*>* ic_data_array = |
707 new(Z) ZoneGrowableArray<const ICData*>(); | 721 new(Z) ZoneGrowableArray<const ICData*>(); |
708 const bool clone_ic_data = Compiler::IsBackgroundCompilation(); | 722 const bool clone_ic_data = Compiler::IsBackgroundCompilation(); |
709 function.RestoreICDataMap(ic_data_array, clone_ic_data); | 723 function.RestoreICDataMap(ic_data_array, clone_ic_data); |
710 if (Compiler::IsBackgroundCompilation() && | 724 if (Compiler::IsBackgroundCompilation() && |
711 (function.ic_data_array() == Array::null())) { | 725 (function.ic_data_array() == Array::null())) { |
712 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); | 726 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); |
713 } | 727 } |
714 | 728 |
(...skipping 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3073 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last); | 3087 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last); |
3074 case MethodRecognizer::kDoubleDiv: | 3088 case MethodRecognizer::kDoubleDiv: |
3075 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last); | 3089 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last); |
3076 default: | 3090 default: |
3077 return false; | 3091 return false; |
3078 } | 3092 } |
3079 } | 3093 } |
3080 | 3094 |
3081 | 3095 |
3082 } // namespace dart | 3096 } // namespace dart |
OLD | NEW |