OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 86 matching lines...) Loading... |
97 old_pointer_space_(NULL), | 97 old_pointer_space_(NULL), |
98 old_data_space_(NULL), | 98 old_data_space_(NULL), |
99 code_space_(NULL), | 99 code_space_(NULL), |
100 map_space_(NULL), | 100 map_space_(NULL), |
101 cell_space_(NULL), | 101 cell_space_(NULL), |
102 lo_space_(NULL), | 102 lo_space_(NULL), |
103 gc_state_(NOT_IN_GC), | 103 gc_state_(NOT_IN_GC), |
104 gc_post_processing_depth_(0), | 104 gc_post_processing_depth_(0), |
105 ms_count_(0), | 105 ms_count_(0), |
106 gc_count_(0), | 106 gc_count_(0), |
| 107 remembered_unmapped_pages_index_(0), |
107 unflattened_strings_length_(0), | 108 unflattened_strings_length_(0), |
108 #ifdef DEBUG | 109 #ifdef DEBUG |
109 allocation_allowed_(true), | 110 allocation_allowed_(true), |
110 allocation_timeout_(0), | 111 allocation_timeout_(0), |
111 disallow_allocation_failure_(false), | 112 disallow_allocation_failure_(false), |
112 debug_utils_(NULL), | 113 debug_utils_(NULL), |
113 #endif // DEBUG | 114 #endif // DEBUG |
114 new_space_high_promotion_mode_active_(false), | 115 new_space_high_promotion_mode_active_(false), |
115 old_gen_promotion_limit_(kMinimumPromotionLimit), | 116 old_gen_promotion_limit_(kMinimumPromotionLimit), |
116 old_gen_allocation_limit_(kMinimumAllocationLimit), | 117 old_gen_allocation_limit_(kMinimumAllocationLimit), |
(...skipping 6847 matching lines...) Loading... |
6964 } | 6965 } |
6965 isolate_->heap()->store_buffer()->Compact(); | 6966 isolate_->heap()->store_buffer()->Compact(); |
6966 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6967 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6967 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6968 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6968 next = chunk->next_chunk(); | 6969 next = chunk->next_chunk(); |
6969 isolate_->memory_allocator()->Free(chunk); | 6970 isolate_->memory_allocator()->Free(chunk); |
6970 } | 6971 } |
6971 chunks_queued_for_free_ = NULL; | 6972 chunks_queued_for_free_ = NULL; |
6972 } | 6973 } |
6973 | 6974 |
| 6975 |
| 6976 void Heap::RememberUnmappedPage(Address page, bool compacted) { |
| 6977 uintptr_t p = reinterpret_cast<uintptr_t>(page); |
| 6978 // Tag the page pointer to make it findable in the dump file. |
| 6979 if (compacted) { |
| 6980 p ^= 0xc1ead & (Page::kPageSize - 1); // Cleared. |
| 6981 } else { |
| 6982 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. |
| 6983 } |
| 6984 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = |
| 6985 reinterpret_cast<Address>(p); |
| 6986 remembered_unmapped_pages_index_++; |
| 6987 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; |
| 6988 } |
| 6989 |
6974 } } // namespace v8::internal | 6990 } } // namespace v8::internal |
OLD | NEW |