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 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 ASSERT(thread->compiler_stats()->IsCleared()); | 1681 ASSERT(thread->compiler_stats()->IsCleared()); |
1682 const Error& error = Error::Handle(zone, | 1682 const Error& error = Error::Handle(zone, |
1683 Compiler::CompileOptimizedFunction(thread, | 1683 Compiler::CompileOptimizedFunction(thread, |
1684 function, | 1684 function, |
1685 Compiler::kNoOSRDeoptId)); | 1685 Compiler::kNoOSRDeoptId)); |
1686 // TODO(srdjan): We do not expect errors while compiling optimized | 1686 // TODO(srdjan): We do not expect errors while compiling optimized |
1687 // code, any errors should have been caught when compiling | 1687 // code, any errors should have been caught when compiling |
1688 // unoptimized code. Any issues while optimizing are flagged by | 1688 // unoptimized code. Any issues while optimizing are flagged by |
1689 // making the result invalid. | 1689 // making the result invalid. |
1690 ASSERT(error.IsNull()); | 1690 ASSERT(error.IsNull()); |
1691 isolate->aggregate_compiler_stats()->Add(*thread->compiler_stats()); | 1691 // We cannot aggregate stats if isolate is shutting down. |
| 1692 if (isolate->HasMutatorThread()) { |
| 1693 isolate->aggregate_compiler_stats()->Add(*thread->compiler_stats()); |
| 1694 } |
1692 thread->compiler_stats()->Clear(); | 1695 thread->compiler_stats()->Clear(); |
1693 QueueElement* qelem = function_queue()->Remove(); | 1696 QueueElement* qelem = function_queue()->Remove(); |
1694 delete qelem; | 1697 delete qelem; |
1695 function = function_queue()->PeekFunction(); | 1698 function = function_queue()->PeekFunction(); |
1696 } | 1699 } |
1697 } | 1700 } |
1698 Thread::ExitIsolateAsHelper(); | 1701 Thread::ExitIsolateAsHelper(); |
1699 { | 1702 { |
1700 // Wait to be notified when the work queue is not empty. | 1703 // Wait to be notified when the work queue is not empty. |
1701 MonitorLocker ml(queue_monitor_); | 1704 MonitorLocker ml(queue_monitor_); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 } | 1905 } |
1903 | 1906 |
1904 | 1907 |
1905 void BackgroundCompiler::EnsureInit(Thread* thread) { | 1908 void BackgroundCompiler::EnsureInit(Thread* thread) { |
1906 UNREACHABLE(); | 1909 UNREACHABLE(); |
1907 } | 1910 } |
1908 | 1911 |
1909 #endif // DART_PRECOMPILED_RUNTIME | 1912 #endif // DART_PRECOMPILED_RUNTIME |
1910 | 1913 |
1911 } // namespace dart | 1914 } // namespace dart |
OLD | NEW |