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_COMPILE_DISPATCHER_H_ | 5 #ifndef V8_OPTIMIZING_COMPILE_DISPATCHER_H_ |
6 #define V8_OPTIMIZING_COMPILE_DISPATCHER_H_ | 6 #define V8_OPTIMIZING_COMPILE_DISPATCHER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return input_queue_length_ < input_queue_capacity_; | 63 return input_queue_length_ < input_queue_capacity_; |
64 } | 64 } |
65 | 65 |
66 inline void AgeBufferedOsrJobs() { | 66 inline void AgeBufferedOsrJobs() { |
67 // Advance cursor of the cyclic buffer to next empty slot or stale OSR job. | 67 // Advance cursor of the cyclic buffer to next empty slot or stale OSR job. |
68 // Dispose said OSR job in the latter case. Calling this on every GC | 68 // Dispose said OSR job in the latter case. Calling this on every GC |
69 // should make sure that we do not hold onto stale jobs indefinitely. | 69 // should make sure that we do not hold onto stale jobs indefinitely. |
70 AddToOsrBuffer(NULL); | 70 AddToOsrBuffer(NULL); |
71 } | 71 } |
72 | 72 |
73 static bool Enabled(int max_available) { | 73 static bool Enabled() { return FLAG_concurrent_recompilation; } |
74 return (FLAG_concurrent_recompilation && max_available > 1); | |
75 } | |
76 | 74 |
77 private: | 75 private: |
78 class CompileTask; | 76 class CompileTask; |
79 | 77 |
80 enum ModeFlag { COMPILE, FLUSH }; | 78 enum ModeFlag { COMPILE, FLUSH }; |
81 | 79 |
82 void FlushOutputQueue(bool restore_function_code); | 80 void FlushOutputQueue(bool restore_function_code); |
83 void FlushOsrBuffer(bool restore_function_code); | 81 void FlushOsrBuffer(bool restore_function_code); |
84 void CompileNext(OptimizedCompileJob* job); | 82 void CompileNext(OptimizedCompileJob* job); |
85 OptimizedCompileJob* NextInput(bool check_if_flushing = false); | 83 OptimizedCompileJob* NextInput(bool check_if_flushing = false); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // background thread. | 128 // background thread. |
131 // | 129 // |
132 // Since flags might get modified while the background thread is running, it | 130 // Since flags might get modified while the background thread is running, it |
133 // is not safe to access them directly. | 131 // is not safe to access them directly. |
134 int recompilation_delay_; | 132 int recompilation_delay_; |
135 }; | 133 }; |
136 } | 134 } |
137 } // namespace v8::internal | 135 } // namespace v8::internal |
138 | 136 |
139 #endif // V8_OPTIMIZING_COMPILE_DISPATCHER_H_ | 137 #endif // V8_OPTIMIZING_COMPILE_DISPATCHER_H_ |
OLD | NEW |