| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 void SetUp(); | 57 void SetUp(); |
| 58 void Reset(); | 58 void Reset(); |
| 59 void TearDown(); | 59 void TearDown(); |
| 60 | 60 |
| 61 Object** SamplerWindowAddress(); | 61 Object** SamplerWindowAddress(); |
| 62 int SamplerWindowSize(); | 62 int SamplerWindowSize(); |
| 63 | 63 |
| 64 void NotifyICChanged() { any_ic_changed_ = true; } | 64 void NotifyICChanged() { any_ic_changed_ = true; } |
| 65 | 65 |
| 66 void NotifyCodeGenerated(int generated_code_size) { | |
| 67 if (FLAG_watch_ic_patching) { | |
| 68 code_generated_ = true; | |
| 69 total_code_generated_ += generated_code_size; | |
| 70 } | |
| 71 } | |
| 72 | |
| 73 // Rate limiting support. | 66 // Rate limiting support. |
| 74 | 67 |
| 75 // VM thread interface. | 68 // VM thread interface. |
| 76 // | 69 // |
| 77 // Called by isolates when their states change. | 70 // Called by isolates when their states change. |
| 78 static inline void IsolateEnteredJS(Isolate* isolate); | 71 static inline void IsolateEnteredJS(Isolate* isolate); |
| 79 static inline void IsolateExitedJS(Isolate* isolate); | 72 static inline void IsolateExitedJS(Isolate* isolate); |
| 80 | 73 |
| 81 // Profiler thread interface. | 74 // Profiler thread interface. |
| 82 // | 75 // |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 int sampler_threshold_; | 116 int sampler_threshold_; |
| 124 int sampler_threshold_size_factor_; | 117 int sampler_threshold_size_factor_; |
| 125 int sampler_ticks_until_threshold_adjustment_; | 118 int sampler_ticks_until_threshold_adjustment_; |
| 126 | 119 |
| 127 Object* sampler_window_[kSamplerWindowSize]; | 120 Object* sampler_window_[kSamplerWindowSize]; |
| 128 int sampler_window_position_; | 121 int sampler_window_position_; |
| 129 int sampler_window_weight_[kSamplerWindowSize]; | 122 int sampler_window_weight_[kSamplerWindowSize]; |
| 130 | 123 |
| 131 bool any_ic_changed_; | 124 bool any_ic_changed_; |
| 132 bool code_generated_; | 125 bool code_generated_; |
| 133 int total_code_generated_; | |
| 134 | 126 |
| 135 // Possible state values: | 127 // Possible state values: |
| 136 // -1 => the profiler thread is waiting on the semaphore | 128 // -1 => the profiler thread is waiting on the semaphore |
| 137 // 0 or positive => the number of isolates running JavaScript code. | 129 // 0 or positive => the number of isolates running JavaScript code. |
| 138 static Atomic32 state_; | 130 static Atomic32 state_; |
| 139 | 131 |
| 140 #ifdef DEBUG | 132 #ifdef DEBUG |
| 141 static bool has_been_globally_set_up_; | 133 static bool has_been_globally_set_up_; |
| 142 #endif | 134 #endif |
| 143 static bool enabled_; | 135 static bool enabled_; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 170 |
| 179 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { | 171 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { |
| 180 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); | 172 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); |
| 181 ASSERT(new_state >= 0); | 173 ASSERT(new_state >= 0); |
| 182 USE(new_state); | 174 USE(new_state); |
| 183 } | 175 } |
| 184 | 176 |
| 185 } } // namespace v8::internal | 177 } } // namespace v8::internal |
| 186 | 178 |
| 187 #endif // V8_RUNTIME_PROFILER_H_ | 179 #endif // V8_RUNTIME_PROFILER_H_ |
| OLD | NEW |