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/objects-debug.cc b/src/objects-debug.cc
index 8eefb23..e9ca6c0 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2011 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:
@@ -94,9 +94,6 @@
     case BYTE_ARRAY_TYPE:
       ByteArray::cast(this)->ByteArrayVerify();
       break;
-    case FREE_SPACE_TYPE:
-      FreeSpace::cast(this)->FreeSpaceVerify();
-      break;
     case EXTERNAL_PIXEL_ARRAY_TYPE:
       ExternalPixelArray::cast(this)->ExternalPixelArrayVerify();
       break;
@@ -138,9 +135,6 @@
     case JS_VALUE_TYPE:
       JSValue::cast(this)->JSValueVerify();
       break;
-    case JS_DATE_TYPE:
-      JSDate::cast(this)->JSDateVerify();
-      break;
     case JS_FUNCTION_TYPE:
       JSFunction::cast(this)->JSFunctionVerify();
       break;
@@ -159,12 +153,6 @@
     case JS_ARRAY_TYPE:
       JSArray::cast(this)->JSArrayVerify();
       break;
-    case JS_SET_TYPE:
-      JSSet::cast(this)->JSSetVerify();
-      break;
-    case JS_MAP_TYPE:
-      JSMap::cast(this)->JSMapVerify();
-      break;
     case JS_WEAK_MAP_TYPE:
       JSWeakMap::cast(this)->JSWeakMapVerify();
       break;
@@ -219,11 +207,6 @@
 }
 
 
-void FreeSpace::FreeSpaceVerify() {
-  ASSERT(IsFreeSpace());
-}
-
-
 void ExternalPixelArray::ExternalPixelArrayVerify() {
   ASSERT(IsExternalPixelArray());
 }
@@ -272,20 +255,12 @@
 void JSObject::JSObjectVerify() {
   VerifyHeapPointer(properties());
   VerifyHeapPointer(elements());
-
-  if (GetElementsKind() == NON_STRICT_ARGUMENTS_ELEMENTS) {
-    ASSERT(this->elements()->IsFixedArray());
-    ASSERT(this->elements()->length() >= 2);
-  }
-
   if (HasFastProperties()) {
     CHECK_EQ(map()->unused_property_fields(),
              (map()->inobject_properties() + properties()->length() -
               map()->NextFreePropertyIndex()));
   }
-  ASSERT_EQ((map()->has_fast_elements() ||
-             map()->has_fast_smi_only_elements() ||
-             (elements() == GetHeap()->empty_fixed_array())),
+  ASSERT_EQ(map()->has_fast_elements(),
             (elements()->map() == GetHeap()->fixed_array_map() ||
              elements()->map() == GetHeap()->fixed_cow_array_map()));
   ASSERT(map()->has_fast_elements() == HasFastElements());
@@ -329,18 +304,6 @@
 }
 
 
-void TypeFeedbackInfo::TypeFeedbackInfoVerify() {
-  VerifyObjectField(kIcTotalCountOffset);
-  VerifyObjectField(kIcWithTypeinfoCountOffset);
-  VerifyHeapPointer(type_feedback_cells());
-}
-
-
-void AliasedArgumentsEntry::AliasedArgumentsEntryVerify() {
-  VerifySmiField(kAliasedContextSlot);
-}
-
-
 void FixedArray::FixedArrayVerify() {
   for (int i = 0; i < length(); i++) {
     Object* e = get(i);
@@ -359,8 +322,7 @@
       double value = get_scalar(i);
       ASSERT(!isnan(value) ||
              (BitCast<uint64_t>(value) ==
-              BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())) ||
-             ((BitCast<uint64_t>(value) & Double::kSignMask) != 0));
+              BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())));
     }
   }
 }
@@ -374,53 +336,6 @@
 }
 
 
