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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 OptimizingCompiler* compiler = NULL; | 128 OptimizingCompiler* compiler = NULL; |
129 output_queue_.Dequeue(&compiler); | 129 output_queue_.Dequeue(&compiler); |
130 Handle<SharedFunctionInfo> shared = compiler->info()->shared_info(); | 130 Handle<SharedFunctionInfo> shared = compiler->info()->shared_info(); |
131 Compiler::InstallOptimizedCode(compiler); | 131 Compiler::InstallOptimizedCode(compiler); |
132 return shared; | 132 return shared; |
133 } | 133 } |
134 | 134 |
135 | 135 |
136 void OptimizingCompilerThread::QueueForOptimization( | 136 void OptimizingCompilerThread::QueueForOptimization( |
137 OptimizingCompiler* optimizing_compiler) { | 137 OptimizingCompiler* optimizing_compiler) { |
| 138 ASSERT(IsQueueAvailable()); |
| 139 Barrier_AtomicIncrement(&queue_length_, static_cast<Atomic32>(1)); |
138 input_queue_.Enqueue(optimizing_compiler); | 140 input_queue_.Enqueue(optimizing_compiler); |
139 input_queue_semaphore_->Signal(); | 141 input_queue_semaphore_->Signal(); |
140 } | 142 } |
141 | 143 |
142 #ifdef DEBUG | 144 #ifdef DEBUG |
143 bool OptimizingCompilerThread::IsOptimizerThread() { | 145 bool OptimizingCompilerThread::IsOptimizerThread() { |
144 if (!FLAG_parallel_recompilation) return false; | 146 if (!FLAG_parallel_recompilation) return false; |
145 return ThreadId::Current().ToInteger() == thread_id_; | 147 return ThreadId::Current().ToInteger() == thread_id_; |
146 } | 148 } |
147 #endif | 149 #endif |
148 | 150 |
149 | 151 |
150 } } // namespace v8::internal | 152 } } // namespace v8::internal |
OLD | NEW |