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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 thread_id_ = ThreadId::Current().ToInteger(); | 42 thread_id_ = ThreadId::Current().ToInteger(); |
43 #endif | 43 #endif |
44 Isolate::SetIsolateThreadLocals(isolate_, NULL); | 44 Isolate::SetIsolateThreadLocals(isolate_, NULL); |
45 | 45 |
46 int64_t epoch = 0; | 46 int64_t epoch = 0; |
47 if (FLAG_trace_parallel_recompilation) epoch = OS::Ticks(); | 47 if (FLAG_trace_parallel_recompilation) epoch = OS::Ticks(); |
48 | 48 |
49 while (true) { | 49 while (true) { |
50 input_queue_semaphore_->Wait(); | 50 input_queue_semaphore_->Wait(); |
51 Logger::TimerEventScope timer( | 51 Logger::TimerEventScope timer( |
52 isolate_->logger(), Logger::TimerEventScope::v8_recompile_parallel); | 52 isolate_, Logger::TimerEventScope::v8_recompile_parallel); |
53 if (Acquire_Load(&stop_thread_)) { | 53 if (Acquire_Load(&stop_thread_)) { |
54 stop_semaphore_->Signal(); | 54 stop_semaphore_->Signal(); |
55 if (FLAG_trace_parallel_recompilation) { | 55 if (FLAG_trace_parallel_recompilation) { |
56 time_spent_total_ = OS::Ticks() - epoch; | 56 time_spent_total_ = OS::Ticks() - epoch; |
57 } | 57 } |
58 return; | 58 return; |
59 } | 59 } |
60 | 60 |
61 int64_t compiling_start = 0; | 61 int64_t compiling_start = 0; |
62 if (FLAG_trace_parallel_recompilation) compiling_start = OS::Ticks(); | 62 if (FLAG_trace_parallel_recompilation) compiling_start = OS::Ticks(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 #ifdef DEBUG | 141 #ifdef DEBUG |
142 bool OptimizingCompilerThread::IsOptimizerThread() { | 142 bool OptimizingCompilerThread::IsOptimizerThread() { |
143 if (!FLAG_parallel_recompilation) return false; | 143 if (!FLAG_parallel_recompilation) return false; |
144 return ThreadId::Current().ToInteger() == thread_id_; | 144 return ThreadId::Current().ToInteger() == thread_id_; |
145 } | 145 } |
146 #endif | 146 #endif |
147 | 147 |
148 | 148 |
149 } } // namespace v8::internal | 149 } } // namespace v8::internal |
OLD | NEW |