OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OPTIMIZING_COMPILER_THREAD_H_ | 5 #ifndef V8_OPTIMIZING_COMPILER_THREAD_H_ |
6 #define V8_OPTIMIZING_COMPILER_THREAD_H_ | 6 #define V8_OPTIMIZING_COMPILER_THREAD_H_ |
7 | 7 |
8 #include "src/base/atomicops.h" | 8 #include "src/base/atomicops.h" |
9 #include "src/base/platform/mutex.h" | 9 #include "src/base/platform/mutex.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void FlushOsrBuffer(bool restore_function_code); | 91 void FlushOsrBuffer(bool restore_function_code); |
92 void CompileNext(); | 92 void CompileNext(); |
93 OptimizedCompileJob* NextInput(); | 93 OptimizedCompileJob* NextInput(); |
94 | 94 |
95 // Add a recompilation task for OSR to the cyclic buffer, awaiting OSR entry. | 95 // Add a recompilation task for OSR to the cyclic buffer, awaiting OSR entry. |
96 // Tasks evicted from the cyclic buffer are discarded. | 96 // Tasks evicted from the cyclic buffer are discarded. |
97 void AddToOsrBuffer(OptimizedCompileJob* compiler); | 97 void AddToOsrBuffer(OptimizedCompileJob* compiler); |
98 | 98 |
99 inline int InputQueueIndex(int i) { | 99 inline int InputQueueIndex(int i) { |
100 int result = (i + input_queue_shift_) % input_queue_capacity_; | 100 int result = (i + input_queue_shift_) % input_queue_capacity_; |
101 ASSERT_LE(0, result); | 101 DCHECK_LE(0, result); |
102 ASSERT_LT(result, input_queue_capacity_); | 102 DCHECK_LT(result, input_queue_capacity_); |
103 return result; | 103 return result; |
104 } | 104 } |
105 | 105 |
106 #ifdef DEBUG | 106 #ifdef DEBUG |
107 int thread_id_; | 107 int thread_id_; |
108 base::Mutex thread_id_mutex_; | 108 base::Mutex thread_id_mutex_; |
109 #endif | 109 #endif |
110 | 110 |
111 Isolate* isolate_; | 111 Isolate* isolate_; |
112 base::Semaphore stop_semaphore_; | 112 base::Semaphore stop_semaphore_; |
(...skipping 20 matching lines...) Expand all Loading... |
133 | 133 |
134 int osr_hits_; | 134 int osr_hits_; |
135 int osr_attempts_; | 135 int osr_attempts_; |
136 | 136 |
137 int blocked_jobs_; | 137 int blocked_jobs_; |
138 }; | 138 }; |
139 | 139 |
140 } } // namespace v8::internal | 140 } } // namespace v8::internal |
141 | 141 |
142 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ | 142 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ |
OLD | NEW |