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 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 while (!function.IsNull() && running_) { | 1483 while (!function.IsNull() && running_) { |
1484 const Error& error = Error::Handle(zone, | 1484 const Error& error = Error::Handle(zone, |
1485 Compiler::CompileOptimizedFunction(thread, function)); | 1485 Compiler::CompileOptimizedFunction(thread, function)); |
1486 // TODO(srdjan): We do not expect errors while compiling optimized | 1486 // TODO(srdjan): We do not expect errors while compiling optimized |
1487 // code, any errors should have been caught when compiling | 1487 // code, any errors should have been caught when compiling |
1488 // unoptimized code. | 1488 // unoptimized code. |
1489 // If it still happens mark function as not optimizable. | 1489 // If it still happens mark function as not optimizable. |
1490 ASSERT(error.IsNull()); | 1490 ASSERT(error.IsNull()); |
1491 temp_function = RemoveOrNull(); | 1491 temp_function = RemoveOrNull(); |
1492 ASSERT(temp_function.raw() == function.raw()); | 1492 ASSERT(temp_function.raw() == function.raw()); |
| 1493 // Reset to 0 so that it can be recompiled if needed. |
| 1494 function.set_usage_counter(0); |
1493 function = LastOrNull(); | 1495 function = LastOrNull(); |
1494 } | 1496 } |
1495 } | 1497 } |
1496 Thread::ExitIsolateAsHelper(); | 1498 Thread::ExitIsolateAsHelper(); |
1497 { | 1499 { |
1498 // Wait to be notified when the work queue is not empty. | 1500 // Wait to be notified when the work queue is not empty. |
1499 MonitorLocker ml(queue_monitor_); | 1501 MonitorLocker ml(queue_monitor_); |
1500 while ((queue_length() == 0) && running_) { | 1502 while ((queue_length() == 0) && running_) { |
1501 ml.Wait(); | 1503 ml.Wait(); |
1502 } | 1504 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 thread->zone(), GrowableObjectArray::New())); | 1583 thread->zone(), GrowableObjectArray::New())); |
1582 start_task = true; | 1584 start_task = true; |
1583 } | 1585 } |
1584 } | 1586 } |
1585 if (start_task) { | 1587 if (start_task) { |
1586 Dart::thread_pool()->Run(isolate->background_compiler()); | 1588 Dart::thread_pool()->Run(isolate->background_compiler()); |
1587 } | 1589 } |
1588 } | 1590 } |
1589 | 1591 |
1590 } // namespace dart | 1592 } // namespace dart |
OLD | NEW |