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

Side by Side Diff: src/heap/heap.cc

Issue 1301583003: Make heap.h usable without objects-inl.h header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-includes-heap-3
Patch Set: Simplify scavenger dispatch. Created 5 years, 4 months 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/heap.h ('k') | src/heap/heap-inl.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 2525
2526 MapWord first_word = first->map_word(); 2526 MapWord first_word = first->map_word();
2527 if (first_word.IsForwardingAddress()) { 2527 if (first_word.IsForwardingAddress()) {
2528 HeapObject* target = first_word.ToForwardingAddress(); 2528 HeapObject* target = first_word.ToForwardingAddress();
2529 2529
2530 *slot = target; 2530 *slot = target;
2531 object->set_map_word(MapWord::FromForwardingAddress(target)); 2531 object->set_map_word(MapWord::FromForwardingAddress(target));
2532 return; 2532 return;
2533 } 2533 }
2534 2534
2535 heap->DoScavengeObject(first->map(), slot, first); 2535 Heap::ScavengeObjectSlow(slot, first);
2536 object->set_map_word(MapWord::FromForwardingAddress(*slot)); 2536 object->set_map_word(MapWord::FromForwardingAddress(*slot));
2537 return; 2537 return;
2538 } 2538 }
2539 2539
2540 int object_size = ConsString::kSize; 2540 int object_size = ConsString::kSize;
2541 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object, 2541 EvacuateObject<POINTER_OBJECT, kWordAligned>(map, slot, object,
2542 object_size); 2542 object_size);
2543 } 2543 }
2544 2544
2545 template <ObjectContents object_contents> 2545 template <ObjectContents object_contents>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 } 2615 }
2616 } 2616 }
2617 } 2617 }
2618 2618
2619 2619
2620 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) { 2620 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) {
2621 SLOW_DCHECK(object->GetIsolate()->heap()->InFromSpace(object)); 2621 SLOW_DCHECK(object->GetIsolate()->heap()->InFromSpace(object));
2622 MapWord first_word = object->map_word(); 2622 MapWord first_word = object->map_word();
2623 SLOW_DCHECK(!first_word.IsForwardingAddress()); 2623 SLOW_DCHECK(!first_word.IsForwardingAddress());
2624 Map* map = first_word.ToMap(); 2624 Map* map = first_word.ToMap();
2625 map->GetHeap()->DoScavengeObject(map, p, object); 2625 map->GetHeap()->scavenging_visitors_table_.GetVisitor(map)(map, p, object);
2626 } 2626 }
2627 2627
2628 2628
2629 void Heap::ConfigureInitialOldGenerationSize() { 2629 void Heap::ConfigureInitialOldGenerationSize() {
2630 if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) { 2630 if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) {
2631 old_generation_allocation_limit_ = 2631 old_generation_allocation_limit_ =
2632 Max(kMinimumOldGenerationAllocationLimit, 2632 Max(kMinimumOldGenerationAllocationLimit,
2633 static_cast<intptr_t>( 2633 static_cast<intptr_t>(
2634 static_cast<double>(old_generation_allocation_limit_) * 2634 static_cast<double>(old_generation_allocation_limit_) *
2635 (tracer()->AverageSurvivalRatio() / 100))); 2635 (tracer()->AverageSurvivalRatio() / 100)));
(...skipping 4282 matching lines...) Expand 10 before | Expand all | Expand 10 after
6918 *object_type = "CODE_TYPE"; \ 6918 *object_type = "CODE_TYPE"; \
6919 *object_sub_type = "CODE_AGE/" #name; \ 6919 *object_sub_type = "CODE_AGE/" #name; \
6920 return true; 6920 return true;
6921 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6921 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6922 #undef COMPARE_AND_RETURN_NAME 6922 #undef COMPARE_AND_RETURN_NAME
6923 } 6923 }
6924 return false; 6924 return false;
6925 } 6925 }
6926 } // namespace internal 6926 } // namespace internal
6927 } // namespace v8 6927 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698