| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Stops the runtime profiler thread when profiling support is being | 87 // Stops the runtime profiler thread when profiling support is being |
| 88 // turned off. | 88 // turned off. |
| 89 static void StopRuntimeProfilerThreadBeforeShutdown(Thread* thread); | 89 static void StopRuntimeProfilerThreadBeforeShutdown(Thread* thread); |
| 90 | 90 |
| 91 void UpdateSamplesAfterScavenge(); | 91 void UpdateSamplesAfterScavenge(); |
| 92 void RemoveDeadSamples(); | 92 void RemoveDeadSamples(); |
| 93 void UpdateSamplesAfterCompact(ObjectVisitor* visitor); | 93 void UpdateSamplesAfterCompact(ObjectVisitor* visitor); |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 static const int kSamplerWindowSize = 16; | 96 static const int kSamplerWindowSize = 16; |
| 97 static const int kStateWindowSize = 128; | |
| 98 | |
| 99 enum SamplerState { | |
| 100 IN_NON_JS_STATE = 0, | |
| 101 IN_JS_STATE = 1 | |
| 102 }; | |
| 103 | 97 |
| 104 static void HandleWakeUp(Isolate* isolate); | 98 static void HandleWakeUp(Isolate* isolate); |
| 105 | 99 |
| 106 void Optimize(JSFunction* function); | 100 void Optimize(JSFunction* function); |
| 107 | 101 |
| 108 void AttemptOnStackReplacement(JSFunction* function); | 102 void AttemptOnStackReplacement(JSFunction* function); |
| 109 | 103 |
| 110 void ClearSampleBuffer(); | 104 void ClearSampleBuffer(); |
| 111 | 105 |
| 112 void ClearSampleBufferNewSpaceEntries(); | 106 void ClearSampleBufferNewSpaceEntries(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 166 |
| 173 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { | 167 void RuntimeProfiler::IsolateExitedJS(Isolate* isolate) { |
| 174 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); | 168 Atomic32 new_state = NoBarrier_AtomicIncrement(&state_, -1); |
| 175 ASSERT(new_state >= 0); | 169 ASSERT(new_state >= 0); |
| 176 USE(new_state); | 170 USE(new_state); |
| 177 } | 171 } |
| 178 | 172 |
| 179 } } // namespace v8::internal | 173 } } // namespace v8::internal |
| 180 | 174 |
| 181 #endif // V8_RUNTIME_PROFILER_H_ | 175 #endif // V8_RUNTIME_PROFILER_H_ |
| OLD | NEW |