-void JSDate::JSDateVerify() {
-  if (value()->IsHeapObject()) {
-    VerifyHeapPointer(value());
-  }
-  CHECK(value()->IsUndefined() || value()->IsSmi() || value()->IsHeapNumber());
-  CHECK(year()->IsUndefined() || year()->IsSmi() || year()->IsNaN());
-  CHECK(month()->IsUndefined() || month()->IsSmi() || month()->IsNaN());
-  CHECK(day()->IsUndefined() || day()->IsSmi() || day()->IsNaN());
-  CHECK(weekday()->IsUndefined() || weekday()->IsSmi() || weekday()->IsNaN());
-  CHECK(hour()->IsUndefined() || hour()->IsSmi() || hour()->IsNaN());
-  CHECK(min()->IsUndefined() || min()->IsSmi() || min()->IsNaN());
-  CHECK(sec()->IsUndefined() || sec()->IsSmi() || sec()->IsNaN());
-  CHECK(cache_stamp()->IsUndefined() ||
-        cache_stamp()->IsSmi() ||
-        cache_stamp()->IsNaN());
-
-  if (month()->IsSmi()) {
-    int month = Smi::cast(this->month())->value();
-    CHECK(0 <= month && month <= 11);
-  }
-  if (day()->IsSmi()) {
-    int day = Smi::cast(this->day())->value();
-    CHECK(1 <= day && day <= 31);
-  }
-  if (hour()->IsSmi()) {
-    int hour = Smi::cast(this->hour())->value();
-    CHECK(0 <= hour && hour <= 23);
-  }
-  if (min()->IsSmi()) {
-    int min = Smi::cast(this->min())->value();
-    CHECK(0 <= min && min <= 59);
-  }
-  if (sec()->IsSmi()) {
-    int sec = Smi::cast(this->sec())->value();
-    CHECK(0 <= sec && sec <= 59);
-  }
-  if (weekday()->IsSmi()) {
-    int weekday = Smi::cast(this->weekday())->value();
-    CHECK(0 <= weekday && weekday <= 6);
-  }
-  if (cache_stamp()->IsSmi()) {
-    CHECK(Smi::cast(cache_stamp())->value() <=
-          Smi::cast(Isolate::Current()->date_cache()->stamp())->value());
-  }
-}
-
-
 void JSMessageObject::JSMessageObjectVerify() {
   CHECK(IsJSMessageObject());
   CHECK(type()->IsString());
@@ -452,7 +367,7 @@
   CHECK(this->first()->IsString());
   CHECK(this->second() == GetHeap()->empty_string() ||
         this->second()->IsString());
-  CHECK(this->length() >= ConsString::kMinLength);
+  CHECK(this->length() >= String::kMinNonFlatLength);
   if (this->IsFlat()) {
     // A flat cons can only be created by String::SlowTryFlatten.
     // Afterwards, the first part may be externalized.
@@ -472,7 +387,6 @@
   CHECK(IsJSFunction());
   VerifyObjectField(kPrototypeOrInitialMapOffset);
   VerifyObjectField(kNextFunctionLinkOffset);
-  CHECK(code()->IsCode());
   CHECK(next_function_link()->IsUndefined() ||
         next_function_link()->IsJSFunction());
 }
@@ -549,7 +463,6 @@
 void Code::CodeVerify() {
   CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()),
                   kCodeAlignment));
-  relocation_info()->Verify();
   Address last_gc_pc = NULL;
   for (RelocIterator it(this); !it.done(); it.next()) {
     it.rinfo()->Verify();
@@ -571,27 +484,11 @@
 }
 
 
-void JSSet::JSSetVerify() {
-  CHECK(IsJSSet());
-  JSObjectVerify();
-  VerifyHeapPointer(table());
-  ASSERT(table()->IsHashTable() || table()->IsUndefined());
-}
-
-
-void JSMap::JSMapVerify() {
-  CHECK(IsJSMap());
-  JSObjectVerify();
-  VerifyHeapPointer(table());
-  ASSERT(table()->IsHashTable() || table()->IsUndefined());
-}
-
-
 void JSWeakMap::JSWeakMapVerify() {
   CHECK(IsJSWeakMap());
   JSObjectVerify();
   VerifyHeapPointer(table());
-  ASSERT(table()->IsHashTable() || table()->IsUndefined());
+  ASSERT(table()->IsHashTable());
 }
 
 
@@ -638,14 +535,13 @@
 
 
 void JSProxy::JSProxyVerify() {
-  CHECK(IsJSProxy());
+  ASSERT(IsJSProxy());
   VerifyPointer(handler());
-  ASSERT(hash()->IsSmi() || hash()->IsUndefined());
 }
 
 
 void JSFunctionProxy::JSFunctionProxyVerify() {
-  CHECK(IsJSFunctionProxy());
+  ASSERT(IsJSFunctionProxy());
   JSProxyVerify();
   VerifyPointer(call_trap());
   VerifyPointer(construct_trap());
@@ -667,13 +563,6 @@
 }
 
 
-void AccessorPair::AccessorPairVerify() {
-  CHECK(IsAccessorPair());
-  VerifyPointer(getter());
-  VerifyPointer(setter());
-}
-
-
 void AccessCheckInfo::AccessCheckInfoVerify() {
   CHECK(IsAccessCheckInfo());
   VerifyPointer(named_callback());