Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: src/runtime-profiler.cc

Issue 1224173003: [osr] Increase Code::profiler_ticks to 28 bits. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/runtime-profiler.h" 7 #include "src/runtime-profiler.h"
8 8
9 #include "src/assembler.h" 9 #include "src/assembler.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (FLAG_always_osr) { 174 if (FLAG_always_osr) {
175 AttemptOnStackReplacement(function, Code::kMaxLoopNestingMarker); 175 AttemptOnStackReplacement(function, Code::kMaxLoopNestingMarker);
176 // Fall through and do a normal optimized compile as well. 176 // Fall through and do a normal optimized compile as well.
177 } else if (!frame->is_optimized() && 177 } else if (!frame->is_optimized() &&
178 (function->IsMarkedForOptimization() || 178 (function->IsMarkedForOptimization() ||
179 function->IsMarkedForConcurrentOptimization() || 179 function->IsMarkedForConcurrentOptimization() ||
180 function->IsOptimized())) { 180 function->IsOptimized())) {
181 // Attempt OSR if we are still running unoptimized code even though the 181 // Attempt OSR if we are still running unoptimized code even though the
182 // the function has long been marked or even already been optimized. 182 // the function has long been marked or even already been optimized.
183 int ticks = shared_code->profiler_ticks(); 183 int ticks = shared_code->profiler_ticks();
184 int allowance = kOSRCodeSizeAllowanceBase + 184 int64_t allowance =
185 ticks * kOSRCodeSizeAllowancePerTick; 185 kOSRCodeSizeAllowanceBase +
186 if (shared_code->CodeSize() > allowance) { 186 static_cast<int64_t>(ticks) * kOSRCodeSizeAllowancePerTick;
187 if (ticks < 255) shared_code->set_profiler_ticks(ticks + 1); 187 if (shared_code->CodeSize() > allowance &&
188 ticks < Code::ProfilerTicksField::kMax) {
189 shared_code->set_profiler_ticks(ticks + 1);
188 } else { 190 } else {
189 AttemptOnStackReplacement(function); 191 AttemptOnStackReplacement(function);
190 } 192 }
191 continue; 193 continue;
192 } 194 }
193 195
194 // Only record top-level code on top of the execution stack and 196 // Only record top-level code on top of the execution stack and
195 // avoid optimizing excessively large scripts since top-level code 197 // avoid optimizing excessively large scripts since top-level code
196 // will be executed only once. 198 // will be executed only once.
197 const int kMaxToplevelSourceSize = 10 * 1024; 199 const int kMaxToplevelSourceSize = 10 * 1024;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } else { 257 } else {
256 shared_code->set_profiler_ticks(ticks + 1); 258 shared_code->set_profiler_ticks(ticks + 1);
257 } 259 }
258 } 260 }
259 any_ic_changed_ = false; 261 any_ic_changed_ = false;
260 } 262 }
261 263
262 264
263 } // namespace internal 265 } // namespace internal
264 } // namespace v8 266 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698