Revision: 6486
Author: [email protected]
Date: Wed Jan 26 02:44:48 2011
Log: Merge SVN r6485 to trunk.

This change disables all code motion on the final optimization
attempt.  It fixes a crash in generated code.

Review URL: http://codereview.chromium.org/6249018
http://code.google.com/p/v8/source/detail?r=6486

Modified:
 /trunk/src/hydrogen.cc
 /trunk/src/hydrogen.h
 /trunk/src/version.cc

=======================================
--- /trunk/src/hydrogen.cc      Mon Jan 24 04:33:13 2011
+++ /trunk/src/hydrogen.cc      Wed Jan 26 02:44:48 2011
@@ -684,7 +684,7 @@
 }


-bool HGraph::AllowAggressiveOptimizations() const {
+bool HGraph::AllowCodeMotion() const {
return info()->shared_info()->opt_count() + 1 < Compiler::kDefaultMaxOptCount;
 }

@@ -1446,19 +1446,23 @@
   }
 }

-// Only move instructions that postdominate the loop header (i.e. are
-// always executed inside the loop). This is to avoid unnecessary
-// deoptimizations assuming the loop is executed at least once.
-// TODO(fschneider): Better type feedback should give us information
-// about code that was never executed.
+
 bool HGlobalValueNumberer::ShouldMove(HInstruction* instr,
                                       HBasicBlock* loop_header) {
-  if (FLAG_aggressive_loop_invariant_motion &&
-      !instr->IsChange() &&
-      (!instr->IsCheckInstruction() ||
-       graph_->AllowAggressiveOptimizations())) {
+  // If we've disabled code motion, don't move any instructions.
+  if (!graph_->AllowCodeMotion()) return false;
+
+  // If --aggressive-loop-invariant-motion, move everything except change
+  // instructions.
+  if (FLAG_aggressive_loop_invariant_motion && !instr->IsChange()) {
     return true;
   }
+
+  // Otherwise only move instructions that postdominate the loop header
+  // (i.e. are always executed inside the loop). This is to avoid
+  // unnecessary deoptimizations assuming the loop is executed at least
+  // once.  TODO(fschneider): Better type feedback should give us
+  // information about code that was never executed.
   HBasicBlock* block = instr->block();
   bool result = true;
   if (block != loop_header) {
=======================================
--- /trunk/src/hydrogen.h       Mon Jan 24 04:33:13 2011
+++ /trunk/src/hydrogen.h       Wed Jan 26 02:44:48 2011
@@ -297,7 +297,7 @@

   CompilationInfo* info() const { return info_; }

-  bool AllowAggressiveOptimizations() const;
+  bool AllowCodeMotion() const;

   const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
   const ZoneList<HPhi*>* phi_list() const { return phi_list_; }
=======================================
--- /trunk/src/version.cc       Wed Jan 26 00:23:03 2011
+++ /trunk/src/version.cc       Wed Jan 26 02:44:48 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     0
 #define BUILD_NUMBER      11
-#define PATCH_LEVEL       1
+#define PATCH_LEVEL       2
 #define CANDIDATE_VERSION false

 // Define SONAME to have the SCons build the put a specific SONAME into the

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to