Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 42357d6cd329a8c5c7ac5a9fa99ed453c632ad60..19b32854e807b2c7631014ce572fab0b1199d08b 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -7424,6 +7424,29 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_IsOptimizedFunction) { |
danno
2011/05/04 07:47:04
Perhaps this should be called FunctionOptimization
Jakob Kummerow
2011/05/06 15:58:15
Done.
|
+ 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); |