OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 input_queue_semaphore_(OS::CreateSemaphore(0)), | 52 input_queue_semaphore_(OS::CreateSemaphore(0)), |
53 output_queue_semaphore_(OS::CreateSemaphore(0)), | 53 output_queue_semaphore_(OS::CreateSemaphore(0)), |
54 time_spent_compiling_(0), | 54 time_spent_compiling_(0), |
55 time_spent_total_(0) { | 55 time_spent_total_(0) { |
56 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false)); | 56 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(false)); |
57 NoBarrier_Store(&queue_length_, static_cast<AtomicWord>(0)); | 57 NoBarrier_Store(&queue_length_, static_cast<AtomicWord>(0)); |
58 } | 58 } |
59 | 59 |
60 void Run(); | 60 void Run(); |
61 void Stop(); | 61 void Stop(); |
| 62 void CompileNext(); |
62 void QueueForOptimization(OptimizingCompiler* optimizing_compiler); | 63 void QueueForOptimization(OptimizingCompiler* optimizing_compiler); |
63 void InstallOptimizedFunctions(); | 64 void InstallOptimizedFunctions(); |
64 | 65 |
65 // Wait for the next optimized function and install it. | 66 // Wait for the next optimized function and install it. |
66 Handle<SharedFunctionInfo> InstallNextOptimizedFunction(); | 67 Handle<SharedFunctionInfo> InstallNextOptimizedFunction(); |
67 | 68 |
68 inline bool IsQueueAvailable() { | 69 inline bool IsQueueAvailable() { |
69 // We don't need a barrier since we have a data dependency right | 70 // We don't need a barrier since we have a data dependency right |
70 // after. | 71 // after. |
71 Atomic32 current_length = NoBarrier_Load(&queue_length_); | 72 Atomic32 current_length = NoBarrier_Load(&queue_length_); |
(...skipping 30 matching lines...) Expand all Loading... |
102 UnboundQueue<OptimizingCompiler*> output_queue_; | 103 UnboundQueue<OptimizingCompiler*> output_queue_; |
103 volatile AtomicWord stop_thread_; | 104 volatile AtomicWord stop_thread_; |
104 volatile Atomic32 queue_length_; | 105 volatile Atomic32 queue_length_; |
105 int64_t time_spent_compiling_; | 106 int64_t time_spent_compiling_; |
106 int64_t time_spent_total_; | 107 int64_t time_spent_total_; |
107 }; | 108 }; |
108 | 109 |
109 } } // namespace v8::internal | 110 } } // namespace v8::internal |
110 | 111 |
111 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ | 112 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ |
OLD | NEW |