diff options
author | isaacs <i@izs.me> | 2012-09-18 15:20:38 -0700 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-09-21 01:52:24 +0200 |
commit | 3411a03dd114d635800cc50749d2351cd734eb2a (patch) | |
tree | 0ba1e52ab2236286894b33400302181ece91b63a /deps/v8/src/runtime-profiler.cc | |
parent | cc1b09d6b7c3cc6b8729804cbf644634ba5d0815 (diff) | |
download | android-node-v8-3411a03dd114d635800cc50749d2351cd734eb2a.tar.gz android-node-v8-3411a03dd114d635800cc50749d2351cd734eb2a.tar.bz2 android-node-v8-3411a03dd114d635800cc50749d2351cd734eb2a.zip |
V8: Upgrade to 3.13.7.1
Diffstat (limited to 'deps/v8/src/runtime-profiler.cc')
-rw-r--r-- | deps/v8/src/runtime-profiler.cc | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/deps/v8/src/runtime-profiler.cc b/deps/v8/src/runtime-profiler.cc index 003b882f36..23f41fa7d2 100644 --- a/deps/v8/src/runtime-profiler.cc +++ b/deps/v8/src/runtime-profiler.cc @@ -34,6 +34,7 @@ #include "compilation-cache.h" #include "deoptimizer.h" #include "execution.h" +#include "full-codegen.h" #include "global-handles.h" #include "isolate-inl.h" #include "mark-compact.h" @@ -81,7 +82,8 @@ STATIC_ASSERT(kTicksWhenNotEnoughTypeInfo < 256); // Maximum size in bytes of generated code for a function to be optimized // the very first time it is seen on the stack. -static const int kMaxSizeEarlyOpt = 500; +static const int kMaxSizeEarlyOpt = + 5 * FullCodeGenerator::kBackEdgeDistanceUnit; Atomic32 RuntimeProfiler::state_ = 0; @@ -151,15 +153,20 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) { PrintF("]\n"); } - // The next call to the function will trigger optimization. - function->MarkForLazyRecompilation(); + if (FLAG_parallel_recompilation) { + function->MarkForParallelRecompilation(); + } else { + // The next call to the function will trigger optimization. + function->MarkForLazyRecompilation(); + } } void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function) { // See AlwaysFullCompiler (in compiler.cc) comment on why we need // Debug::has_break_points(). - ASSERT(function->IsMarkedForLazyRecompilation()); + ASSERT(function->IsMarkedForLazyRecompilation() || + function->IsMarkedForParallelRecompilation()); if (!FLAG_use_osr || isolate_->DebuggerHasBreakPoints() || function->IsBuiltin()) { @@ -218,7 +225,10 @@ int RuntimeProfiler::LookupSample(JSFunction* function) { for (int i = 0; i < kSamplerWindowSize; i++) { Object* sample = sampler_window_[i]; if (sample != NULL) { - if (function == sample) { + bool fits = FLAG_lookup_sample_by_shared + ? (function->shared() == JSFunction::cast(sample)->shared()) + : (function == JSFunction::cast(sample)); + if (fits) { weight += sampler_window_weight_[i]; } } @@ -275,7 +285,8 @@ void RuntimeProfiler::OptimizeNow() { if (shared_code->kind() != Code::FUNCTION) continue; - if (function->IsMarkedForLazyRecompilation()) { + if (function->IsMarkedForLazyRecompilation() || + function->IsMarkedForParallelRecompilation()) { int nesting = shared_code->allow_osr_at_loop_nesting_level(); if (nesting == 0) AttemptOnStackReplacement(function); int new_nesting = Min(nesting + 1, Code::kMaxLoopNestingMarker); @@ -293,7 +304,7 @@ void RuntimeProfiler::OptimizeNow() { // Do not record non-optimizable functions. if (shared->optimization_disabled()) { - if (shared->deopt_count() >= Compiler::kDefaultMaxOptCount) { + if (shared->deopt_count() >= FLAG_max_opt_count) { // If optimization was disabled due to many deoptimizations, // then check if the function is hot and try to reenable optimization. int ticks = shared_code->profiler_ticks(); @@ -308,8 +319,6 @@ void RuntimeProfiler::OptimizeNow() { } if (!function->IsOptimizable()) continue; - - if (FLAG_watch_ic_patching) { int ticks = shared_code->profiler_ticks(); @@ -332,7 +341,7 @@ void RuntimeProfiler::OptimizeNow() { } } } else if (!any_ic_changed_ && - shared_code->instruction_size() < kMaxSizeEarlyOpt) { + shared_code->instruction_size() < kMaxSizeEarlyOpt) { // If no IC was patched since the last tick and this function is very // small, optimistically optimize it now. Optimize(function, "small function"); |