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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 int sampler_window_weight_[kSamplerWindowSize]; | 129 int sampler_window_weight_[kSamplerWindowSize]; |
130 | 130 |
131 bool any_ic_changed_; | 131 bool any_ic_changed_; |
132 bool code_generated_; | 132 bool code_generated_; |
133 int total_code_generated_; | 133 int total_code_generated_; |
134 | 134 |
135 // Possible state values: | 135 // Possible state values: |
136 // -1 => the profiler thread is waiting on the semaphore | 136 // -1 => the profiler thread is waiting on the semaphore |
137 // 0 or positive => the number of isolates running JavaScript code. | 137 // 0 or positive => the number of isolates running JavaScript code. |
138 static Atomic32 state_; | 138 static Atomic32 state_; |
| 139 static Semaphore* semaphore_; |
139 | 140 |
140 #ifdef DEBUG | 141 #ifdef DEBUG |
141 static bool has_been_globally_set_up_; | 142 static bool has_been_globally_set_up_; |
142 #endif | 143 #endif |
143 static bool enabled_; | 144 static bool enabled_; |
144 }; | 145 }; |
145 | 146 |
146 | 147 |
147 // Rate limiter intended to be used in the profiler thread. | 148 // Rate limiter intended to be used in the profiler thread. |
148 class RuntimeProfilerRateLimiter BASE_EMBEDDED { | 149 class RuntimeProfilerRateLimiter BASE_EMBEDDED { |
(...skipping 29 matching lines...) Expand all Loading... |
178 | 179 |
179 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { | 180 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { |
180 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); | 181 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); |
181 ASSERT(new_state >= 0); | 182 ASSERT(new_state >= 0); |
182 USE(new_state); | 183 USE(new_state); |
183 } | 184 } |
184 | 185 |
185 } } // namespace v8::internal | 186 } } // namespace v8::internal |
186 | 187 |
187 #endif // V8_RUNTIME_PROFILER_H_ | 188 #endif // V8_RUNTIME_PROFILER_H_ |
OLD | NEW |