Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: src/heap/store-buffer.cc

Issue 726713003: LayoutDescriptorHelper is now able to calculate the length of contiguous regions of tagged/non-tagg… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/layout-descriptor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 505 }
506 } 506 }
507 CHECK(page->owner() == heap_->old_pointer_space()); 507 CHECK(page->owner() == heap_->old_pointer_space());
508 HeapObjectIterator iterator(page, NULL); 508 HeapObjectIterator iterator(page, NULL);
509 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL; 509 for (HeapObject* heap_object = iterator.Next(); heap_object != NULL;
510 heap_object = iterator.Next()) { 510 heap_object = iterator.Next()) {
511 // We iterate over objects that contain new space pointers only. 511 // We iterate over objects that contain new space pointers only.
512 bool may_contain_raw_values = heap_object->MayContainRawValues(); 512 bool may_contain_raw_values = heap_object->MayContainRawValues();
513 if (!may_contain_raw_values) { 513 if (!may_contain_raw_values) {
514 Address obj_address = heap_object->address(); 514 Address obj_address = heap_object->address();
515 Address start_address = obj_address + HeapObject::kHeaderSize; 515 const int start_offset = HeapObject::kHeaderSize;
516 Address end_address = obj_address + heap_object->Size(); 516 const int end_offset = heap_object->Size();
517 #if V8_DOUBLE_FIELDS_UNBOXING 517 #if V8_DOUBLE_FIELDS_UNBOXING
518 InobjectPropertiesHelper helper(heap_object->map()); 518 LayoutDescriptorHelper helper(heap_object->map());
519 bool has_only_tagged_fields = helper.all_fields_tagged(); 519 bool has_only_tagged_fields = helper.all_fields_tagged();
520 520
521 if (!has_only_tagged_fields) { 521 if (!has_only_tagged_fields) {
522 for (Address slot = start_address; slot < end_address; 522 for (int offset = start_offset; offset < end_offset;) {
523 slot += kPointerSize) { 523 int end_of_region_offset;
524 if (helper.IsTagged(static_cast<int>(slot - obj_address))) { 524 if (helper.IsTagged(offset, end_offset,
525 // TODO(ishell): call this once for contiguous region 525 &end_of_region_offset)) {
526 // of tagged fields. 526 FindPointersToNewSpaceInRegion(
527 FindPointersToNewSpaceInRegion(slot, slot + kPointerSize, 527 obj_address + offset,
528 slot_callback, clear_maps); 528 obj_address + end_of_region_offset, slot_callback,
529 clear_maps);
529 } 530 }
531 offset = end_of_region_offset;
530 } 532 }
531 } else { 533 } else {
532 #endif 534 #endif
535 Address start_address = obj_address + start_offset;
536 Address end_address = obj_address + end_offset;
533 // Object has only tagged fields. 537 // Object has only tagged fields.
534 FindPointersToNewSpaceInRegion(start_address, end_address, 538 FindPointersToNewSpaceInRegion(start_address, end_address,
535 slot_callback, clear_maps); 539 slot_callback, clear_maps);
536 #if V8_DOUBLE_FIELDS_UNBOXING 540 #if V8_DOUBLE_FIELDS_UNBOXING
537 } 541 }
538 #endif 542 #endif
539 } 543 }
540 } 544 }
541 } 545 }
542 } 546 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 } 600 }
597 old_buffer_is_sorted_ = false; 601 old_buffer_is_sorted_ = false;
598 old_buffer_is_filtered_ = false; 602 old_buffer_is_filtered_ = false;
599 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2); 603 *old_top_++ = reinterpret_cast<Address>(int_addr << kPointerSizeLog2);
600 DCHECK(old_top_ <= old_limit_); 604 DCHECK(old_top_ <= old_limit_);
601 } 605 }
602 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); 606 heap_->isolate()->counters()->store_buffer_compactions()->Increment();
603 } 607 }
604 } 608 }
605 } // namespace v8::internal 609 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/layout-descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698