Version 3.8.5

Fix broken test that assumes that no GC can clear the regexp cache (GC can happen at any time due to Crankshaft).

Fix handling of bogus receivers for Harmony collections. (issue 1884)

Add netbsd support to gyp build.

Determine page size at runtime on posix platforms.

Ensure that store buffer filtering hash sets are cleared after StoreBuffer::Filter.

Randomize the seed used for string hashing.  This helps guard against CPU-eating DOS attacks against node.js servers.  Based on code from Bert Belder.  This version only solves the issue for those that compile V8 themselves or those that do not use snapshots.  A snapshot-based precompiled V8 will still have predictable string hash codes.

Implement callback when script finishes running in V8 API.

Improve performance of Math.min and Math.max for the case of two arguments. (issue 1325)

git-svn-id: http://v8.googlecode.com/svn/trunk@10346 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/heap.cc b/src/heap.cc
index 5984834..31cd889 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2318,6 +2318,10 @@
   }
   set_infinity_value(HeapNumber::cast(obj));
 
+  // The hole has not been created yet, but we want to put something
+  // predictable in the gaps in the symbol table, so lets make that Smi zero.
+  set_the_hole_value(reinterpret_cast<Oddball*>(Smi::FromInt(0)));
+
   // Allocate initial symbol table.
   { MaybeObject* maybe_obj = SymbolTable::Allocate(kInitialSymbolTableSize);
     if (!maybe_obj->ToObject(&obj)) return false;
@@ -5638,6 +5642,18 @@
   lo_space_ = new LargeObjectSpace(this, max_old_generation_size_, LO_SPACE);
   if (lo_space_ == NULL) return false;
   if (!lo_space_->Setup()) return false;
+
+  // Setup the seed that is used to randomize the string hash function.
+  ASSERT(string_hash_seed() == 0);
+  if (FLAG_randomize_string_hashes) {
+    if (FLAG_string_hash_seed == 0) {
+      set_string_hash_seed(
+          Smi::FromInt(V8::RandomPrivate(isolate()) & 0x3fffffff));
+    } else {
+      set_string_hash_seed(Smi::FromInt(FLAG_string_hash_seed));
+    }
+  }
+
   if (create_heap_objects) {
     // Create initial maps.
     if (!CreateInitialMaps()) return false;