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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (FLAG_watch_ic_patching) { | 283 if (FLAG_watch_ic_patching) { |
284 int ticks = function->shared()->profiler_ticks(); | 284 int ticks = function->shared()->profiler_ticks(); |
285 | 285 |
286 if (ticks >= kProfilerTicksBeforeOptimization) { | 286 if (ticks >= kProfilerTicksBeforeOptimization) { |
287 int typeinfo, total, percentage; | 287 int typeinfo, total, percentage; |
288 GetICCounts(function, &typeinfo, &total, &percentage); | 288 GetICCounts(function, &typeinfo, &total, &percentage); |
289 if (percentage >= FLAG_type_info_threshold) { | 289 if (percentage >= FLAG_type_info_threshold) { |
290 // If this particular function hasn't had any ICs patched for enough | 290 // If this particular function hasn't had any ICs patched for enough |
291 // ticks, optimize it now. | 291 // ticks, optimize it now. |
292 Optimize(function, "hot and stable"); | 292 Optimize(function, "hot and stable"); |
| 293 } else if (ticks >= 100) { |
| 294 // If this function does not have enough type info, but has |
| 295 // seen a huge number of ticks, optimize it as it is. |
| 296 Optimize(function, "not much type info but very hot"); |
293 } else { | 297 } else { |
| 298 function->shared()->set_profiler_ticks(ticks + 1); |
294 if (FLAG_trace_opt_verbose) { | 299 if (FLAG_trace_opt_verbose) { |
295 PrintF("[not yet optimizing "); | 300 PrintF("[not yet optimizing "); |
296 function->PrintName(); | 301 function->PrintName(); |
297 PrintF(", not enough type info: %d/%d (%d%%)]\n", | 302 PrintF(", not enough type info: %d/%d (%d%%)]\n", |
298 typeinfo, total, percentage); | 303 typeinfo, total, percentage); |
299 } | 304 } |
300 } | 305 } |
301 } else if (!any_ic_changed_ && | 306 } else if (!any_ic_changed_ && |
302 function->shared()->code()->instruction_size() < kMaxSizeEarlyOpt) { | 307 function->shared()->code()->instruction_size() < kMaxSizeEarlyOpt) { |
303 // If no IC was patched since the last tick and this function is very | 308 // If no IC was patched since the last tick and this function is very |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 472 |
468 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { | 473 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { |
469 if (!RuntimeProfiler::IsSomeIsolateInJS()) { | 474 if (!RuntimeProfiler::IsSomeIsolateInJS()) { |
470 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); | 475 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); |
471 } | 476 } |
472 return false; | 477 return false; |
473 } | 478 } |
474 | 479 |
475 | 480 |
476 } } // namespace v8::internal | 481 } } // namespace v8::internal |
OLD | NEW |