| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 | 594 |
| 595 // TimerScope needs an isolate to be properly terminated in case of a | 595 // TimerScope needs an isolate to be properly terminated in case of a |
| 596 // LongJump. | 596 // LongJump. |
| 597 { | 597 { |
| 598 CSTAT_TIMER_SCOPE(thread(), graphbuilder_timer); | 598 CSTAT_TIMER_SCOPE(thread(), graphbuilder_timer); |
| 599 ZoneGrowableArray<const ICData*>* ic_data_array = | 599 ZoneGrowableArray<const ICData*>* ic_data_array = |
| 600 new(zone) ZoneGrowableArray<const ICData*>(); | 600 new(zone) ZoneGrowableArray<const ICData*>(); |
| 601 if (optimized()) { | 601 if (optimized()) { |
| 602 // Extract type feedback before the graph is built, as the graph | 602 // Extract type feedback before the graph is built, as the graph |
| 603 // builder uses it to attach it to nodes. | 603 // builder uses it to attach it to nodes. |
| 604 ASSERT(function.deoptimization_counter() < | 604 |
| 605 FLAG_max_deoptimization_counter_threshold); | 605 // In background compilation the deoptimization counter may have |
| 606 // already reached the limit. |
| 607 ASSERT(Compiler::IsBackgroundCompilation() || |
| 608 function.deoptimization_counter() < |
| 609 FLAG_max_deoptimization_counter_threshold); |
| 606 | 610 |
| 607 // 'Freeze' ICData in background compilation so that it does not | 611 // 'Freeze' ICData in background compilation so that it does not |
| 608 // change while compiling. | 612 // change while compiling. |
| 609 const bool clone_ic_data = Compiler::IsBackgroundCompilation(); | 613 const bool clone_ic_data = Compiler::IsBackgroundCompilation(); |
| 610 function.RestoreICDataMap(ic_data_array, clone_ic_data); | 614 function.RestoreICDataMap(ic_data_array, clone_ic_data); |
| 611 | 615 |
| 612 if (Compiler::IsBackgroundCompilation() && | 616 if (Compiler::IsBackgroundCompilation() && |
| 613 (function.ic_data_array() == Array::null())) { | 617 (function.ic_data_array() == Array::null())) { |
| 614 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); | 618 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); |
| 615 } | 619 } |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 } | 1892 } |
| 1889 | 1893 |
| 1890 | 1894 |
| 1891 void BackgroundCompiler::EnsureInit(Thread* thread) { | 1895 void BackgroundCompiler::EnsureInit(Thread* thread) { |
| 1892 UNREACHABLE(); | 1896 UNREACHABLE(); |
| 1893 } | 1897 } |
| 1894 | 1898 |
| 1895 #endif // DART_PRECOMPILED_RUNTIME | 1899 #endif // DART_PRECOMPILED_RUNTIME |
| 1896 | 1900 |
| 1897 } // namespace dart | 1901 } // namespace dart |
| OLD | NEW |