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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 | 123 |
124 Handle<SharedFunctionInfo> | 124 Handle<SharedFunctionInfo> |
125 OptimizingCompilerThread::InstallNextOptimizedFunction() { | 125 OptimizingCompilerThread::InstallNextOptimizedFunction() { |
126 ASSERT(FLAG_manual_parallel_recompilation); | 126 ASSERT(FLAG_manual_parallel_recompilation); |
127 output_queue_semaphore_->Wait(); | 127 output_queue_semaphore_->Wait(); |
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(); | |
Yang
2012/11/23 15:46:20
compiler->info() gets deallocated in InstallOptimi
| |
130 Compiler::InstallOptimizedCode(compiler); | 131 Compiler::InstallOptimizedCode(compiler); |
131 return compiler->info()->shared_info(); | 132 return shared; |
132 } | 133 } |
133 | 134 |
134 | 135 |
135 void OptimizingCompilerThread::QueueForOptimization( | 136 void OptimizingCompilerThread::QueueForOptimization( |
136 OptimizingCompiler* optimizing_compiler) { | 137 OptimizingCompiler* optimizing_compiler) { |
137 input_queue_.Enqueue(optimizing_compiler); | 138 input_queue_.Enqueue(optimizing_compiler); |
138 input_queue_semaphore_->Signal(); | 139 input_queue_semaphore_->Signal(); |
139 } | 140 } |
140 | 141 |
141 #ifdef DEBUG | 142 #ifdef DEBUG |
142 bool OptimizingCompilerThread::IsOptimizerThread() { | 143 bool OptimizingCompilerThread::IsOptimizerThread() { |
143 if (!FLAG_parallel_recompilation) return false; | 144 if (!FLAG_parallel_recompilation) return false; |
144 return ThreadId::Current().ToInteger() == thread_id_; | 145 return ThreadId::Current().ToInteger() == thread_id_; |
145 } | 146 } |
146 #endif | 147 #endif |
147 | 148 |
148 | 149 |
149 } } // namespace v8::internal | 150 } } // namespace v8::internal |
OLD | NEW |