| 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 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 queue_monitor_(new Monitor()), done_monitor_(new Monitor()), | 1747 queue_monitor_(new Monitor()), done_monitor_(new Monitor()), |
| 1748 function_queue_(new BackgroundCompilationQueue()) { | 1748 function_queue_(new BackgroundCompilationQueue()) { |
| 1749 *done_ = false; | 1749 *done_ = false; |
| 1750 } | 1750 } |
| 1751 | 1751 |
| 1752 | 1752 |
| 1753 void BackgroundCompiler::Run() { | 1753 void BackgroundCompiler::Run() { |
| 1754 while (running_) { | 1754 while (running_) { |
| 1755 // Maybe something is already in the queue, check first before waiting | 1755 // Maybe something is already in the queue, check first before waiting |
| 1756 // to be notified. | 1756 // to be notified. |
| 1757 Thread::EnterIsolateAsHelper(isolate_); | 1757 bool result = Thread::EnterIsolateAsHelper(isolate_); |
| 1758 ASSERT(result); |
| 1758 { | 1759 { |
| 1759 Thread* thread = Thread::Current(); | 1760 Thread* thread = Thread::Current(); |
| 1760 StackZone stack_zone(thread); | 1761 StackZone stack_zone(thread); |
| 1761 Zone* zone = stack_zone.GetZone(); | 1762 Zone* zone = stack_zone.GetZone(); |
| 1762 HANDLESCOPE(thread); | 1763 HANDLESCOPE(thread); |
| 1763 Function& function = Function::Handle(zone); | 1764 Function& function = Function::Handle(zone); |
| 1764 function = function_queue()->PeekFunction(); | 1765 function = function_queue()->PeekFunction(); |
| 1765 while (running_ && !function.IsNull()) { | 1766 while (running_ && !function.IsNull()) { |
| 1766 const Error& error = Error::Handle(zone, | 1767 const Error& error = Error::Handle(zone, |
| 1767 Compiler::CompileOptimizedFunction(thread, | 1768 Compiler::CompileOptimizedFunction(thread, |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 } | 1977 } |
| 1977 | 1978 |
| 1978 | 1979 |
| 1979 void BackgroundCompiler::EnsureInit(Thread* thread) { | 1980 void BackgroundCompiler::EnsureInit(Thread* thread) { |
| 1980 UNREACHABLE(); | 1981 UNREACHABLE(); |
| 1981 } | 1982 } |
| 1982 | 1983 |
| 1983 #endif // DART_PRECOMPILED | 1984 #endif // DART_PRECOMPILED |
| 1984 | 1985 |
| 1985 } // namespace dart | 1986 } // namespace dart |
| OLD | NEW |