| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 // Only record top-level code on top of the execution stack and | 295 // Only record top-level code on top of the execution stack and |
| 296 // avoid optimizing excessively large scripts since top-level code | 296 // avoid optimizing excessively large scripts since top-level code |
| 297 // will be executed only once. | 297 // will be executed only once. |
| 298 const int kMaxToplevelSourceSize = 10 * 1024; | 298 const int kMaxToplevelSourceSize = 10 * 1024; |
| 299 if (shared->is_toplevel() && | 299 if (shared->is_toplevel() && |
| 300 (frame_count > 1 || shared->SourceSize() > kMaxToplevelSourceSize)) { | 300 (frame_count > 1 || shared->SourceSize() > kMaxToplevelSourceSize)) { |
| 301 continue; | 301 continue; |
| 302 } | 302 } |
| 303 | 303 |
| 304 // Do not record non-optimizable functions. | 304 // If a function has had optimization disabled, it might be temporary. |
| 305 if (shared->optimization_disabled()) { | 305 if (shared->optimization_disabled()) { |
| 306 if (shared->deopt_count() >= FLAG_max_opt_count) { | 306 if (shared->too_many_deopts()) { |
| 307 // If optimization was disabled due to many deoptimizations, | 307 // The optimization was disabled because of too many deopts; |
| 308 // then check if the function is hot and try to reenable optimization. | 308 // check if the function is hot and try to reenable optimization. |
| 309 int ticks = shared_code->profiler_ticks(); | 309 int ticks = shared_code->profiler_ticks(); |
| 310 if (ticks >= kProfilerTicksBeforeReenablingOptimization) { | 310 if (ticks >= kProfilerTicksBeforeReenablingOptimization) { |
| 311 shared_code->set_profiler_ticks(0); | 311 shared_code->set_profiler_ticks(0); |
| 312 shared->TryReenableOptimization(); | 312 shared->TryReenableOptimization(); |
| 313 } else { | 313 } else { |
| 314 shared_code->set_profiler_ticks(ticks + 1); | 314 shared_code->set_profiler_ticks(ticks + 1); |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 continue; | 317 continue; |
| 318 } | 318 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 | 426 |
| 427 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { | 427 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { |
| 428 for (int i = 0; i < kSamplerWindowSize; i++) { | 428 for (int i = 0; i < kSamplerWindowSize; i++) { |
| 429 visitor->VisitPointer(&sampler_window_[i]); | 429 visitor->VisitPointer(&sampler_window_[i]); |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 | 433 |
| 434 } } // namespace v8::internal | 434 } } // namespace v8::internal |
| OLD | NEW |