Remove kExceptionPending flag from thread and codegen.

Code just checks if exception_ is NULL instead. Compiled code simply
clears the exception_ field for MOVE_EXCEPTION instead of calling a
helper.

Change-Id: Iefaa780f66c327c3d20598bd71d3c14d7a9c8119
diff --git a/src/compiler/codegen/x86/call_x86.cc b/src/compiler/codegen/x86/call_x86.cc
index 80de901..727c5e8 100644
--- a/src/compiler/codegen/x86/call_x86.cc
+++ b/src/compiler/codegen/x86/call_x86.cc
@@ -191,6 +191,15 @@
   branch2->target = NewLIR0(cu, kPseudoTargetLabel);
 }
 
+void X86Codegen::GenMoveException(CompilationUnit* cu, RegLocation rl_dest)
+{
+  int ex_offset = Thread::ExceptionOffset().Int32Value();
+  RegLocation rl_result = EvalLoc(cu, rl_dest, kCoreReg, true);
+  NewLIR2(cu, kX86Mov32RT, rl_result.low_reg, ex_offset);
+  NewLIR2(cu, kX86Mov32TI, ex_offset, 0);
+  StoreValue(cu, rl_dest, rl_result);
+}
+
 /*
  * Mark garbage collection card. Skip if the value we're storing is null.
  */
diff --git a/src/compiler/codegen/x86/codegen_x86.h b/src/compiler/codegen/x86/codegen_x86.h
index f467e83..25f4461 100644
--- a/src/compiler/codegen/x86/codegen_x86.h
+++ b/src/compiler/codegen/x86/codegen_x86.h
@@ -139,6 +139,7 @@
     virtual void GenMemBarrier(CompilationUnit* cu, MemBarrierKind barrier_kind);
     virtual void GenMonitorEnter(CompilationUnit* cu, int opt_flags, RegLocation rl_src);
     virtual void GenMonitorExit(CompilationUnit* cu, int opt_flags, RegLocation rl_src);
+    virtual void GenMoveException(CompilationUnit* cu, RegLocation rl_dest);
     virtual void GenMultiplyByTwoBitMultiplier(CompilationUnit* cu, RegLocation rl_src,
                                                RegLocation rl_result, int lit, int first_bit,
                                                int second_bit);