RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
HandleScope scope(isolate);
ASSERT(args.length() == 1);
- // The least significant bit (after untagging) indicates whether the
- // function is currently optimized, regardless of reason.
if (!V8::UseCrankshaft()) {
return Smi::FromInt(4); // 4 == "never".
}
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
if (FLAG_parallel_recompilation) {
if (function->IsMarkedForLazyRecompilation()) {
- return Smi::FromInt(5);
+ return Smi::FromInt(5); // 5 == "parallel recompilation".
}
}
if (FLAG_always_opt) {
return function->IsOptimized() ? Smi::FromInt(3) // 3 == "always".
: Smi::FromInt(2); // 2 == "no".
}
+ if (FLAG_deopt_every_n_times) {
+ return Smi::FromInt(6); // 6 == "maybe deopted".
+ }
return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes".
: Smi::FromInt(2); // 2 == "no".
}