Chromium Code Reviews| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 // avoid optimizing excessively large scripts since top-level code | 299 // avoid optimizing excessively large scripts since top-level code |
| 300 // will be executed only once. | 300 // will be executed only once. |
| 301 const int kMaxToplevelSourceSize = 10 * 1024; | 301 const int kMaxToplevelSourceSize = 10 * 1024; |
| 302 if (shared->is_toplevel() && | 302 if (shared->is_toplevel() && |
| 303 (frame_count > 1 || shared->SourceSize() > kMaxToplevelSourceSize)) { | 303 (frame_count > 1 || shared->SourceSize() > kMaxToplevelSourceSize)) { |
| 304 continue; | 304 continue; |
| 305 } | 305 } |
| 306 | 306 |
| 307 // Do not record non-optimizable functions. | 307 // Do not record non-optimizable functions. |
| 308 if (shared->optimization_disabled()) { | 308 if (shared->optimization_disabled()) { |
| 309 if (shared->deopt_count() >= FLAG_max_opt_count) { | 309 if (shared->opt_count() >= FLAG_max_opt_count) { |
|
Jakob Kummerow
2013/11/05 14:35:05
This changes behavior, and could easily have unint
| |
| 310 // If optimization was disabled due to many deoptimizations, | 310 // If optimization was disabled due to many deoptimizations, |
| 311 // then check if the function is hot and try to reenable optimization. | 311 // then check if the function is hot and try to reenable optimization. |
| 312 int ticks = shared_code->profiler_ticks(); | 312 int ticks = shared_code->profiler_ticks(); |
| 313 if (ticks >= kProfilerTicksBeforeReenablingOptimization) { | 313 if (ticks >= kProfilerTicksBeforeReenablingOptimization) { |
| 314 shared_code->set_profiler_ticks(0); | 314 shared_code->set_profiler_ticks(0); |
| 315 shared->TryReenableOptimization(); | 315 shared->TryReenableOptimization(); |
| 316 } else { | 316 } else { |
| 317 shared_code->set_profiler_ticks(ticks + 1); | 317 shared_code->set_profiler_ticks(ticks + 1); |
| 318 } | 318 } |
| 319 } | 319 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 | 428 |
| 429 | 429 |
| 430 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { | 430 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { |
| 431 for (int i = 0; i < kSamplerWindowSize; i++) { | 431 for (int i = 0; i < kSamplerWindowSize; i++) { |
| 432 visitor->VisitPointer(&sampler_window_[i]); | 432 visitor->VisitPointer(&sampler_window_[i]); |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 | 435 |
| 436 | 436 |
| 437 } } // namespace v8::internal | 437 } } // namespace v8::internal |
| OLD | NEW |