| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 6738213f9b41e466d647495f7bb40a8c43fd68bf..b32ae8a1b4b81a85c4d8e0d1737eea1b367d61b3 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -7554,6 +7554,29 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) {
|
| }
|
|
|
|
|
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
|
| + HandleScope scope(isolate);
|
| + ASSERT(args.length() == 1);
|
| + if (!V8::UseCrankshaft()) {
|
| + return Smi::FromInt(4); // 4 == "never".
|
| + }
|
| + if (FLAG_always_opt) {
|
| + return Smi::FromInt(3); // 3 == "always".
|
| + }
|
| + CONVERT_ARG_CHECKED(JSFunction, function, 0);
|
| + return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes".
|
| + : Smi::FromInt(2); // 2 == "no".
|
| +}
|
| +
|
| +
|
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationCount) {
|
| + HandleScope scope(isolate);
|
| + ASSERT(args.length() == 1);
|
| + CONVERT_ARG_CHECKED(JSFunction, function, 0);
|
| + return Smi::FromInt(function->shared()->opt_count());
|
| +}
|
| +
|
| +
|
| RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
|
| HandleScope scope(isolate);
|
| ASSERT(args.length() == 1);
|
|
|