| 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;
|
|
|