diff options
Diffstat (limited to 'deps/v8/src/runtime-profiler.cc')
-rw-r--r-- | deps/v8/src/runtime-profiler.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/deps/v8/src/runtime-profiler.cc b/deps/v8/src/runtime-profiler.cc index 351bca7b6a..4a45baf522 100644 --- a/deps/v8/src/runtime-profiler.cc +++ b/deps/v8/src/runtime-profiler.cc @@ -12,9 +12,9 @@ #include "src/code-stubs.h" #include "src/compilation-cache.h" #include "src/execution.h" -#include "src/full-codegen.h" +#include "src/frames-inl.h" +#include "src/full-codegen/full-codegen.h" #include "src/global-handles.h" -#include "src/heap/mark-compact.h" #include "src/scopeinfo.h" namespace v8 { @@ -181,10 +181,12 @@ void RuntimeProfiler::OptimizeNow() { // Attempt OSR if we are still running unoptimized code even though the // the function has long been marked or even already been optimized. int ticks = shared_code->profiler_ticks(); - int allowance = kOSRCodeSizeAllowanceBase + - ticks * kOSRCodeSizeAllowancePerTick; - if (shared_code->CodeSize() > allowance) { - if (ticks < 255) shared_code->set_profiler_ticks(ticks + 1); + int64_t allowance = + kOSRCodeSizeAllowanceBase + + static_cast<int64_t>(ticks) * kOSRCodeSizeAllowancePerTick; + if (shared_code->CodeSize() > allowance && + ticks < Code::ProfilerTicksField::kMax) { + shared_code->set_profiler_ticks(ticks + 1); } else { AttemptOnStackReplacement(function); } |