| OLD | NEW |
| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #elif defined(V8_TARGET_ARCH_X64) | 77 #elif defined(V8_TARGET_ARCH_X64) |
| 78 reserved_semispace_size_(16*MB), | 78 reserved_semispace_size_(16*MB), |
| 79 max_semispace_size_(16*MB), | 79 max_semispace_size_(16*MB), |
| 80 initial_semispace_size_(1*MB), | 80 initial_semispace_size_(1*MB), |
| 81 max_old_generation_size_(1*GB), | 81 max_old_generation_size_(1*GB), |
| 82 max_executable_size_(256*MB), | 82 max_executable_size_(256*MB), |
| 83 code_range_size_(512*MB), | 83 code_range_size_(512*MB), |
| 84 #else | 84 #else |
| 85 reserved_semispace_size_(4*MB), | 85 reserved_semispace_size_(4*MB), |
| 86 max_semispace_size_(4*MB), | 86 max_semispace_size_(4*MB), |
| 87 initial_semispace_size_(512*KB), | 87 initial_semispace_size_(1*MB), |
| 88 max_old_generation_size_(512*MB), | 88 max_old_generation_size_(512*MB), |
| 89 max_executable_size_(128*MB), | 89 max_executable_size_(128*MB), |
| 90 code_range_size_(0), | 90 code_range_size_(0), |
| 91 #endif | 91 #endif |
| 92 // Variables set based on semispace_size_ and old_generation_size_ in | 92 // Variables set based on semispace_size_ and old_generation_size_ in |
| 93 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) | 93 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
| 94 // Will be 4 * reserved_semispace_size_ to ensure that young | 94 // Will be 4 * reserved_semispace_size_ to ensure that young |
| 95 // generation can be aligned to its size. | 95 // generation can be aligned to its size. |
| 96 survived_since_last_expansion_(0), | 96 survived_since_last_expansion_(0), |
| 97 always_allocate_scope_depth_(0), | 97 always_allocate_scope_depth_(0), |
| (...skipping 4539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4637 | 4637 |
| 4638 | 4638 |
| 4639 // TODO(1236194): Since the heap size is configurable on the command line | 4639 // TODO(1236194): Since the heap size is configurable on the command line |
| 4640 // and through the API, we should gracefully handle the case that the heap | 4640 // and through the API, we should gracefully handle the case that the heap |
| 4641 // size is not big enough to fit all the initial objects. | 4641 // size is not big enough to fit all the initial objects. |
| 4642 bool Heap::ConfigureHeap(intptr_t max_semispace_size, | 4642 bool Heap::ConfigureHeap(intptr_t max_semispace_size, |
| 4643 intptr_t max_old_gen_size, | 4643 intptr_t max_old_gen_size, |
| 4644 intptr_t max_executable_size) { | 4644 intptr_t max_executable_size) { |
| 4645 if (HasBeenSetup()) return false; | 4645 if (HasBeenSetup()) return false; |
| 4646 | 4646 |
| 4647 if (max_semispace_size > 0) max_semispace_size_ = max_semispace_size; | 4647 if (max_semispace_size > 0) { |
| 4648 if (max_semispace_size < Page::kPageSize) { |
| 4649 max_semispace_size = Page::kPageSize; |
| 4650 } |
| 4651 max_semispace_size_ = max_semispace_size; |
| 4652 } |
| 4648 | 4653 |
| 4649 if (Snapshot::IsEnabled()) { | 4654 if (Snapshot::IsEnabled()) { |
| 4650 // If we are using a snapshot we always reserve the default amount | 4655 // If we are using a snapshot we always reserve the default amount |
| 4651 // of memory for each semispace because code in the snapshot has | 4656 // of memory for each semispace because code in the snapshot has |
| 4652 // write-barrier code that relies on the size and alignment of new | 4657 // write-barrier code that relies on the size and alignment of new |
| 4653 // space. We therefore cannot use a larger max semispace size | 4658 // space. We therefore cannot use a larger max semispace size |
| 4654 // than the default reserved semispace size. | 4659 // than the default reserved semispace size. |
| 4655 if (max_semispace_size_ > reserved_semispace_size_) { | 4660 if (max_semispace_size_ > reserved_semispace_size_) { |
| 4656 max_semispace_size_ = reserved_semispace_size_; | 4661 max_semispace_size_ = reserved_semispace_size_; |
| 4657 } | 4662 } |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5885 } | 5890 } |
| 5886 | 5891 |
| 5887 | 5892 |
| 5888 void ExternalStringTable::TearDown() { | 5893 void ExternalStringTable::TearDown() { |
| 5889 new_space_strings_.Free(); | 5894 new_space_strings_.Free(); |
| 5890 old_space_strings_.Free(); | 5895 old_space_strings_.Free(); |
| 5891 } | 5896 } |
| 5892 | 5897 |
| 5893 | 5898 |
| 5894 } } // namespace v8::internal | 5899 } } // namespace v8::internal |
| OLD | NEW |