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 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 } | 1609 } |
1610 } | 1610 } |
1611 | 1611 |
1612 bool IsEmpty() const { return first_ == NULL; } | 1612 bool IsEmpty() const { return first_ == NULL; } |
1613 | 1613 |
1614 void Add(QueueElement* value) { | 1614 void Add(QueueElement* value) { |
1615 ASSERT(value != NULL); | 1615 ASSERT(value != NULL); |
1616 if (first_ == NULL) { | 1616 if (first_ == NULL) { |
1617 first_ = value; | 1617 first_ = value; |
1618 } else { | 1618 } else { |
| 1619 ASSERT(last_ != NULL); |
1619 last_->set_next(value); | 1620 last_->set_next(value); |
1620 } | 1621 } |
1621 value->set_next(NULL); | 1622 value->set_next(NULL); |
1622 last_ = value; | 1623 last_ = value; |
1623 } | 1624 } |
1624 | 1625 |
1625 QueueElement* Peek() const { | 1626 QueueElement* Peek() const { |
1626 return first_; | 1627 return first_; |
1627 } | 1628 } |
1628 | 1629 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 MonitorLocker ml_done(done_monitor_); | 1726 MonitorLocker ml_done(done_monitor_); |
1726 *done_ = true; | 1727 *done_ = true; |
1727 ml_done.Notify(); | 1728 ml_done.Notify(); |
1728 } | 1729 } |
1729 } | 1730 } |
1730 | 1731 |
1731 | 1732 |
1732 void BackgroundCompiler::CompileOptimized(const Function& function) { | 1733 void BackgroundCompiler::CompileOptimized(const Function& function) { |
1733 ASSERT(Thread::Current()->IsMutatorThread()); | 1734 ASSERT(Thread::Current()->IsMutatorThread()); |
1734 MonitorLocker ml(queue_monitor_); | 1735 MonitorLocker ml(queue_monitor_); |
| 1736 ASSERT(running_); |
1735 if (function_queue()->ContainsObj(function)) { | 1737 if (function_queue()->ContainsObj(function)) { |
1736 return; | 1738 return; |
1737 } | 1739 } |
1738 QueueElement* elem = new QueueElement(function); | 1740 QueueElement* elem = new QueueElement(function); |
1739 function_queue()->Add(elem); | 1741 function_queue()->Add(elem); |
1740 ml.Notify(); | 1742 ml.Notify(); |
1741 } | 1743 } |
1742 | 1744 |
1743 | 1745 |
1744 void BackgroundCompiler::VisitPointers(ObjectPointerVisitor* visitor) { | 1746 void BackgroundCompiler::VisitPointers(ObjectPointerVisitor* visitor) { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 } | 1921 } |
1920 | 1922 |
1921 | 1923 |
1922 void BackgroundCompiler::EnsureInit(Thread* thread) { | 1924 void BackgroundCompiler::EnsureInit(Thread* thread) { |
1923 UNREACHABLE(); | 1925 UNREACHABLE(); |
1924 } | 1926 } |
1925 | 1927 |
1926 #endif // DART_PRECOMPILED_RUNTIME | 1928 #endif // DART_PRECOMPILED_RUNTIME |
1927 | 1929 |
1928 } // namespace dart | 1930 } // namespace dart |
OLD | NEW |