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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 // avoid optimizing excessively large scripts since top-level code | 297 // avoid optimizing excessively large scripts since top-level code |
298 // will be executed only once. | 298 // will be executed only once. |
299 const int kMaxToplevelSourceSize = 10 * 1024; | 299 const int kMaxToplevelSourceSize = 10 * 1024; |
300 if (shared->is_toplevel() && | 300 if (shared->is_toplevel() && |
301 (frame_count > 1 || shared->SourceSize() > kMaxToplevelSourceSize)) { | 301 (frame_count > 1 || shared->SourceSize() > kMaxToplevelSourceSize)) { |
302 continue; | 302 continue; |
303 } | 303 } |
304 | 304 |
305 // Do not record non-optimizable functions. | 305 // Do not record non-optimizable functions. |
306 if (shared->optimization_disabled()) { | 306 if (shared->optimization_disabled()) { |
307 if (shared->deopt_count() >= Compiler::kDefaultMaxOptCount) { | 307 if (shared->deopt_count() >= FLAG_max_opt_count) { |
308 // If optimization was disabled due to many deoptimizations, | 308 // If optimization was disabled due to many deoptimizations, |
309 // then check if the function is hot and try to reenable optimization. | 309 // then check if the function is hot and try to reenable optimization. |
310 int ticks = shared_code->profiler_ticks(); | 310 int ticks = shared_code->profiler_ticks(); |
311 if (ticks >= kProfilerTicksBeforeReenablingOptimization) { | 311 if (ticks >= kProfilerTicksBeforeReenablingOptimization) { |
312 shared_code->set_profiler_ticks(0); | 312 shared_code->set_profiler_ticks(0); |
313 shared->TryReenableOptimization(); | 313 shared->TryReenableOptimization(); |
314 } else { | 314 } else { |
315 shared_code->set_profiler_ticks(ticks + 1); | 315 shared_code->set_profiler_ticks(ticks + 1); |
316 } | 316 } |
317 } | 317 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { | 497 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { |
498 if (!RuntimeProfiler::IsSomeIsolateInJS()) { | 498 if (!RuntimeProfiler::IsSomeIsolateInJS()) { |
499 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); | 499 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); |
500 } | 500 } |
501 return false; | 501 return false; |
502 } | 502 } |
503 | 503 |
504 | 504 |
505 } } // namespace v8::internal | 505 } } // namespace v8::internal |
OLD | NEW |