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

Side by Side Diff: src/heap.cc

Issue 7684004: Fix test that uses the wrong kind of GC for testing weak references. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 4 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 | « no previous file | test/cctest/test-api.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 4775 matching lines...) Expand 10 before | Expand all | Expand 10 after
4786 max_executable_size_ = max_old_generation_size_; 4786 max_executable_size_ = max_old_generation_size_;
4787 } 4787 }
4788 4788
4789 // The new space size must be a power of two to support single-bit testing 4789 // The new space size must be a power of two to support single-bit testing
4790 // for containment. 4790 // for containment.
4791 max_semispace_size_ = RoundUpToPowerOf2(max_semispace_size_); 4791 max_semispace_size_ = RoundUpToPowerOf2(max_semispace_size_);
4792 reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_); 4792 reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_);
4793 initial_semispace_size_ = Min(initial_semispace_size_, max_semispace_size_); 4793 initial_semispace_size_ = Min(initial_semispace_size_, max_semispace_size_);
4794 external_allocation_limit_ = 10 * max_semispace_size_; 4794 external_allocation_limit_ = 10 * max_semispace_size_;
4795 4795
4796 // The old generation is paged. 4796 // The old generation is paged and needs at least one page for each space.
4797 max_old_generation_size_ = RoundUp(max_old_generation_size_, Page::kPageSize); 4797 int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1;
4798 max_old_generation_size_ = Max(paged_space_count * Page::kPageSize,
4799 RoundUp(max_old_generation_size_,
4800 Page::kPageSize));
4798 4801
4799 configured_ = true; 4802 configured_ = true;
4800 return true; 4803 return true;
4801 } 4804 }
4802 4805
4803 4806
4804 bool Heap::ConfigureHeapDefault() { 4807 bool Heap::ConfigureHeapDefault() {
4805 return ConfigureHeap(static_cast<intptr_t>(FLAG_max_new_space_size / 2) * KB, 4808 return ConfigureHeap(static_cast<intptr_t>(FLAG_max_new_space_size / 2) * KB,
4806 static_cast<intptr_t>(FLAG_max_old_space_size) * MB, 4809 static_cast<intptr_t>(FLAG_max_old_space_size) * MB,
4807 static_cast<intptr_t>(FLAG_max_executable_size) * MB); 4810 static_cast<intptr_t>(FLAG_max_executable_size) * MB);
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
6070 } 6073 }
6071 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 6074 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6072 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 6075 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
6073 next = chunk->next_chunk(); 6076 next = chunk->next_chunk();
6074 isolate_->memory_allocator()->Free(chunk); 6077 isolate_->memory_allocator()->Free(chunk);
6075 } 6078 }
6076 chunks_queued_for_free_ = NULL; 6079 chunks_queued_for_free_ = NULL;
6077 } 6080 }
6078 6081
6079 } } // namespace v8::internal 6082 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698