| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 MemoryChunk* previous_chunk = NULL; | 217 MemoryChunk* previous_chunk = NULL; |
| 218 for (Address* p = old_start_; p < old_top_; p += prime_sample_step) { | 218 for (Address* p = old_start_; p < old_top_; p += prime_sample_step) { |
| 219 Address addr = *p; | 219 Address addr = *p; |
| 220 MemoryChunk* containing_chunk = NULL; | 220 MemoryChunk* containing_chunk = NULL; |
| 221 if (previous_chunk != NULL && previous_chunk->Contains(addr)) { | 221 if (previous_chunk != NULL && previous_chunk->Contains(addr)) { |
| 222 containing_chunk = previous_chunk; | 222 containing_chunk = previous_chunk; |
| 223 } else { | 223 } else { |
| 224 containing_chunk = MemoryChunk::FromAnyPointerAddress(heap_, addr); | 224 containing_chunk = MemoryChunk::FromAnyPointerAddress(heap_, addr); |
| 225 } | 225 } |
| 226 int old_counter = containing_chunk->store_buffer_counter(); | 226 int old_counter = containing_chunk->store_buffer_counter(); |
| 227 if (old_counter == threshold) { | 227 if (old_counter >= threshold) { |
| 228 containing_chunk->set_scan_on_scavenge(true); | 228 containing_chunk->set_scan_on_scavenge(true); |
| 229 created_new_scan_on_scavenge_pages = true; | 229 created_new_scan_on_scavenge_pages = true; |
| 230 } | 230 } |
| 231 containing_chunk->set_store_buffer_counter(old_counter + 1); | 231 containing_chunk->set_store_buffer_counter(old_counter + 1); |
| 232 previous_chunk = containing_chunk; | 232 previous_chunk = containing_chunk; |
| 233 } | 233 } |
| 234 if (created_new_scan_on_scavenge_pages) { | 234 if (created_new_scan_on_scavenge_pages) { |
| 235 Filter(MemoryChunk::SCAN_ON_SCAVENGE); | 235 Filter(MemoryChunk::SCAN_ON_SCAVENGE); |
| 236 } | 236 } |
| 237 old_buffer_is_filtered_ = true; | 237 old_buffer_is_filtered_ = true; |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } | 724 } |
| 725 old_buffer_is_sorted_ = false; | 725 old_buffer_is_sorted_ = false; |
| 726 old_buffer_is_filtered_ = false; | 726 old_buffer_is_filtered_ = false; |
| 727 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 727 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
| 728 ASSERT(old_top_ <= old_limit_); | 728 ASSERT(old_top_ <= old_limit_); |
| 729 } | 729 } |
| 730 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 730 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 } } // namespace v8::internal | 733 } } // namespace v8::internal |
| OLD | NEW |