Improve CHECK_<op> logging.

This patch lets us show the lhs and rhs when a relational check fails. (I show
both, even though that looks silly in cases like CHECK_EQ(rc, 0) where we'll
say "rc=-1, 0=0", because it's helpful in cases like CHECK_LT(i, size()) where
we want "i=4, size=2".)

I had to add a few operator<<s for enums, and fix a bunch of signed/unsigned
mismatches, and put the StringPiece operator<< in the right namespace.

Change-Id: I390f38bd97b3f50e12182f36ff027ca067c48d69
diff --git a/src/assembler_x86.cc b/src/assembler_x86.cc
index ce7f104..0c44c08 100644
--- a/src/assembler_x86.cc
+++ b/src/assembler_x86.cc
@@ -20,6 +20,18 @@
   }
 };
 
+static const char* kRegisterNames[] = {
+  "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
+};
+std::ostream& operator<<(std::ostream& os, const Register& rhs) {
+  if (rhs >= EAX && rhs <= EDI) {
+    os << kRegisterNames[rhs];
+  } else {
+    os << "Register[" << int(rhs) << "]";
+  }
+  return os;
+}
+
 
 void Assembler::InitializeMemoryWithBreakpoints(byte* data, size_t length) {
   memset(reinterpret_cast<void*>(data), Instr::kBreakPointInstruction, length);