Merge r6479 into trunk (Revert r6543 and r6441).

This fixes a crash in the code generator.

BUG=1074


Review URL: http://codereview.chromium.org/6383010

git-svn-id: http://v8.googlecode.com/svn/trunk@6481 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index 3c233c9..1cdd31e 100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -321,10 +321,21 @@
   void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
   HValue* hydrogen_value() const { return hydrogen_value_; }
 
+  void set_deoptimization_environment(LEnvironment* env) {
+    deoptimization_environment_.set(env);
+  }
+  LEnvironment* deoptimization_environment() const {
+    return deoptimization_environment_.get();
+  }
+  bool HasDeoptimizationEnvironment() const {
+    return deoptimization_environment_.is_set();
+  }
+
  private:
   SetOncePointer<LEnvironment> environment_;
   SetOncePointer<LPointerMap> pointer_map_;
   HValue* hydrogen_value_;
+  SetOncePointer<LEnvironment> deoptimization_environment_;
 };
 
 
@@ -1870,6 +1881,7 @@
         argument_count_(0),
         allocator_(allocator),
         position_(RelocInfo::kNoPosition),
+        instructions_pending_deoptimization_environment_(NULL),
         pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
 
   // Build the sequence for the graph.
@@ -1978,6 +1990,10 @@
       CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
   LInstruction* MarkAsSaveDoubles(LInstruction* instr);
 
+  LInstruction* SetInstructionPendingDeoptimizationEnvironment(
+      LInstruction* instr, int ast_id);
+  void ClearInstructionPendingDeoptimizationEnvironment();
+
   LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
 
   void VisitInstruction(HInstruction* current);
@@ -1999,6 +2015,7 @@
   int argument_count_;
   LAllocator* allocator_;
   int position_;
+  LInstruction* instructions_pending_deoptimization_environment_;
   int pending_deoptimization_ast_id_;
 
   DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);