Revision: 16240
Author:   [email protected]
Date:     Tue Aug 20 08:53:34 2013 UTC
Log:      Consistently use CompilationInfo::AbortOptimization.

[email protected]

Review URL: https://codereview.chromium.org/22832002
http://code.google.com/p/v8/source/detail?r=16240

Modified:
 /branches/bleeding_edge/src/compiler.cc
 /branches/bleeding_edge/src/compiler.h

=======================================
--- /branches/bleeding_edge/src/compiler.cc     Mon Aug 12 14:10:25 2013 UTC
+++ /branches/bleeding_edge/src/compiler.cc     Tue Aug 20 08:53:34 2013 UTC
@@ -230,12 +230,6 @@
       function()->scope()->AllowsLazyCompilation() &&
       (shared_info().is_null() || !shared_info()->optimization_disabled());
 }
-
-
-void CompilationInfo::AbortOptimization() {
-  Handle<Code> code(shared_info()->code());
-  SetCode(code);
-}


 // Determine whether to use the full compiler for all code. If the flag
@@ -323,8 +317,7 @@

   // We should never arrive here if there is no code object on the
   // shared function object.
-  Handle<Code> code(info()->shared_info()->code());
-  ASSERT(code->kind() == Code::FUNCTION);
+  ASSERT(info()->shared_info()->code()->kind() == Code::FUNCTION);

   // We should never arrive here if optimization has been disabled on the
   // shared function info.
@@ -334,7 +327,7 @@
   // to use the Hydrogen-based optimizing compiler. We already have
   // generated code for this from the shared function object.
   if (AlwaysFullCompiler(isolate())) {
-    info()->SetCode(code);
+    info()->AbortOptimization();
     return SetLastStatus(BAILED_OUT);
   }

@@ -370,8 +363,8 @@

   // Take --hydrogen-filter into account.
   if (!info()->closure()->PassesHydrogenFilter()) {
-      info()->SetCode(code);
-      return SetLastStatus(BAILED_OUT);
+    info()->AbortOptimization();
+    return SetLastStatus(BAILED_OUT);
   }

   // Recompile the unoptimized version of the code if the current version
@@ -411,7 +404,7 @@
   // optimizable marker in the code object and optimize anyway. This
   // is safe as long as the unoptimized code has deoptimization
   // support.
-  ASSERT(FLAG_always_opt || code->optimizable());
+  ASSERT(FLAG_always_opt || info()->shared_info()->code()->optimizable());
   ASSERT(info()->shared_info()->has_deoptimization_support());

   if (FLAG_trace_hydrogen) {
@@ -1099,7 +1092,7 @@
       PrintF(" installed.\n");
     }
   } else {
-    info->SetCode(Handle<Code>(info->shared_info()->code()));
+    info->AbortOptimization();
     InstallFullCode(*info);
   }
// Optimized code is finally replacing unoptimized code. Reset the latter's
=======================================
--- /branches/bleeding_edge/src/compiler.h      Mon Aug 12 14:10:25 2013 UTC
+++ /branches/bleeding_edge/src/compiler.h      Tue Aug 20 08:53:34 2013 UTC
@@ -235,9 +235,10 @@
   // Determines whether or not to insert a self-optimization header.
   bool ShouldSelfOptimize();

-  // Disable all optimization attempts of this info for the rest of the
-  // current compilation pipeline.
-  void AbortOptimization();
+  // Reset code to the unoptimized version when optimization is aborted.
+  void AbortOptimization() {
+    SetCode(handle(shared_info()->code()));
+  }

   void set_deferred_handles(DeferredHandles* deferred_handles) {
     ASSERT(deferred_handles_ == NULL);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to