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 if (!heap_object->MayContainRawValues()) { | 510 bool may_contain_raw_values = heap_object->MayContainRawValues(); |
511 FindPointersToNewSpaceInRegion( | 511 if (!may_contain_raw_values) { |
512 heap_object->address() + HeapObject::kHeaderSize, | 512 Address obj_address = heap_object->address(); |
513 heap_object->address() + heap_object->Size(), slot_callback, | 513 Address start_address = obj_address + HeapObject::kHeaderSize; |
514 clear_maps); | 514 Address end_address = obj_address + heap_object->Size(); |
| 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 |
515 } | 537 } |
516 } | 538 } |
517 } | 539 } |
518 } | 540 } |
519 } | 541 } |
520 } | 542 } |
521 if (callback_ != NULL) { | 543 if (callback_ != NULL) { |
522 (*callback_)(heap_, NULL, kStoreBufferScanningPageEvent); | 544 (*callback_)(heap_, NULL, kStoreBufferScanningPageEvent); |
523 } | 545 } |
524 } | 546 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 } | 594 } |
573 old_buffer_is_sorted_ = false; | 595 old_buffer_is_sorted_ = false; |
574 old_buffer_is_filtered_ = false; | 596 old_buffer_is_filtered_ = false; |
575 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 597 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
576 DCHECK(old_top_ <= old_limit_); | 598 DCHECK(old_top_ <= old_limit_); |
577 } | 599 } |
578 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 600 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
579 } | 601 } |
580 } | 602 } |
581 } // namespace v8::internal | 603 } // namespace v8::internal |
OLD | NEW |