Chromium Code Reviews| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 bool may_contain_raw_values = heap_object->MayContainRawValues(); |
| 511 if (!may_contain_raw_values) { | 511 if (!may_contain_raw_values) { |
| 512 Address obj_address = heap_object->address(); | 512 Address obj_address = heap_object->address(); |
| 513 Address start_address = obj_address + HeapObject::kHeaderSize; | 513 const int start_offset = HeapObject::kHeaderSize; |
| 514 Address end_address = obj_address + heap_object->Size(); | 514 const int end_offset = heap_object->Size(); |
| 515 #if V8_DOUBLE_FIELDS_UNBOXING | 515 #if V8_DOUBLE_FIELDS_UNBOXING |
| 516 InobjectPropertiesHelper helper(heap_object->map()); | 516 LayoutDescriptorHelper helper(heap_object->map()); |
| 517 bool has_only_tagged_fields = helper.all_fields_tagged(); | 517 bool has_only_tagged_fields = helper.all_fields_tagged(); |
| 518 | 518 |
| 519 if (!has_only_tagged_fields) { | 519 if (!has_only_tagged_fields) { |
| 520 for (Address slot = start_address; slot < end_address; | 520 for (int offset = start_offset; offset < end_offset;) { |
| 521 slot += kPointerSize) { | 521 int end_of_region_offset; |
| 522 if (helper.IsTagged(static_cast<int>(slot - obj_address))) { | 522 if (helper.IsTagged(offset, end_offset, |
| 523 // TODO(ishell): call this once for contiguous region | 523 &end_of_region_offset)) { |
| 524 // of tagged fields. | 524 FindPointersToNewSpaceInRegion( |
| 525 FindPointersToNewSpaceInRegion(slot, slot + kPointerSize, | 525 obj_address + offset, |
| 526 slot_callback, clear_maps); | 526 obj_address + end_of_region_offset, slot_callback, |
| 527 clear_maps); | |
| 527 } | 528 } |
| 529 DCHECK(offset < end_of_region_offset); | |
|
Hannes Payer (out of office)
2014/11/25 17:20:13
I think that DCHECK should be in the IsTagged func
Igor Sheludko
2014/12/10 18:22:04
Done.
| |
| 530 offset = end_of_region_offset; | |
| 528 } | 531 } |
| 529 } else { | 532 } else { |
| 530 #endif | 533 #endif |
| 534 Address start_address = obj_address + start_offset; | |
| 535 Address end_address = obj_address + end_offset; | |
| 531 // Object has only tagged fields. | 536 // Object has only tagged fields. |
| 532 FindPointersToNewSpaceInRegion(start_address, end_address, | 537 FindPointersToNewSpaceInRegion(start_address, end_address, |
| 533 slot_callback, clear_maps); | 538 slot_callback, clear_maps); |
| 534 #if V8_DOUBLE_FIELDS_UNBOXING | 539 #if V8_DOUBLE_FIELDS_UNBOXING |
| 535 } | 540 } |
| 536 #endif | 541 #endif |
| 537 } | 542 } |
| 538 } | 543 } |
| 539 } | 544 } |
| 540 } | 545 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 } | 599 } |
| 595 old_buffer_is_sorted_ = false; | 600 old_buffer_is_sorted_ = false; |
| 596 old_buffer_is_filtered_ = false; | 601 old_buffer_is_filtered_ = false; |
| 597 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); | 602 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); |
| 598 DCHECK(old_top_ <= old_limit_); | 603 DCHECK(old_top_ <= old_limit_); |
| 599 } | 604 } |
| 600 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); | 605 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); |
| 601 } | 606 } |
| 602 } | 607 } |
| 603 } // namespace v8::internal | 608 } // namespace v8::internal |
| OLD | NEW |