| 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_; | |
| 140 | 139 |
| 141 #ifdef DEBUG | 140 #ifdef DEBUG |
| 142 static bool has_been_globally_set_up_; | 141 static bool has_been_globally_set_up_; |
| 143 #endif | 142 #endif |
| 144 static bool enabled_; | 143 static bool enabled_; |
| 145 }; | 144 }; |
| 146 | 145 |
| 147 | 146 |
| 148 // Rate limiter intended to be used in the profiler thread. | 147 // Rate limiter intended to be used in the profiler thread. |
| 149 class RuntimeProfilerRateLimiter BASE_EMBEDDED { | 148 class RuntimeProfilerRateLimiter BASE_EMBEDDED { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 179 | 178 |
| 180 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { | 179 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { |
| 181 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); | 180 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); |
| 182 ASSERT(new_state >= 0); | 181 ASSERT(new_state >= 0); |
| 183 USE(new_state); | 182 USE(new_state); |
| 184 } | 183 } |
| 185 | 184 |
| 186 } } // namespace v8::internal | 185 } } // namespace v8::internal |
| 187 | 186 |
| 188 #endif // V8_RUNTIME_PROFILER_H_ | 187 #endif // V8_RUNTIME_PROFILER_H_ |
| OLD | NEW |