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

Side by Side Diff: src/heap.cc

Issue 294903003: Reland "Fix Heap::IsHeapIterable." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handlify IterateJSFunctions in LiveEdit Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/heap-profiler.cc » ('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 "v8.h" 5 #include "v8.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "api.h" 8 #include "api.h"
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "codegen.h" 10 #include "codegen.h"
(...skipping 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after
4314 { AllocationResult allocation = Allocate(map, space); 4314 { AllocationResult allocation = Allocate(map, space);
4315 if (!allocation.To(&result)) return allocation; 4315 if (!allocation.To(&result)) return allocation;
4316 } 4316 }
4317 result->InitializeBody(size); 4317 result->InitializeBody(size);
4318 return result; 4318 return result;
4319 } 4319 }
4320 4320
4321 4321
4322 bool Heap::IsHeapIterable() { 4322 bool Heap::IsHeapIterable() {
4323 return (!old_pointer_space()->was_swept_conservatively() && 4323 return (!old_pointer_space()->was_swept_conservatively() &&
4324 !old_data_space()->was_swept_conservatively()); 4324 !old_data_space()->was_swept_conservatively() &&
4325 new_space()->bottom() == new_space()->top());
4325 } 4326 }
4326 4327
4327 4328
4328 void Heap::EnsureHeapIsIterable() { 4329 void Heap::MakeHeapIterable() {
4329 ASSERT(AllowHeapAllocation::IsAllowed()); 4330 ASSERT(AllowHeapAllocation::IsAllowed());
4330 if (!IsHeapIterable()) { 4331 if (!IsHeapIterable()) {
4331 CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable"); 4332 CollectAllGarbage(kMakeHeapIterableMask, "Heap::MakeHeapIterable");
4332 } 4333 }
4333 ASSERT(IsHeapIterable()); 4334 ASSERT(IsHeapIterable());
4334 } 4335 }
4335 4336
4336 4337
4337 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { 4338 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
4338 incremental_marking()->Step(step_size, 4339 incremental_marking()->Step(step_size,
4339 IncrementalMarking::NO_GC_VIA_STACK_GUARD); 4340 IncrementalMarking::NO_GC_VIA_STACK_GUARD);
4340 4341
4341 if (incremental_marking()->IsComplete()) { 4342 if (incremental_marking()->IsComplete()) {
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
5725 heap_->IterateRoots(&visitor, VISIT_ALL); 5726 heap_->IterateRoots(&visitor, VISIT_ALL);
5726 visitor.TransitiveClosure(); 5727 visitor.TransitiveClosure();
5727 } 5728 }
5728 5729
5729 Heap* heap_; 5730 Heap* heap_;
5730 DisallowHeapAllocation no_allocation_; 5731 DisallowHeapAllocation no_allocation_;
5731 }; 5732 };
5732 5733
5733 5734
5734 HeapIterator::HeapIterator(Heap* heap) 5735 HeapIterator::HeapIterator(Heap* heap)
5735 : heap_(heap), 5736 : make_heap_iterable_helper_(heap),
5737 no_heap_allocation_(),
5738 heap_(heap),
5736 filtering_(HeapIterator::kNoFiltering), 5739 filtering_(HeapIterator::kNoFiltering),
5737 filter_(NULL) { 5740 filter_(NULL) {
5738 Init(); 5741 Init();
5739 } 5742 }
5740 5743
5741 5744
5742 HeapIterator::HeapIterator(Heap* heap, 5745 HeapIterator::HeapIterator(Heap* heap,
5743 HeapIterator::HeapObjectsFiltering filtering) 5746 HeapIterator::HeapObjectsFiltering filtering)
5744 : heap_(heap), 5747 : make_heap_iterable_helper_(heap),
5748 no_heap_allocation_(),
5749 heap_(heap),
5745 filtering_(filtering), 5750 filtering_(filtering),
5746 filter_(NULL) { 5751 filter_(NULL) {
5747 Init(); 5752 Init();
5748 } 5753 }
5749 5754
5750 5755
5751 HeapIterator::~HeapIterator() { 5756 HeapIterator::~HeapIterator() {
5752 Shutdown(); 5757 Shutdown();
5753 } 5758 }
5754 5759
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
6483 static_cast<int>(object_sizes_last_time_[index])); 6488 static_cast<int>(object_sizes_last_time_[index]));
6484 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6489 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6485 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6490 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6486 6491
6487 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6492 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6488 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6493 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6489 ClearObjectStats(); 6494 ClearObjectStats();
6490 } 6495 }
6491 6496
6492 } } // namespace v8::internal 6497 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698