OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/counters.h" | 10 #include "src/counters.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 // TODO(hpayer): This may introduce a huge pause here. We | 500 // TODO(hpayer): This may introduce a huge pause here. We |
501 // just care about finish sweeping of the scan on scavenge page. | 501 // just care about finish sweeping of the scan on scavenge page. |
502 heap_->mark_compact_collector()->EnsureSweepingCompleted(); | 502 heap_->mark_compact_collector()->EnsureSweepingCompleted(); |
503 } | 503 } |
504 } | 504 } |
505 CHECK(page->owner() == heap_->old_pointer_space()); | 505 CHECK(page->owner() == heap_->old_pointer_space()); |
506 HeapObjectIterator iterator(page, NULL); | 506 HeapObjectIterator iterator(page, NULL); |
507 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; | 507 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; |
508 heap_object = iterator.Next()) { | 508 heap_object = iterator.Next()) { |
509 // We iterate over objects that contain new space pointers only. | 509 // We iterate over objects that contain new space pointers only. |
510 bool may_contain_raw_values = heap_object->MayContainRawValues(); | 510 if (!heap_object->MayContainRawValues()) { |
511 if (!may_contain_raw_values) { | 511 FindPointersToNewSpaceInRegion( |
512 Address obj_address = heap_object->address(); | 512 heap_object->address() + HeapObject::kHeaderSize, |
513 Address start_address = obj_address + HeapObject::kHeaderSize; | 513 heap_object->address() + heap_object->Size(), slot_callback, |
514 Address end_address = obj_address + heap_object->Size(); | 514 clear_maps); |
515 #if V8_DOUBLE_FIELDS_UNBOXING | |
516 InobjectPropertiesHelper helper(heap_object->map()); | |
517 bool has_only_tagged_fields = helper.all_fields_tagged(); | |
518 | |
519 if (!has_only_tagged_fields) { | |
520 for (Address slot = start_address; slot < end_address; | |
521 slot += kPointerSize) { | |
522 if (helper.IsTagged(slot - obj_address)) { | |
523 // TODO(ishell): call this once for contiguous region | |
524 // of tagged fields. | |
525 FindPointersToNewSpaceInRegion(slot, slot + kPointerSize, | |
526 slot_callback, clear_maps); | |
527 } | |
528 } | |
529 } else { | |
530 #endif | |
531 // Object has only tagged fields. | |
532 FindPointersToNewSpaceInRegion(start_address, end_address, | |
533 slot_callback, clear_maps); | |
534 #if V8_DOUBLE_FIELDS_UNBOXING | |
535 } | |
536 #endif | |
537 } | 515 } |
538 } | 516 } |
539 } | 517 } |
540 } | 518 } |
541 } | 519 } |
542 } | 520 } |
543 if (callback_ != NULL) { | 521 if (callback_ != NULL) { |
544 (*callback_)(heap_, NULL, kStoreBufferScanningPageEvent); | 522 (*callback_)(heap_, NULL, kStoreBufferScanningPageEvent); |
545 } | 523 } |
546 } | 524 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } | 572 } |
595 old_buffer_is_sorted_ = false; | 573 old_buffer_is_sorted_ = false; |
596 old_buffer_is_filtered_ = false; | 574 old_buffer_is_filtered_ = false; |
597 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 575 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
598 DCHECK(old_top_ <= old_limit_); | 576 DCHECK(old_top_ <= old_limit_); |
599 } | 577 } |
600 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 578 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
601 } | 579 } |
602 } | 580 } |
603 } // namespace v8::internal | 581 } // namespace v8::internal |
OLD | NEW |