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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 #elif defined(V8_TARGET_ARCH_X64) | 74 #elif defined(V8_TARGET_ARCH_X64) |
75 #define LUMP_OF_MEMORY (2 * MB) | 75 #define LUMP_OF_MEMORY (2 * MB) |
76 code_range_size_(512*MB), | 76 code_range_size_(512*MB), |
77 #else | 77 #else |
78 #define LUMP_OF_MEMORY MB | 78 #define LUMP_OF_MEMORY MB |
79 code_range_size_(0), | 79 code_range_size_(0), |
80 #endif | 80 #endif |
81 reserved_semispace_size_(8 * Max(LUMP_OF_MEMORY, Page::kPageSize)), | 81 reserved_semispace_size_(8 * Max(LUMP_OF_MEMORY, Page::kPageSize)), |
82 max_semispace_size_(8 * Max(LUMP_OF_MEMORY, Page::kPageSize)), | 82 max_semispace_size_(8 * Max(LUMP_OF_MEMORY, Page::kPageSize)), |
83 initial_semispace_size_(Max(LUMP_OF_MEMORY, Page::kPageSize)), | 83 initial_semispace_size_(Max(LUMP_OF_MEMORY, Page::kPageSize)), |
84 max_old_generation_size_(1400ul * LUMP_OF_MEMORY), | 84 max_old_generation_size_(700ul * LUMP_OF_MEMORY), |
85 max_executable_size_(256l * LUMP_OF_MEMORY), | 85 max_executable_size_(128l * LUMP_OF_MEMORY), |
86 | 86 |
87 // Variables set based on semispace_size_ and old_generation_size_ in | 87 // Variables set based on semispace_size_ and old_generation_size_ in |
88 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) | 88 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
89 // Will be 4 * reserved_semispace_size_ to ensure that young | 89 // Will be 4 * reserved_semispace_size_ to ensure that young |
90 // generation can be aligned to its size. | 90 // generation can be aligned to its size. |
91 survived_since_last_expansion_(0), | 91 survived_since_last_expansion_(0), |
92 sweep_generation_(0), | 92 sweep_generation_(0), |
93 always_allocate_scope_depth_(0), | 93 always_allocate_scope_depth_(0), |
94 linear_allocation_scope_depth_(0), | 94 linear_allocation_scope_depth_(0), |
95 contexts_disposed_(0), | 95 contexts_disposed_(0), |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 if (FLAG_log_gc) new_space_.ReportStatistics(); | 357 if (FLAG_log_gc) new_space_.ReportStatistics(); |
358 #endif // DEBUG | 358 #endif // DEBUG |
359 } | 359 } |
360 | 360 |
361 | 361 |
362 void Heap::GarbageCollectionPrologue() { | 362 void Heap::GarbageCollectionPrologue() { |
363 isolate_->transcendental_cache()->Clear(); | 363 isolate_->transcendental_cache()->Clear(); |
364 ClearJSFunctionResultCaches(); | 364 ClearJSFunctionResultCaches(); |
365 gc_count_++; | 365 gc_count_++; |
366 unflattened_strings_length_ = 0; | 366 unflattened_strings_length_ = 0; |
| 367 |
367 #ifdef DEBUG | 368 #ifdef DEBUG |
368 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC); | 369 ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC); |
369 allow_allocation(false); | 370 allow_allocation(false); |
370 | 371 |
371 if (FLAG_verify_heap) { | 372 if (FLAG_verify_heap) { |
372 Verify(); | 373 Verify(); |
373 } | 374 } |
374 | 375 |
375 if (FLAG_gc_verbose) Print(); | 376 if (FLAG_gc_verbose) Print(); |
376 #endif // DEBUG | 377 #endif // DEBUG |
(...skipping 4665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5042 reserved_semispace_size_ >> 10); | 5043 reserved_semispace_size_ >> 10); |
5043 } | 5044 } |
5044 } | 5045 } |
5045 } else { | 5046 } else { |
5046 // If we are not using snapshots we reserve space for the actual | 5047 // If we are not using snapshots we reserve space for the actual |
5047 // max semispace size. | 5048 // max semispace size. |
5048 reserved_semispace_size_ = max_semispace_size_; | 5049 reserved_semispace_size_ = max_semispace_size_; |
5049 } | 5050 } |
5050 | 5051 |
5051 if (max_old_gen_size > 0) max_old_generation_size_ = max_old_gen_size; | 5052 if (max_old_gen_size > 0) max_old_generation_size_ = max_old_gen_size; |
| 5053 |
5052 if (max_executable_size > 0) { | 5054 if (max_executable_size > 0) { |
5053 max_executable_size_ = RoundUp(max_executable_size, Page::kPageSize); | 5055 max_executable_size_ = RoundUp(max_executable_size, Page::kPageSize); |
5054 } | 5056 } |
5055 | 5057 |
5056 // The max executable size must be less than or equal to the max old | 5058 // The max executable size must be less than or equal to the max old |
5057 // generation size. | 5059 // generation size. |
5058 if (max_executable_size_ > max_old_generation_size_) { | 5060 if (max_executable_size_ > max_old_generation_size_) { |
5059 max_executable_size_ = max_old_generation_size_; | 5061 max_executable_size_ = max_old_generation_size_; |
5060 } | 5062 } |
5061 | 5063 |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6347 } | 6349 } |
6348 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6350 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6349 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6351 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6350 next = chunk->next_chunk(); | 6352 next = chunk->next_chunk(); |
6351 isolate_->memory_allocator()->Free(chunk); | 6353 isolate_->memory_allocator()->Free(chunk); |
6352 } | 6354 } |
6353 chunks_queued_for_free_ = NULL; | 6355 chunks_queued_for_free_ = NULL; |
6354 } | 6356 } |
6355 | 6357 |
6356 } } // namespace v8::internal | 6358 } } // namespace v8::internal |
OLD | NEW |