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

Unified Diff: src/runtime-profiler.cc

Issue 6821009: Introduce runtime function %OptimizeFunctionOnNextCall to manually trigger optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/compiler/array-length.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.cc
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 6e25169c56fe28eed8a4c6b1a390827bef59f1ac..5b0aa8f72868f9ca8a7bfadf631db9afd6ba299d 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -107,12 +107,6 @@ void PendingListNode::WeakCallback(v8::Persistent<v8::Value>, void* data) {
}
-static bool IsOptimizable(JSFunction* function) {
- Code* code = function->code();
- return code->kind() == Code::FUNCTION && code->optimizable();
-}
-
-
Atomic32 RuntimeProfiler::state_ = 0;
// TODO(isolates): Create the semaphore lazily and clean it up when no
// longer required.
@@ -146,7 +140,7 @@ bool RuntimeProfiler::IsEnabled() {
void RuntimeProfiler::Optimize(JSFunction* function, bool eager, int delay) {
- ASSERT(IsOptimizable(function));
+ ASSERT(function->IsOptimizable());
if (FLAG_trace_opt) {
PrintF("[marking (%s) ", eager ? "eagerly" : "lazily");
function->PrintName();
@@ -245,7 +239,7 @@ void RuntimeProfiler::OptimizeNow() {
if (current->IsValid()) {
Handle<JSFunction> function = current->function();
int delay = current->Delay();
- if (IsOptimizable(*function)) {
+ if (function->IsOptimizable()) {
Optimize(*function, true, delay);
}
}
@@ -290,7 +284,7 @@ void RuntimeProfiler::OptimizeNow() {
}
// Do not record non-optimizable functions.
- if (!IsOptimizable(function)) continue;
+ if (!function->IsOptimizable()) continue;
samples[sample_count++] = function;
int function_size = function->shared()->SourceSize();
@@ -330,7 +324,7 @@ void RuntimeProfiler::OptimizeNow() {
void RuntimeProfiler::OptimizeSoon(JSFunction* function) {
- if (!IsOptimizable(function)) return;
+ if (!function->IsOptimizable()) return;
PendingListNode* node = new PendingListNode(function);
node->set_next(optimize_soon_list_);
optimize_soon_list_ = node;
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/compiler/array-length.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698