summaryrefslogtreecommitdiffstats
path: root/src/runtime-profiler.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2016-03-22 12:00:34 +0000
committerBen Murdoch <benm@google.com>2016-04-05 15:27:36 +0100
commit014dc512cdd3e367bee49a713fdc5ed92584a3e5 (patch)
tree742b8bb81c9998b13f6a801f8e0bec6ae9a568c1 /src/runtime-profiler.cc
parent094c92c64194bd11593e915f372914dcfccf9dd2 (diff)
downloadandroid_external_v8-014dc512cdd3e367bee49a713fdc5ed92584a3e5.tar.gz
android_external_v8-014dc512cdd3e367bee49a713fdc5ed92584a3e5.tar.bz2
android_external_v8-014dc512cdd3e367bee49a713fdc5ed92584a3e5.zip
Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28 Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
Diffstat (limited to 'src/runtime-profiler.cc')
-rw-r--r--src/runtime-profiler.cc42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 6c997145..2d4ee9c1 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -2,21 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/v8.h"
-
#include "src/runtime-profiler.h"
#include "src/assembler.h"
+#include "src/ast/scopeinfo.h"
#include "src/base/platform/platform.h"
#include "src/bootstrapper.h"
#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/isolate-inl.h"
-#include "src/scopeinfo.h"
namespace v8 {
namespace internal {
@@ -75,8 +72,10 @@ static void GetICCounts(SharedFunctionInfo* shared,
// Harvest vector-ics as well
TypeFeedbackVector* vector = shared->feedback_vector();
- *ic_with_type_info_count += vector->ic_with_type_info_count();
- *ic_generic_count += vector->ic_generic_count();
+ int with = 0, gen = 0;
+ vector->ComputeCounts(&with, &gen);
+ *ic_with_type_info_count += with;
+ *ic_generic_count += gen;
if (*ic_total_count > 0) {
*type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count;
@@ -89,8 +88,6 @@ static void GetICCounts(SharedFunctionInfo* shared,
void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
- DCHECK(function->IsOptimizable());
-
if (FLAG_trace_opt && function->PassesFilter(FLAG_hydrogen_filter)) {
PrintF("[marking ");
function->ShortPrint();
@@ -113,16 +110,12 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function,
int loop_nesting_levels) {
SharedFunctionInfo* shared = function->shared();
- // See AlwaysFullCompiler (in compiler.cc) comment on why we need
- // Debug::has_break_points().
- if (!FLAG_use_osr ||
- isolate_->DebuggerHasBreakPoints() ||
- function->IsBuiltin()) {
+ if (!FLAG_use_osr || function->shared()->IsBuiltin()) {
return;
}
// If the code is not optimizable, don't try OSR.
- if (!shared->code()->optimizable()) return;
+ if (shared->optimization_disabled()) return;
// We are not prepared to do OSR for a function that already has an
// allocated arguments object. The optimized code would bypass it for
@@ -147,7 +140,7 @@ void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function,
void RuntimeProfiler::OptimizeNow() {
HandleScope scope(isolate_);
- if (!isolate_->use_crankshaft() || isolate_->DebuggerHasBreakPoints()) return;
+ if (!isolate_->use_crankshaft()) return;
DisallowHeapAllocation no_gc;
@@ -188,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);
}
@@ -222,7 +217,7 @@ void RuntimeProfiler::OptimizeNow() {
}
continue;
}
- if (!function->IsOptimizable()) continue;
+ if (function->IsOptimized()) continue;
int ticks = shared_code->profiler_ticks();
@@ -267,4 +262,5 @@ void RuntimeProfiler::OptimizeNow() {
}
-} } // namespace v8::internal
+} // namespace internal
+} // namespace v8