| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback callback) { | 364 void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback callback) { |
| 365 // We do not sort or remove duplicated entries from the store buffer because | 365 // We do not sort or remove duplicated entries from the store buffer because |
| 366 // we expect that callback will rebuild the store buffer thus removing | 366 // we expect that callback will rebuild the store buffer thus removing |
| 367 // all duplicates and pointers to old space. | 367 // all duplicates and pointers to old space. |
| 368 bool some_pages_to_scan = PrepareForIteration(); | 368 bool some_pages_to_scan = PrepareForIteration(); |
| 369 | 369 |
| 370 Address* limit = old_top_; | 370 Address* limit = old_top_; |
| 371 old_top_ = old_start_; | 371 old_top_ = old_start_; |
| 372 { | 372 { |
| 373 DontMoveStoreBufferEntriesScope scope(this); | 373 DontMoveStoreBufferEntriesScope scope(this); |
| 374 if (FLAG_trace_gc) { | |
| 375 PrintF("Store buffer: %d entries\n", limit - old_start_); | |
| 376 } | |
| 377 for (Address* current = old_start_; current < limit; current++) { | 374 for (Address* current = old_start_; current < limit; current++) { |
| 378 #ifdef DEBUG | 375 #ifdef DEBUG |
| 379 Address* saved_top = old_top_; | 376 Address* saved_top = old_top_; |
| 380 #endif | 377 #endif |
| 381 Object** cell = reinterpret_cast<Object**>(*current); | 378 Object** cell = reinterpret_cast<Object**>(*current); |
| 382 Object* object = *cell; | 379 Object* object = *cell; |
| 383 // May be invalid if object is not in new space. | 380 // May be invalid if object is not in new space. |
| 384 HeapObject* heap_object = reinterpret_cast<HeapObject*>(object); | 381 HeapObject* heap_object = reinterpret_cast<HeapObject*>(object); |
| 385 if (heap_->InFromSpace(object)) { | 382 if (heap_->InFromSpace(object)) { |
| 386 callback(reinterpret_cast<HeapObject**>(cell), heap_object); | 383 callback(reinterpret_cast<HeapObject**>(cell), heap_object); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 } | 478 } |
| 482 | 479 |
| 483 | 480 |
| 484 void StoreBuffer::CheckForFullBuffer() { | 481 void StoreBuffer::CheckForFullBuffer() { |
| 485 if (old_limit_ - old_top_ < kStoreBufferSize * 2) { | 482 if (old_limit_ - old_top_ < kStoreBufferSize * 2) { |
| 486 HandleFullness(); | 483 HandleFullness(); |
| 487 } | 484 } |
| 488 } | 485 } |
| 489 | 486 |
| 490 } } // namespace v8::internal | 487 } } // namespace v8::internal |
| OLD | NEW |