Make deopt testing compatible with runtime optimization status queries.
authormachenbach@chromium.org <machenbach@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 15 Jul 2013 18:47:40 +0000 (18:47 +0000)
committermachenbach@chromium.org <machenbach@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 15 Jul 2013 18:47:40 +0000 (18:47 +0000)
When deopt testing is activated, a new status code will be returned by optimization status queries (status=maybe deopted).

This will make those tests work that test for 'not status=no', when performing deopt testing.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/19184002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15681 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/runtime.cc

index 7229018..c259cb4 100644 (file)
@@ -8464,15 +8464,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompleteOptimization) {
 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) {
@@ -8481,6 +8479,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
     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".
 }