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

Side by Side Diff: src/heap.cc

Issue 9155010: Minor cleanups of numeric seeded hashing patch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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
« no previous file with comments | « src/heap.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5626 matching lines...) Expand 10 before | Expand all | Expand 10 after
5637 if (!cell_space_->Setup()) return false; 5637 if (!cell_space_->Setup()) return false;
5638 5638
5639 // The large object code space may contain code or data. We set the memory 5639 // The large object code space may contain code or data. We set the memory
5640 // to be non-executable here for safety, but this means we need to enable it 5640 // to be non-executable here for safety, but this means we need to enable it
5641 // explicitly when allocating large code objects. 5641 // explicitly when allocating large code objects.
5642 lo_space_ = new LargeObjectSpace(this, max_old_generation_size_, LO_SPACE); 5642 lo_space_ = new LargeObjectSpace(this, max_old_generation_size_, LO_SPACE);
5643 if (lo_space_ == NULL) return false; 5643 if (lo_space_ == NULL) return false;
5644 if (!lo_space_->Setup()) return false; 5644 if (!lo_space_->Setup()) return false;
5645 5645
5646 // Setup the seed that is used to randomize the string hash function. 5646 // Setup the seed that is used to randomize the string hash function.
5647 ASSERT(string_hash_seed() == 0); 5647 ASSERT(hash_seed() == 0);
5648 if (FLAG_randomize_string_hashes) { 5648 if (FLAG_randomize_hashes) {
5649 if (FLAG_string_hash_seed == 0) { 5649 if (FLAG_hash_seed == 0) {
5650 set_string_hash_seed( 5650 set_hash_seed(
5651 Smi::FromInt(V8::RandomPrivate(isolate()) & 0x3fffffff)); 5651 Smi::FromInt(V8::RandomPrivate(isolate()) & 0x3fffffff));
5652 } else { 5652 } else {
5653 set_string_hash_seed(Smi::FromInt(FLAG_string_hash_seed)); 5653 set_hash_seed(Smi::FromInt(FLAG_hash_seed));
5654 } 5654 }
5655 } 5655 }
5656 5656
5657 if (create_heap_objects) { 5657 if (create_heap_objects) {
5658 // Create initial maps. 5658 // Create initial maps.
5659 if (!CreateInitialMaps()) return false; 5659 if (!CreateInitialMaps()) return false;
5660 if (!CreateApiObjects()) return false; 5660 if (!CreateApiObjects()) return false;
5661 5661
5662 // Create initial objects 5662 // Create initial objects
5663 if (!CreateInitialObjects()) return false; 5663 if (!CreateInitialObjects()) return false;
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
6619 isolate_->heap()->store_buffer()->Compact(); 6619 isolate_->heap()->store_buffer()->Compact();
6620 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 6620 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6621 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 6621 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
6622 next = chunk->next_chunk(); 6622 next = chunk->next_chunk();
6623 isolate_->memory_allocator()->Free(chunk); 6623 isolate_->memory_allocator()->Free(chunk);
6624 } 6624 }
6625 chunks_queued_for_free_ = NULL; 6625 chunks_queued_for_free_ = NULL;
6626 } 6626 }
6627 6627
6628 } } // namespace v8::internal 6628 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698