| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 function->shared()->code()->kind() == Code::FUNCTION) { | 261 function->shared()->code()->kind() == Code::FUNCTION) { |
| 262 Code* unoptimized = function->shared()->code(); | 262 Code* unoptimized = function->shared()->code(); |
| 263 int nesting = unoptimized->allow_osr_at_loop_nesting_level(); | 263 int nesting = unoptimized->allow_osr_at_loop_nesting_level(); |
| 264 if (nesting == 0) AttemptOnStackReplacement(function); | 264 if (nesting == 0) AttemptOnStackReplacement(function); |
| 265 int new_nesting = Min(nesting + 1, Code::kMaxLoopNestingMarker); | 265 int new_nesting = Min(nesting + 1, Code::kMaxLoopNestingMarker); |
| 266 unoptimized->set_allow_osr_at_loop_nesting_level(new_nesting); | 266 unoptimized->set_allow_osr_at_loop_nesting_level(new_nesting); |
| 267 } | 267 } |
| 268 | 268 |
| 269 // Do not record non-optimizable functions. | 269 // Do not record non-optimizable functions. |
| 270 if (!function->IsOptimizable()) continue; | 270 if (!function->IsOptimizable()) continue; |
| 271 if (function->shared()->optimization_disabled()) continue; |
| 271 | 272 |
| 272 // Only record top-level code on top of the execution stack and | 273 // Only record top-level code on top of the execution stack and |
| 273 // avoid optimizing excessively large scripts since top-level code | 274 // avoid optimizing excessively large scripts since top-level code |
| 274 // will be executed only once. | 275 // will be executed only once. |
| 275 const int kMaxToplevelSourceSize = 10 * 1024; | 276 const int kMaxToplevelSourceSize = 10 * 1024; |
| 276 if (function->shared()->is_toplevel() | 277 if (function->shared()->is_toplevel() |
| 277 && (frame_count > 1 | 278 && (frame_count > 1 |
| 278 || function->shared()->SourceSize() > kMaxToplevelSourceSize)) { | 279 || function->shared()->SourceSize() > kMaxToplevelSourceSize)) { |
| 279 continue; | 280 continue; |
| 280 } | 281 } |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 467 |
| 467 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { | 468 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { |
| 468 if (!RuntimeProfiler::IsSomeIsolateInJS()) { | 469 if (!RuntimeProfiler::IsSomeIsolateInJS()) { |
| 469 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); | 470 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); |
| 470 } | 471 } |
| 471 return false; | 472 return false; |
| 472 } | 473 } |
| 473 | 474 |
| 474 | 475 |
| 475 } } // namespace v8::internal | 476 } } // namespace v8::internal |
| OLD | NEW |