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

Side by Side Diff: src/heap.cc

Issue 285693006: Fix Heap::IsHeapIterable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/runtime.cc » ('j') | src/runtime.cc » ('J')
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 4289 matching lines...) Expand 10 before | Expand all | Expand 10 after
4300 AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED); 4300 AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED);
4301 Struct* result; 4301 Struct* result;
4302 { AllocationResult allocation = Allocate(map, space); 4302 { AllocationResult allocation = Allocate(map, space);
4303 if (!allocation.To(&result)) return allocation; 4303 if (!allocation.To(&result)) return allocation;
4304 } 4304 }
4305 result->InitializeBody(size); 4305 result->InitializeBody(size);
4306 return result; 4306 return result;
4307 } 4307 }
4308 4308
4309 4309
4310 bool Heap::IsHeapIterable() {
4311 return (!old_pointer_space()->was_swept_conservatively() &&
4312 !old_data_space()->was_swept_conservatively());
4313 }
4314
4315
4316 void Heap::EnsureHeapIsIterable() { 4310 void Heap::EnsureHeapIsIterable() {
Hannes Payer (out of office) 2014/05/18 18:25:43 Let's rename it to MakeIterable.
Jarin 2014/05/19 06:06:42 Done.
4317 ASSERT(AllowHeapAllocation::IsAllowed()); 4311 ASSERT(AllowHeapAllocation::IsAllowed());
4318 if (!IsHeapIterable()) { 4312 CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable");
4319 CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable");
4320 }
4321 ASSERT(IsHeapIterable());
4322 } 4313 }
4323 4314
4324 4315
4325 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { 4316 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
4326 incremental_marking()->Step(step_size, 4317 incremental_marking()->Step(step_size,
4327 IncrementalMarking::NO_GC_VIA_STACK_GUARD); 4318 IncrementalMarking::NO_GC_VIA_STACK_GUARD);
4328 4319
4329 if (incremental_marking()->IsComplete()) { 4320 if (incremental_marking()->IsComplete()) {
4330 bool uncommit = false; 4321 bool uncommit = false;
4331 if (gc_count_at_last_idle_gc_ == gc_count_) { 4322 if (gc_count_at_last_idle_gc_ == gc_count_) {
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after
6465 static_cast<int>(object_sizes_last_time_[index])); 6456 static_cast<int>(object_sizes_last_time_[index]));
6466 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6457 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6467 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6458 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6468 6459
6469 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6460 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6470 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6461 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6471 ClearObjectStats(); 6462 ClearObjectStats();
6472 } 6463 }
6473 6464
6474 } } // namespace v8::internal 6465 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/runtime.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698