| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 osr_hits_(0), | 61 osr_hits_(0), |
| 62 osr_attempts_(0), | 62 osr_attempts_(0), |
| 63 blocked_jobs_(0) { | 63 blocked_jobs_(0) { |
| 64 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE)); | 64 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE)); |
| 65 input_queue_ = NewArray<RecompileJob*>(input_queue_capacity_); | 65 input_queue_ = NewArray<RecompileJob*>(input_queue_capacity_); |
| 66 osr_buffer_ = NewArray<RecompileJob*>(osr_buffer_capacity_); | 66 osr_buffer_ = NewArray<RecompileJob*>(osr_buffer_capacity_); |
| 67 // Mark OSR buffer slots as empty. | 67 // Mark OSR buffer slots as empty. |
| 68 for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL; | 68 for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL; |
| 69 } | 69 } |
| 70 | 70 |
| 71 ~OptimizingCompilerThread() { | 71 ~OptimizingCompilerThread(); |
| 72 ASSERT_EQ(0, input_queue_length_); | |
| 73 #ifdef DEBUG | |
| 74 for (int i = 0; i < osr_buffer_capacity_; i++) { | |
| 75 CHECK_EQ(NULL, osr_buffer_[i]); | |
| 76 } | |
| 77 #endif | |
| 78 DeleteArray(osr_buffer_); | |
| 79 } | |
| 80 | 72 |
| 81 void Run(); | 73 void Run(); |
| 82 void Stop(); | 74 void Stop(); |
| 83 void Flush(); | 75 void Flush(); |
| 84 void QueueForOptimization(RecompileJob* optimizing_compiler); | 76 void QueueForOptimization(RecompileJob* optimizing_compiler); |
| 85 void Unblock(); | 77 void Unblock(); |
| 86 void InstallOptimizedFunctions(); | 78 void InstallOptimizedFunctions(); |
| 87 RecompileJob* FindReadyOSRCandidate(Handle<JSFunction> function, | 79 RecompileJob* FindReadyOSRCandidate(Handle<JSFunction> function, |
| 88 uint32_t osr_pc_offset); | 80 uint32_t osr_pc_offset); |
| 89 bool IsQueuedForOSR(Handle<JSFunction> function, uint32_t osr_pc_offset); | 81 bool IsQueuedForOSR(Handle<JSFunction> function, uint32_t osr_pc_offset); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 148 |
| 157 int osr_hits_; | 149 int osr_hits_; |
| 158 int osr_attempts_; | 150 int osr_attempts_; |
| 159 | 151 |
| 160 int blocked_jobs_; | 152 int blocked_jobs_; |
| 161 }; | 153 }; |
| 162 | 154 |
| 163 } } // namespace v8::internal | 155 } } // namespace v8::internal |
| 164 | 156 |
| 165 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ | 157 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ |
| OLD | NEW |