Roll V8 back to 3.6

Roll back to V8 3.6 to fix x86 build, we don't have ucontext.h.

This reverts commits:
5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b
c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9
592a9fc1d8ea420377a2e7efd0600e20b058be2b

Bug: 5688872
Change-Id: Ic961bb5e65b778e98bbfb71cce71d99fa949e995
diff --git a/src/unicode.h b/src/unicode.h
index 94ab1b4..39fc349 100644
--- a/src/unicode.h
+++ b/src/unicode.h
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2007-2008 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -44,7 +44,7 @@
  * The max length of the result of converting the case of a single
  * character.
  */
-const int kMaxMappingSize = 4;
+static const int kMaxMappingSize = 4;
 
 template <class T, int size = 256>
 class Predicate {
@@ -100,7 +100,7 @@
   static const uchar kMaxCodePoint;
 };
 
-// --- U t f   8   a n d   16 ---
+// --- U t f   8 ---
 
 template <typename Data>
 class Buffer {
@@ -114,46 +114,10 @@
   unsigned length_;
 };
 
-
-class Utf16 {
- public:
-  static inline bool IsLeadSurrogate(int code) {
-    if (code == kNoPreviousCharacter) return false;
-    return (code & 0xfc00) == 0xd800;
-  }
-  static inline bool IsTrailSurrogate(int code) {
-    if (code == kNoPreviousCharacter) return false;
-    return (code & 0xfc00) == 0xdc00;
-  }
-
-  static inline int CombineSurrogatePair(uchar lead, uchar trail) {
-    return 0x10000 + ((lead & 0x3ff) << 10) + (trail & 0x3ff);
-  }
-  static const int kNoPreviousCharacter = -1;
-  static const uchar kMaxNonSurrogateCharCode = 0xffff;
-  // Encoding a single UTF-16 code unit will produce 1, 2 or 3 bytes
-  // of UTF-8 data.  The special case where the unit is a surrogate
-  // trail produces 1 byte net, because the encoding of the pair is
-  // 4 bytes and the 3 bytes that were used to encode the lead surrogate
-  // can be reclaimed.
-  static const int kMaxExtraUtf8BytesForOneUtf16CodeUnit = 3;
-  // One UTF-16 surrogate is endoded (illegally) as 3 UTF-8 bytes.
-  // The illegality stems from the surrogate not being part of a pair.
-  static const int kUtf8BytesToCodeASurrogate = 3;
-  static inline uchar LeadSurrogate(int char_code) {
-    return 0xd800 + (((char_code - 0x10000) >> 10) & 0x3ff);
-  }
-  static inline uchar TrailSurrogate(int char_code) {
-    return 0xdc00 + (char_code & 0x3ff);
-  }
-};
-
-
 class Utf8 {
  public:
-  static inline uchar Length(uchar chr, int previous);
-  static inline unsigned Encode(
-      char* out, uchar c, int previous);
+  static inline uchar Length(uchar chr);
+  static inline unsigned Encode(char* out, uchar c);
   static const byte* ReadBlock(Buffer<const char*> str, byte* buffer,
       unsigned capacity, unsigned* chars_read, unsigned* offset);
   static uchar CalculateValue(const byte* str,
@@ -166,11 +130,6 @@
   static const unsigned kMaxThreeByteChar = 0xffff;
   static const unsigned kMaxFourByteChar  = 0x1fffff;
 
-  // A single surrogate is coded as a 3 byte UTF-8 sequence, but two together
-  // that match are coded as a 4 byte UTF-8 sequence.
-  static const unsigned kBytesSavedByCombiningSurrogates = 2;
-  static const unsigned kSizeOfUnmatchedSurrogate = 3;
-
  private:
   template <unsigned s> friend class Utf8InputBuffer;
   friend class Test;
@@ -188,7 +147,6 @@
   // Note that default implementation is not efficient.
   virtual void Seek(unsigned);
   unsigned Length();
-  unsigned Utf16Length();
   virtual ~CharacterStream() { }
   static inline bool EncodeCharacter(uchar c, byte* buffer, unsigned capacity,
       unsigned& offset);
@@ -198,7 +156,6 @@
       unsigned capacity, unsigned& offset);
   static inline uchar DecodeCharacter(const byte* buffer, unsigned* offset);
   virtual void Rewind() = 0;
-
  protected:
   virtual void FillBuffer() = 0;
   // The number of characters left in the current buffer