Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1231)

Unified Diff: src/isolate.cc

Issue 9083001: Use a random seed for the string hash algorithm. Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
===================================================================
--- src/isolate.cc (revision 10321)
+++ src/isolate.cc (working copy)
@@ -1437,7 +1437,8 @@
has_installed_extensions_(false),
string_tracker_(NULL),
regexp_stack_(NULL),
- embedder_data_(NULL) {
+ embedder_data_(NULL),
+ hasher_seed_(0) {
TRACE_ISOLATE(constructor);
memset(isolate_addresses_, 0,
@@ -1733,6 +1734,16 @@
regexp_stack_ = new RegExpStack();
regexp_stack_->isolate_ = this;
+ // Setup the seed that is used to randomize the string hash function.
+ ASSERT(hasher_seed_ == 0);
+ if (FLAG_randomize_string_hashes) {
+ if (FLAG_string_hash_seed == 0) {
+ hasher_seed_ = V8::RandomPrivate(this);
+ } else {
+ hasher_seed_ = FLAG_string_hash_seed;
+ }
+ }
+
// Enable logging before setting up the heap
logger_->Setup();
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698