| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 sampler_window_[sampler_window_position_] = function; | 220 sampler_window_[sampler_window_position_] = function; |
| 221 sampler_window_weight_[sampler_window_position_] = weight; | 221 sampler_window_weight_[sampler_window_position_] = weight; |
| 222 sampler_window_position_ = (sampler_window_position_ + 1) & | 222 sampler_window_position_ = (sampler_window_position_ + 1) & |
| 223 (kSamplerWindowSize - 1); | 223 (kSamplerWindowSize - 1); |
| 224 } | 224 } |
| 225 | 225 |
| 226 | 226 |
| 227 void RuntimeProfiler::OptimizeNow() { | 227 void RuntimeProfiler::OptimizeNow() { |
| 228 HandleScope scope(isolate_); | 228 HandleScope scope(isolate_); |
| 229 | 229 |
| 230 if (isolate_->DebuggerHasBreakPoints()) return; |
| 231 |
| 230 if (FLAG_parallel_recompilation) { | 232 if (FLAG_parallel_recompilation) { |
| 231 // Take this as opportunity to process the optimizing compiler thread's | 233 // Take this as opportunity to process the optimizing compiler thread's |
| 232 // output queue so that it does not unnecessarily keep objects alive. | 234 // output queue so that it does not unnecessarily keep objects alive. |
| 233 isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 235 isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| 234 } | 236 } |
| 235 | 237 |
| 236 // Run through the JavaScript frames and collect them. If we already | 238 // Run through the JavaScript frames and collect them. If we already |
| 237 // have a sample of the function, we mark it for optimizations | 239 // have a sample of the function, we mark it for optimizations |
| 238 // (eagerly or lazily). | 240 // (eagerly or lazily). |
| 239 JSFunction* samples[kSamplerFrameCount]; | 241 JSFunction* samples[kSamplerFrameCount]; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 441 |
| 440 | 442 |
| 441 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { | 443 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { |
| 442 for (int i = 0; i < kSamplerWindowSize; i++) { | 444 for (int i = 0; i < kSamplerWindowSize; i++) { |
| 443 visitor->VisitPointer(&sampler_window_[i]); | 445 visitor->VisitPointer(&sampler_window_[i]); |
| 444 } | 446 } |
| 445 } | 447 } |
| 446 | 448 |
| 447 | 449 |
| 448 } } // namespace v8::internal | 450 } } // namespace v8::internal |
| OLD | NEW |