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

Side by Side Diff: src/heap.cc

Issue 9124004: Backport hash collision workaround to 3.6. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.6/
Patch Set: Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5344 matching lines...) Expand 10 before | Expand all | Expand 10 after
5355 if (cell_space_ == NULL) return false; 5355 if (cell_space_ == NULL) return false;
5356 if (!cell_space_->Setup(NULL, 0)) return false; 5356 if (!cell_space_->Setup(NULL, 0)) return false;
5357 5357
5358 // The large object code space may contain code or data. We set the memory 5358 // The large object code space may contain code or data. We set the memory
5359 // to be non-executable here for safety, but this means we need to enable it 5359 // to be non-executable here for safety, but this means we need to enable it
5360 // explicitly when allocating large code objects. 5360 // explicitly when allocating large code objects.
5361 lo_space_ = new LargeObjectSpace(this, LO_SPACE); 5361 lo_space_ = new LargeObjectSpace(this, LO_SPACE);
5362 if (lo_space_ == NULL) return false; 5362 if (lo_space_ == NULL) return false;
5363 if (!lo_space_->Setup()) return false; 5363 if (!lo_space_->Setup()) return false;
5364 5364
5365 // Set up the seed that is used to randomize the string hash function.
5366 ASSERT(string_hash_seed() == 0);
5367 if (FLAG_randomize_string_hashes) {
5368 if (FLAG_string_hash_seed == 0) {
5369 set_string_hash_seed(
5370 Smi::FromInt(V8::RandomPrivate(isolate()) & 0x3fffffff));
5371 } else {
5372 set_string_hash_seed(Smi::FromInt(FLAG_string_hash_seed));
5373 }
5374 }
5375
5365 if (create_heap_objects) { 5376 if (create_heap_objects) {
5366 // Create initial maps. 5377 // Create initial maps.
5367 if (!CreateInitialMaps()) return false; 5378 if (!CreateInitialMaps()) return false;
5368 if (!CreateApiObjects()) return false; 5379 if (!CreateApiObjects()) return false;
5369 5380
5370 // Create initial objects 5381 // Create initial objects
5371 if (!CreateInitialObjects()) return false; 5382 if (!CreateInitialObjects()) return false;
5372 5383
5373 global_contexts_list_ = undefined_value(); 5384 global_contexts_list_ = undefined_value();
5374 } 5385 }
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
6275 } 6286 }
6276 6287
6277 6288
6278 void ExternalStringTable::TearDown() { 6289 void ExternalStringTable::TearDown() {
6279 new_space_strings_.Free(); 6290 new_space_strings_.Free();
6280 old_space_strings_.Free(); 6291 old_space_strings_.Free();
6281 } 6292 }
6282 6293
6283 6294
6284 } } // namespace v8::internal 6295 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698