| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return input_queue_length_ < input_queue_capacity_; | 89 return input_queue_length_ < input_queue_capacity_; |
| 90 } | 90 } |
| 91 | 91 |
| 92 inline void AgeBufferedOsrJobs() { | 92 inline void AgeBufferedOsrJobs() { |
| 93 // Advance cursor of the cyclic buffer to next empty slot or stale OSR job. | 93 // Advance cursor of the cyclic buffer to next empty slot or stale OSR job. |
| 94 // Dispose said OSR job in the latter case. Calling this on every GC | 94 // Dispose said OSR job in the latter case. Calling this on every GC |
| 95 // should make sure that we do not hold onto stale jobs indefinitely. | 95 // should make sure that we do not hold onto stale jobs indefinitely. |
| 96 AddToOsrBuffer(NULL); | 96 AddToOsrBuffer(NULL); |
| 97 } | 97 } |
| 98 | 98 |
| 99 static bool Enabled(int max_available) { |
| 100 return (FLAG_concurrent_recompilation && max_available > 1); |
| 101 } |
| 102 |
| 99 #ifdef DEBUG | 103 #ifdef DEBUG |
| 104 static bool IsOptimizerThread(Isolate* isolate); |
| 100 bool IsOptimizerThread(); | 105 bool IsOptimizerThread(); |
| 101 #endif | 106 #endif |
| 102 | 107 |
| 103 private: | 108 private: |
| 104 enum StopFlag { CONTINUE, STOP, FLUSH }; | 109 enum StopFlag { CONTINUE, STOP, FLUSH }; |
| 105 | 110 |
| 106 void FlushInputQueue(bool restore_function_code); | 111 void FlushInputQueue(bool restore_function_code); |
| 107 void FlushOutputQueue(bool restore_function_code); | 112 void FlushOutputQueue(bool restore_function_code); |
| 108 void FlushOsrBuffer(bool restore_function_code); | 113 void FlushOsrBuffer(bool restore_function_code); |
| 109 void CompileNext(); | 114 void CompileNext(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 155 |
| 151 int osr_hits_; | 156 int osr_hits_; |
| 152 int osr_attempts_; | 157 int osr_attempts_; |
| 153 | 158 |
| 154 int blocked_jobs_; | 159 int blocked_jobs_; |
| 155 }; | 160 }; |
| 156 | 161 |
| 157 } } // namespace v8::internal | 162 } } // namespace v8::internal |
| 158 | 163 |
| 159 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ | 164 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ |
| OLD | NEW |